• BME 210
• # Lab 10: Digital Logic

## 1. Objectives

By the end of this laboratory session students should be able to:

• Interpret a truth table
• Understand a diagram for a chip containing logic gates
• Wire a combinational circuit on a breadboard
• Wire a sequential logic circuit on a breadboard

## 2. Background

Digital logic is the basis for all modern computing.

The smallest unit of digital information is a binary digit, or bit. A bit can be either true or false.

Bit Logic State Voltage State Binary Value Voltage
True High 1 +5 V
False Low 0 0 V

In this lab, we will introduce both combinational and sequential logic.

Combinational digital logic functions include AND, OR, NOT, NAND. The output of a combinational logic circuit evaluates almost immediately with a change in input.

Sequential or clocked logic functions include FLIP-FLOPs and other types of memory. The output of a sequential logic circuit updates in response to a clock edge.

The logic values of an operator can be represented in a truth table. See Table 2 and Table 3 below for a summary of the digital logic functions used in this exercise.

A couple of notes:

1. For this lab, all the chips use TTL, (transistor transistor logic).
2. TTL circuits are powered by +5 V. Don’t forget to hook up the power. In this procedure, active low signals are indicated by a “*” (e.g. Q* is an active low signal)
Operator Logic Symbol Chip Number Truth Table
NOT
(Inverter) 7404 IN OUT
1 0
0 1
OR 7432 A B OUT
-------
0 0 0
0 1 1
1 0 1
1 1 1
AND 7408 A B OUT
-------
0 0 0
0 1 0
1 0 0
1 1 1
NAND 7400 A B OUT
-------
0 0 1
0 1 1
1 0 1
1 1 0

Operator Logic Symbol Chip Number Truth Table
D FLIP-
FLOP 7474 D CLK Q Q'
------------------
X 0 u u
X 1 u u
0    ↑    0 1
1    ↑    1 0
0    ↓    u u
1    ↓    u u

Note: X = “Don’t care”, u = unchanged and not Q = Q'.

## 3. Laboratory Equipment

1. Powered breadboard with logic indicators and logic switches. (e.g. Global Specialties PB503)
2. Combinational logic IC’s
• 7402 – hex inverter
• 7408 - quad 2 input and gate
• 7432 – quad 2 input or gate
3. Sequential logic IC’s
• 7474 – Dual D Type flip flop
4. 1 k$\Omega$ resistors

## 4. Procedure

### 4.1. Breadboard Setup Figure 1. Powered breadboard setup.
1. Power switch

a. It’s good practice to turn the power OFF when building or changing a circuit.

b. Be sure your powered breadboard is turned ON when you are testing your circuits. When the power is ON, the switch in the upper left will glow red.

2. Logic Switches

a. On the lower left of the powered breadboard is an area marked logic switches.

b. There are 8 switches S1–S8 that can put out a logic low or a logic high. For this lab set the switch labeled +5, +V to +5.

3. Logic indicators

a. On the right-hand side of the powered breadboard is an area marked logic indicators and there are 8 red LEDs and 8 green LEDs. The logic indicators will indicate the logic state on a wire as follows:

• RED LED ON → a logic HIGH
• GREEN LED ON → a logic LOW

b. For this lab:

• Set the upper switch (labeled +5, +V) to +5
• Set the lower switch (labeled TTL, CMOS) to TTL

c. Test the operation of the logic switches & logic indicators by running a wire from the output of one of the logic switches, to the input of one of the logic indicators, as shown below in Figure 2. As you flip the switch, the logic indicator should change state. Figure 2. Logic switch and logic indicator.
4. Debounced Pushbuttons

a. On the left-hand side of the powered breadboard is an area marked Debounced Pushbuttons. We will use these buttons to create “clean” pulses for the digital clock inputs.

b. Test the operation of the debounced pushbuttons & logic indicators by building and testing the circuit shown below in Figure 3. Figure 3. Normally low pushbutton with a pull-up resistor and logic indicator.

### 4.2. Combinational Logic

1. Construct the circuit shown below in Figure 4.
2. Use the logic switch and the logic indicators to construct a truth table. Confirm that the truth table is correct for an inverter. Include the table in your lab report. Figure 4. Inverter circuit.
3. Construct the circuit shown below in Figure 5.

4. Use the logic switches and the logic indicator to construct a truth table. Confirm that the truth table is correct for a two input AND gate. Figure 5. A 2-input AND Gate Circuit.
5. Construct the circuit shown below in Figure 6 using OR gates found in the 7432 chip. Refer to the datasheet for chip-pin diagrams.

6. Use the logic switches and the logic indicators to construct a truth table for this circuit. Include this truth table in your results. Figure 6. Three input OR circuit, using two-input OR gates.
7. Design and build a combinational logic circuit with three inputs, A, B, C and one output, OUT, that has the behavior described below. Include a truth table, and a sketch of the logic circuit in your lab report. Be sure to demonstrate your circuit’s operation to your TA.

If input A is high:
* the output will be high
* inputs B & C are ignored

If input A is low:
* and BOTH inputs B and C are high, then the output is high
* for all other combinations of B and C the output is low.


### 4.3. Sequential Logic

1. Construct the circuit shown below in Figure 7. This is a single D-type flip-flop circuit.
2. Use the logic switches and the logic indicators to construct a truth table. Confirm that the truth table is correct for a D type Flip-flop. Include the table in your results.
3. What is the relation between the Q and the Q* outputs? Figure 7. Single D-type Flip-Flop with switches and indicators.
4. Starting from the circuit above, Construct the circuit shown below in Figure 8.

5. What happens each time you press the button? Figure 8. Toggle flip-flop.
6. Construct the circuit shown below in Figure 9 using both halves of the D-Flip-Flop Chip. Refer to the datasheet for chip-pin diagrams.

7. Record the sequence of the two indicators. Include the table in your results.

8. What is this circuit doing? Figure 8. Mystery circuit.

## 5. Results

1. Include the Truth Table from your circuit in step 2, Section 4.2.
2. Include the Truth Table from your circuit in step 4, Section 4.2. Does the circuit work as expected?
3. Include the Truth Table from your circuit in step 6, Section 4.2.
4. Include a truth table, and a sketch of the combinational logic circuit you designed in step 7, Section 4.2. Does the circuit work as expected?
5. Include the Truth Table from your circuit in step 2, Section 4.3. Does the circuit work as expected?
6. What happens when the CLK input changes from low to high?
7. What happens when the CLK input changes from high to low?
8. What is the relation between the Q and the Q* outputs?
9. From step 5, Section 4.3., describe what happens each time you press the button.
10. From steps 6, 7, and 8 in Section 4.3., describe what happens each time you press the button, and record the sequence in a table.
11. What is the circuit in Figure 8 doing? (Hint, read about binary numbers on Wikipedia.)

Last updated:
January 6, 2018