# E15A Laboratory 1

## Combinational Logic with Discrete Gates

In this lab you will be building some simple circuits using logic gates.

Connect the breadboard, to the Input/Output tester (I/O) circuit as shown. We will build circuits on the breadboard, and use the I/O circuit to generate and display binary values.

• Connect one end of a wire (red, if possible) to the tester where it says "Vcc" this is at 5 volts, and the other to the breadboard in the column labeled "+". This connects all of the hole in that column to +5V (as shown by blue highlight). Likewise each row of 5 horizontal holes is connected (the 5 holes at the row labelled 15 on the left side are all connected, and the 5 holes on the right side are all connected, but there is no connection through the center gap).
• Repeat for the black wire ("Gnd" to "-").
• Plug the lower of the two boards to a 9 volt "wall wart" power supply.

The outputs B, C, D represent a 3 bit binary number and should be counting up from 0 to 5 in a pattern:

 Decimal Binary B C D 0 0 0 0 1 0 0 1 2 0 1 0 3 0 1 1 4 1 0 0 5 1 0 1

If the board is not counting from 0 to 5

If the LED's are not changing do the following:

• Press and hold the MODE button.
• Press and release the SEL button until the Y LED is on and the Z LED is off.

If the count is not going from 0 to 5 (decimal):

• Press and hold the MODE button.
• Press and release the R/S button until the W, X, Y, Z buttons display 0, 1, 0, 1.

The breadboard now has power, and is generating a test sequence, and we can build a circuit on it.

### Building a simple circuit

The circuit we wish to build is shown below. There are two inputs and one output.

In other words, W is the result of C NANDed with the inverse of D.

To build this circuit we need a 2 input NAND gate which exists on an integrated circuit (IC) called the 7400. It's pinout is shown below next to a photograph of an IC.

Things to note:

• There is a small cutout in the body of the IC (photogaph on left) and a "D" shape at the top of the diagram on the right. This marks the polarity of the device. (Sometimes, instead of a cutout there is a small circle near pin 1 on the IC).
• Starting at the top left, pins are labelled from 1 to 14 in a counterclockwise direction.
• Pin 7, lower left, is labelled GND (ground) and pin 14, upper right, is labelled Vcc. This is where the IC gets power, 0V (ground) to pin 7 and 5V (Vcc) to pin 14. Every IC needs to have power applied to work properly.
• There are four 2-input NAND gates. The first one has inputs on pins 1 and 2 and output on pin 3, and so on...

To connect our circuit we ill take the output labeled ~D (not D) to pin 1, the output labelled C to pin 2 and the input labelled W to pin 3.

Note that:

• the power bus, Vcc, is attached to the Vcc input (pin 14) of the IC with a short red wire.
• the ground bus is attached to the GND input (pin 7) of the IC with a short orange wire.
• the output labelled C from the I/O test circuit is attached to pin 2 of the IC by a blue wire. Note the nomenclature can get a bit tricky - the output from the I/O test circuit is the input to our circuit. Pin 2 is one of the inputs of the top left NAND gate on the IC.
• the output labelled ~D (not D, i.e. the logical inverse of D) is attached to pin 1 of the IC with a white wire. This is another input to the top left NAND gate.
• the output of the NAND gate is attached to the W input of the I/O test circuit with an orange wird.

Connect the circuit as shown. The output should be high except when C is high and D is low, as shown in the truth table below.

 C D ~D W 0 0 1 1 0 1 0 1 1 0 1 0 1 1 0 1

TTL Pinouts (from:http://www.tayloredge.com/reference/Packages/pinouts/). You should only need NAND gates and invertors (7400, 7404, 7410, 7420).

 7400 2 input NAND 7404 INVERTER (1 input NAND) 7410 3 input NAND 7420 4 input NAND

Your task is to make the outputs WXYZ display a pattern where one LED is lit at a time as it goes back and forth (see diagram below) as the outputs B, C, D go from 0dec (000bin) to 5dec (101bin) as shown below

 B C D W X Y Z 0 0 0 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 1 1 1 0 0 0 1 0 0 0 1 0 0 1 0 1 0 0 1 0

As the number counts repeatedly from 000bin to 101bin a single lit LED will move back and forth.

• Task 1a:  Truth tables for W, X, Y and Z. Use don't care (x) where appropriate.
• Task 1b: Karnaugh maps for W, X, Y, and Z.
• Task 1c: Simplified sum of products expressions for W, X, Y and Z
• Task 1d: Draw the sum of products circuits using ANDs and ORs.
• Task 1e: Draw the sum of products using NANDs only (consider a NOT gate (invertor) to be a one input NAND gate). You have 1, 2, 3, and 4 input NAND's available.
• Task 1f: Build the circuit and demonstrate that it works.

Design a system that accomplishes the same task but with 5 LEDs (labelled V to Z). Show all required work. You don't need to actually build the system

Repeat task 2 for six eyes (labelled U-Z)

Demonstrate that a circuit implementing sum of products (ands followed by ORs) can be replace by all NANDs by creating the truth table for

and for

### To Turn in:

Each part of each task should be well labeled and in order. Each group should turn in one report on moodle. The report need not include a lot of prose - just make sure to clearly

• Task 0: Include a title page with the names of all of the people in your group. (5 points)
• Task 1: Include: (45 points)
• Task 1a:  (5 points) Truth tables for W, X, Y and Z. Use don't care (x) where appropriate.
• Task 1b: (10 points) Karnaugh maps for W, X, Y, and Z with groupings shown.
• Task 1c: (10 points) Simplified sum of products expressions for W, X, Y and Z.
• Task 1d: (5 points) Draw the sum of products circuits using ANDs and ORs.
• Task 1e: (5 points) Draw the sum of products using NANDs only (consider NOTs to be one input NANDs).
• Task 1f: (10 points) Build the circuit and demonstrate that it works.
• Task 2a: (5 points) )How many inputs are needed.
• Task 2b: (5 points) Do you expect the resulting circuit to be more or less complicated than the previous one due to the lack of "don't care" states. Why or why not?
• Task 2c: (10 points) Create a sum-of-products (AND/OR) design and explain your reasoning as you go. You don't need to build this design. The explanation need not be long, but should be at a level that another student in the class could understand your solution.