Docsity

Logic Circuits Lab: Understanding Logic Gates and Digital Circuits in TTL Logic Family - P, Lab Reports of Electrical and Electronics Engineering

Toggle sidebar
bg1
ECE 241
Logic Circuit Lab Lab #3; Page 1/16
Fall 2007
Basic Digital Circuits
1 Logic Gates and Circuits
In a digital system there are only two stable states, logic 1 and 0 (or HIGH and LOW, TRUE and FALSE,
etc.) In a popular logic family called TTL (Transistor-Transistor Logic), the low logic level is assigned
to 0V and the high logic level is assigned to 5V. (See pages 98–101 of Logic and Computer Design
Fundamentals by Mano and Kime for more information.) Each logic gate is actually implemented in
part of an integrated circuit (IC), with each gate made using several transistors. For the most part we
do not need to concern ourselves with the actual circuitry inside each gate, only the interconnections
between individual gates. Usually each IC package contains several individual gates. The 7408 chip
implements 4 two input AND gates and is commonly referred to as a “Quad two input AND” chip.
Similarly the 7432 chip is a “Quad 2 input OR” chip while the 7404 chip is a “Hex Inverter” since it
contains 6 inverters. The IEEE standard logic symbols for each of these devices is shown in Figure 1.
The IEEE symbols are better suited to represent ICs than the distinctive symbols since their rectangular
outlines can easily fit together.
(1)
(2)
(4)
(5)
(9)
(10)
(12)
(13)
(3)
(6)
(8)
(11)
1Y
2Y
3Y
4Y
1
A
1
B
2
A
2
B
3
A
3
B
4
A
4
B
(1)
(2)
(4)
(5)
(9)
(10)
(12)
(13)
(3)
(6)
(8)
(11)
1Y
2Y
3Y
4Y
1A
1B
2A
2B
3A
3B
4A
4B
(1)
(5)
(9)
(11)
(13)
(3)
(2)
(4)
(6)
(8)
(10)
(12)
1Y
2Y
4Y
5Y
6Y
3Y
1A
2A
3A
4A
5A
6A
1
≥1
&
7408 7432 7404
positive logic: Y=AB positive logic: Y=A+B
positive logic: Y=A
Figure 1: Standard Logic Symbols
2 Logic Circuits and Diagrams
Each of the chips in Figure 1 are available in 14 pin Dual-In-Line packages or DIPs. The pin numbers
assigned to each logic signal are shown inside brackets in the figure. The pins are numbered as shown
in Figure 2. Pin 1 is usually identified as the pin to the left of an indentation or cutout in one end of the
chip that is visible when the chip is viewed from the top. Occasionally, it is also identified by a printed
or indented dot placed just next to it.
ECE 241
Logic Circuit Lab Lab #3; Page 2/16
Fall 2007
1
2
3
4
5
6
7
8
9
10
11
12
14
13
Figure 2: Identifying Pin 1
You will notice that pins 7 and 14 are not referenced in the logic diagrams. In 14 pin DIP packages,
pin 7 is
usually
connected to ground (Gnd), and pin 14 is
usually
1connected to the 5V power supply
(Vcc). These connections must be made or the chip will not work. TTL logic circuits are not passive!
While TTL circuits are fairly forgiving, they can be destroyed by wiring mistakes. Take care not to
connect pin 7 to power and pin 14 to ground, or to connect the outputs of two or more gates together.
Only open collector and Tri-state gates are designed to operate with outputs of several gates connected
together, and even in these cases, care must be taken.
A complete logic diagram including pin numbers using the 7408 and 7432 chips can be drawn as is
done in either of Figure 3 or Figure 4,
(1)
(2) (3)(1)
(2) (3)
X
Y
Z
FU1: 7432
U2: 7408
Figure 3: A Logic Diagram Using Distinctive Symbols
(1)
(2) (3)
(1)
(2) (3)
≥
1&
X
Y
Z
F
U1: 7432
U2: 7408
Figure 4: A Logic Diagram Using IEEE Standard Symbols
Notice that even though there are four AND gates on each IC, only the gates used are shown, and
each gate is drawn separately. The U (unit) numbers can be used to identify which chip each gate is
found on. A wiring diagram for this circuit is given in Figure 5.
The only diagrams you will need to make for this lab are the logic diagrams with part and pin numbers
as in Figure 3 or Figure 4. They clearly convey how the circuit is intended to work logically, and they
also give the chip and pin numbers which facilitate circuit implementation, testing and debugging.
1Occasionally,different pins are used, so be sure to check the chip’s pinout information in a databook before making any
connections.
pf3
pf4
pf5
pf8

Partial preview of the text

Download Logic Circuits Lab: Understanding Logic Gates and Digital Circuits in TTL Logic Family - P and more Lab Reports Electrical and Electronics Engineering in PDF only on Docsity!

Logic Circuit LabECE 241

Lab #3; Page 1/

Fall 2007

Basic Digital Circuits

Logic Gates and Circuits

to 0V and the high logic level is assigned to 5V. (See pages 98–101 ofetc.) In a popular logic family called TTL (Transistor-Transistor Logic), the low logic level is assigned In a digital system there are only two stable states, logic 1 and 0 (or HIGH and LOW, TRUE and FALSE,

Logic and Computer Design

Fundamentals

by Mano and Kime for more information.) Each logic gate is actually implemented in

outlines can easily fit together.The IEEE symbols are better suited to represent ICs than the distinctive symbols since their rectangularcontains 6 inverters. The IEEE standard logic symbols for each of these devices is shown in Figure 1.Similarly the 7432 chip is a “Quad 2 input OR” chip while the 7404 chip is a “Hex Inverter” since itimplements 4 two input AND gates and is commonly referred to as a “Quad two input AND” chip.between individual gates. Usually each IC package contains several individual gates. The 7408 chipdo not need to concern ourselves with the actual circuitry inside each gate, only the interconnectionspart of an integrated circuit (IC), with each gate made using several transistors. For the most part we

(13)(12)(10)(9)(5)(4)(2)(1)

(11) (8) (6) (3)

4Y 3Y 2Y 1Y

4B4A3B3A2B2A1B1A

(13)(12)(10)(9)(5)(4)(2)(1)

(11) (8) (6) (3)

4Y 3Y 2Y 1Y

4B4A3B3A2B2A1B1A

(13)(11)(9)(5)(3)(1)

(12)(10)(8)(6)(4)(2)

6Y5Y4Y3Y2Y1Y

6A5A4A3A2A1A

1

≥ 1

&

7408

7432

7404

positive logic: Y=AB

positive logic: Y=A+B

positive logic: Y=A

Figure 1: Standard Logic Symbols

Logic Circuits and Diagrams

or indented dot placed just next to it.chip that is visible when the chip is viewed from the top. Occasionally, it is also identified by a printedin Figure 2. Pin 1 is usually identified as the pin to the left of an indentation or cutout in one end of theassigned to each logic signal are shown inside brackets in the figure. The pins are numbered as shown Each of the chips in Figure 1 are available in 14 pin Dual-In-Line packages or DIPs. The pin numbers

Logic Circuit Lab ECE 241

Lab #3; Page 2/

Fall 2007

7 6 5 4 32 1

8 9

1011121314

Figure 2: Identifying Pin 1

You will notice that pins 7 and 14 are not referenced in the logic diagrams. In 14 pin DIP packages,

pin 7 is

usually connected to ground (Gnd), and pin 14 is

usually

1

connected to the 5V power supply

While TTL circuits are fairly forgiving, they can be destroyed by wiring mistakes.(Vcc). These connections must be made or the chip will not work. TTL logic circuits are not passive!

Take care not to

together, and even in these cases, care must be taken.Only open collector and Tri-state gates are designed to operate with outputs of several gates connectedconnect pin 7 to power and pin 14 to ground, or to connect the outputs of two or more gates together.

A complete logic diagram including pin numbers using the 7408 and 7432 chips can be drawn as is

done in either of Figure 3 or Figure 4,

(2)(1)

(3)

(2)(1)

(3)

ZY X

F

U2: 7408U1: 7432

Figure 3: A Logic Diagram Using Distinctive Symbols

(2)(1)

(3)

(2)(1)

(3)

≥

1

&

ZY X

F

U2: 7408U1: 7432

Figure 4: A Logic Diagram Using IEEE Standard Symbols

Notice that even though there are four AND gates on each IC, only the gates used are shown, and

found on. A wiring diagram for this circuit is given in Figure 5.each gate is drawn separately. The U (unit) numbers can be used to identify which chip each gate is

The only diagrams you will need to make for this lab are the logic diagrams with part and pin numbers

also give the chip and pin numbers which facilitate circuit implementation, testing and debugging.as in Figure 3 or Figure 4. They clearly convey how the circuit is intended to work logically, and they

1 Occasionally, different pins are used, so be sure to check the chip’s pinout information in a databook before making any

connections.

Logic Circuit LabECE 241

Lab #3; Page 3/

Fall 2007

7 6 5 4 3 2 1

8 9

1011121314

7 6 5 4 3 2 1

8 9

1011121314

Vcc

Gnd

F

ZY X

Figure 5: A Wiring Diagram

The Digilab Prototyping Board

(.1 inch) apart from each other, which is the standard spacing of the pins on a DIP package.of .22 or .24 gauge wires with 1/4” of insulation stripped from both ends. The holes are spaced 100 milsremaining four holes will be connected to that lead. Nodes can be connected to each other using jumpersin Figure 7. When a component lead is inserted into one of the holes, anything inserted into one of theeasily be inserted. Rows of five or six holes are electronically connected to form a single node as shownCircuit Board (PCB). A breadboard consists of an array of holes in which wires or component leads cancreate an experimental or prototype circuit without having to design and manufacture a costly Printedcircuit is constructed on the breadboard section of the Digilab board. A breadboard is used to rapidly Figure 6 shows how the circuit in Figure 5 can be implemented on a Digilab prototyping board. The

The breadboard has a groove down the center separating one side from the other. When inserting a

in Figure 8.of the chip will be connected. Press the chip down until it touches the surface of the breadboard as shownchip into the breadboard make sure it straddles the central groove, otherwise the pins on opposite sides

Devices inserted on the breadboard can be connected to components on the Digilab board by using

4 used to input logic levels in Figure 6 and LD1 is used to indicate the output of the circuit.jumper wires between the device and the J2 connector. For example, switches SW1, SW2, and SW3 are

Testing and Debugging

for each input combination.inputs are switched through all possible combinations, and comparing the output with the desired output After a circuit is constructed it needs to be tested. This is usually done by observing the output as the

You will know a circuit doesn’t work properly when it gives the wrong

output for a particular combination of inputs. The process of fixing problems in a logic circuit is called

Logic Circuit Lab ECE 241

Lab #3; Page 4/

Fall 2007

8dip

16 dip 20 dip

14 dip

20 dip 20 dip

8dip

8dip

Y

GNDGNDGNDGNDGNDGNDGNDBN2PBN2SBN1PBN1SPINTPWEPDSPASPD7PD6PD5PD4PD3PD2PD1PD0O5O4O3O2O1CLK2VDDVDDVDDVDDVDDVDDVDD

CBCA CDCC CFCE CG A4A3A2A1DP

SW8SW7SW6SW5SW4SW3SW2SW BTN4BTN3BTN2BTN LDG LD8LD7LD6LD5LD4LD3LD2LD

AUD2AUD1AUDC

PWE PASPD7PD6PD5PD4PD4PD2PD1PD PINT PRS PWT PDS GND

PS2DPS2CTXDRXDVSHSBGRO3O2O1GNDGND

SW8 SW7 SW6 SW5 SW4 SW3 SW2 SW LD8 LD7 LD6 LD5 LD4 LD3 LD2 LD1 BTN4 BTN3 BTN2 BTN

(c) CSCOLE 2000

RP

RP

RP

RP

DSP2 DSP

RP

RP

C4 C3 C2 C

RP

U

C

R

RP

RP

C

U

BN

BN

J

J

J

J

J

U U

U

U

U

U

U

U

J J

J

LD

J

J

J

PORT PROG

VDD

GND

CLK

DONE

DIN

PRG

INT

R

SW

RP

RP

C

R

C

C C

C

C

R

D1R3 D

C

R4D3R

C

C

C15 C

C

C

C19 C

C

C

C

C

C

R6 R

R

R

C

J

U U

F Z X

Figure 6: Implementation of a Circuit on a Digilab board

Logic Circuit LabECE 241

Lab #3; Page 7/

Fall 2007

  1. Next, beginning at the output pin, move backwards though the circuit checking the logic at each 1. Use a logic probe to check that power and ground is properly connected to each chip.

both pins 1 and 2 should also be high. If the probe shows that they are, then itis low, we next check the gate inputs at pins 1 and 2 of U2. If pin 3 of U2 is supposed to be high,connection between pin 3 and the LED is broken). Assuming that the probe shows that pin 3 of U2it really is low and that the LED is not just giving a false indication (maybe it is burned out or thean LED to which it is connected. First check pin 3 of U2 with the logic probe to make sure thatnation of inputs, the output at pin 3 of U2 is supposed to be high, but is in fact low as indicated bypoint with the logic probe. For example, consider Figure 3. Assume that, for a particular combi-

appears that the

back through the circuit, until a bad gate or a bad connection is identified.next step is to check the gate output that is connected to this input. Continue this process, workingby indicating neither high nor low. Or it may show that one input is in fact low. In this case thegate is bad. However, the probe may show that one or both inputs are not connected to anything

  1. When you find a gate that appears to be bad because its output does not agree with its inputs and

the logic function it is supposed to implement, there are a number of things to consider.

(a) The pins you thought were input pins may not be. Check the pin numbers for the inputs and

output in the TTL databook. Also check that you properly identified pin one on the chip.

(b) You may have the wrong chip. If you had used a 7400 instead of a 7408 for U2, the output at

the lab can also help you identify chips that have illegible or indecipherable numbers.pin 3 should be low if both pins 1 and 2 are high. Check the chip number. The chip tester in

(c) It may be that the output is being held at the incorrect voltage level by a bad connection. Con-

chips whose gate outputs you have connected together.connection. Since this situation can physically damage chips, you should probably test anydentally connected two outputs together and you should trace down and correct the offendingwith the logic probe. If the probe shows a high or low value on any wire, then you have acci-to the output of the gate you suspect to be bad. Then test the end of each disconnected wirewin this tug of war. To test for this situation, disconnect any wires that are directly connectedbe attempting drive the output low. One gate will be stronger than the other and effectivelyOne gate may be attempting to drive the output to a high voltage level while the other maysider what can happen if the outputs of two logic gates are accidentally connected together.

(d) The gate may in fact be bad. Turn the power off, remove the chip from the circuit and place

This situation needs to be corrected before the chip is placed back in the circuit.that shows a high or low value indicates a point where two outputs were connected together.check the points in the circuit that were originally connected to the chip outputs. Any pointin your circuit. With the chip still out of the circuit, turn the power back on in the circuit andit in the tester. If the chip tests bad (and even if it tests good) you should not simply replace it

  1. If you do not find a bad gate or connection, then the problem is likely in your original design. Go

back and check your work.

Logic Circuit Lab ECE 241

Lab #3; Page 8/

Fall 2007

5 inputs. Once a problem has been corrected, you should retest the circuit by observing the output for all possible

Noise Margin

temperatures. We notice that the actual range of output voltages appears to be from 0the steady state output of a 7404 inverter gate as a function of the input voltage at several operating Earlier, we assumed that the high voltage in TTL is 5V and the low voltage is 0V. Figure 9 shows

V

to 3

V

. We

Vin

Vout

Vin

Vout

0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.

0.00.51.01.52.02.53.03.54.

T=-55ºC

T=125ºC

T=25ºC

Figure 9: 7404 Inverter Transfer Function

notice that, independent of temperature, if

V

in

V

V

out

will be 0

V

so we can safely assume that the

gate will interpret an input voltage greater than 2

V

as a high voltage. Similarly, Figure 9 shows that an

input voltage less than 0

V

will reliably be seen as a low voltage. These two values are presented in

Figure 10 as

V

IH

min

(V Input High min) and

V

IL

max

(V Input Low max). Each individual circuit will

each gate input is either greater thanhave slightly different characteristics, but the designers of TTL circuits guarantee that if the voltage on

V

IH

min

or less than

V

IL

max

, then the voltage on the gate output will

never be less than 2

V

V

OH

min

) for high output or never greater than 0

V

V

OL

max

) for low output.

Typically, output voltages will be nearer the values of 3

V

and 0

V

Note that

V

OH

min

is greater than

V

IH

min

In other words, a TTL output produces a high voltage

greater than that required by another TTL input. The difference between the two values, called the

noise

margin, is 0

V

. The same margin exists for the low voltages. Thus, a line connecting a TTL gate output

to a TTL gate input can tolerate up to 0

V

of noise added to or subtracted from the signal without causing

important to have such noise margins.the input gate to misinterpret the intended logic. Since noise is always present in electrical systems, it is

Logic Circuit LabECE 241

Lab #3; Page 9/

Fall 2007

VIL max VIH min

VOL typVOL max VOHmin VOHtyp

TTL output

TTL input

noise margin noise margin

VO

VI

noise

Figure 10: TTL Voltage Levels

Fanout

I when it changes from high to low, or from low to high. Each gate output can source a current up toEach gate input connected to a given output represents an additional load that the output must overcome Logic gates also have constraints on the number of individual gate inputs connected to each gate output. OH

max

when its output is high.

Each gate input can sink a current up to

I

IH

max

when its input is

( high. From Figure 11 and Kirchoff’s current law, we can determine that the maximum number of inputs n

) an output can drive to a high voltage is given by the equation

I

OH

max

I

IH

max

. Similarly, we can

is the maximumdetermine the maximum number of inputs an output can drive low. The smaller of these two numbers

fanout of a device. For standard TTL logic gates, both these ratios are 20 so each TTL

output should be connected to no more than 20 other inputs.

3

Propagation Delay

Real logic gates also have

propagation delay, that is there is a delay between a change in an input of

an Inverter and defines how propagation delay is measured. Since no voltage level can change instanta-a logic gate and a resulting change in the output of the gate. Figure 12 shows propagation delays for

3 In standard TTL,

I OH

max

=

400

μA

, I IH

max

=

20

μA

,

I OL

max

=

8 mA

and

I IL

max

=

0 . 4 mA

.

Logic Circuit Lab ECE 241

Lab #3; Page 10/

Fall 2007

n

I OH

I IH

I IH

n

I OL

I IL

I IL

n = min(

I

OH

I

OL

I

IH

I

IL

max

maxmax

max

Figure 11: Fanout

t neously, the input and output voltage waveforms in Figure 12 are shown with finite rise and fall times. PLH

represents the low to high propagation delay and

t PHL

represents the high to low propagation delay.

logic levels as the voltages drop below 0The timing diagram in Figure 12 shows how the voltages correspond to logic levels. Rather than switch

V

and rise above 2

V

, the switching takes place at 1

V

times are generally quite short.halfway between the typical high and low values. This is not a bad approximation since rise and fall

Table 1 shows the propagation delays for the different styles of 04 type TTL inverters. The “S” and

t PLH

ns

t PHL

ns

typ

max

typ

max

74LS

74S

Table 1: Propagation Delays for 04 TTL Inverters

7.1 1 assume that the inverter output is driving only a single input of a similar type.with the fanout and can vary if different types of TTL gates are used together. The delays shown in TableThese versions use different circuits to implement logic gates. The propagation delay of a gate increases“LS” designations in Table 1 refer to “Schottky” and “Low Power Schottky” versions of TTL gates.

Timing Diagrams

The effect of propagation delay on circuits is analyzed by means of timing diagrams.

Being able to

construct them is a critical skill that anyone who wishes to design digital circuits must have. Figure 13

Logic Circuit LabECE 241

Lab #3; Page 13/

Fall 2007

1min

on off

100%

0%

12s

10min

1min

Transmitted command

on off

Received command

speedMotor

Figure 14: Delay Models

8 50% of full speed.between when the command to turn the motor on was sent, and when the motor is turning at greater thanthe system has 12 seconds of inertial delay. Thus, there is an overall delay of 10 minutes and 12 secondsto say that the motor is up to speed when it has reached 50% of full speed, then Figure 14 shows thatdelay in the system is shown by the difference in the received signal and the motor speed. If we chosealways be represented by simple time shifts of the signal. The signal itself is not modified. The inertialexactly the same as the transmitted signal except that it is shifted in time by 10 minutes. Pure delays can

Preliminary Questions

  1. The propagation delay in a logic gate is largely inertial in nature due to capacitance in the circuit

that prevents an output voltage from changing instantaneously.

(a) Complete the following voltage level and logic level timing diagrams for the output of a

TTL inverter. Assume that the output of the gate only

begins to change at the point in time

that the input crosses the 1

V

threshold. Since it is an inverter, whenever the input rises

above the logic threshold, the output should

begin to fall. Whenever the input falls below the

logic threshold, the output should

begin to rise. The rate of output voltage change should be

V

t P

where

t P

represents the propagation delay of the device.

Logic Circuit Lab ECE 241

Lab #3; Page 14/

Fall 2007

A

X

X A

tp

tp

tp

X A

1.5V3.0V

0V

1.5V3.0V

0V

timing diagramLogic level timing diagramVoltage level

pwin

pwout

What happened to the output when the input was asserted (above the 1

V

threshold) for a

period just equal to

t P

when we use the above model? What would happen to the output if

the input were to be asserted for a period of time less than

t P

?

(b) Now,

assume that the inverter is a pure delay device. That is, assume that it simply inverts

the input logic and imposes a

t P

pure delay (i.e.: pure time shift) on the output. We could

model such a device by assuming it is constructed by connecting

t P /

10

−

9

feet of wire to the

output of an inverter with

zero propagation delay

4

. Add a line to the above logic level timing

device.diagram showing what the logic output would look like if the inverter behaved as a pure delay

  1. In the following circuit,

n

represents the number of inverters in the circuit. Using an inertial delay

model for all gates, construct two logic timing diagrams for the circuit. In one assume

n

  1. In the

other assume

n

  1. Assume that the inverters have 10

ns

propagation delays and that the NAND

gate has a 12

ns

propagation delay. Start the timing diagrams with

A

high (assume that

A

has been

high for a long time), then let

A

go low for 40

ns

and then high again.

A

F

n

4 The pure propagation delay of an electrical signal in wire is about 1

ns

per foot.

Logic Circuit LabECE 241

Lab #3; Page 15/

Fall 2007

The Lab

In this lab we will investigate the effect of fanout upon dc and ac behavior.

  1. Wire up the circuit in Figure 15 as shown in Figure 16 where

n

is the number of inverter inputs

connected or disconnected to varyconnected to the output of a single inverter. The dashed lines represent jumper wires which can be

n

.

Start with none of the dashed wires connected. Connect one

OUT

IN

nc nc nc

n

Figure 15: Schematic of Fanout Circuit

GND

GND

VDD

VDD

VDD

OUT

GND

74x

74x

74x

IN

J

J

J

Figure 16: Fanout Experiment Setup

Record the voltages at OUT with both High and Low input signals for each configuration:on the multimeter to measure volts.) Record your observations and include them in your lab report.the multimeter to your OUT signal on the Digilab board. Make sure that the ‘V’ switch is pressed“banana clips” to connect COMMON on the multimeter to GND on the Digilab board and V onof the switches to IN. Use a multimeter to measure the voltage from GND to OUT. (To do this use

Logic Circuit Lab ECE 241

Lab #3; Page 16/

Fall 2007

(a) No jumpers connected; zero fanout. (b) J1 connected; fanout of 5. (c) J1 and J2 connected; fanout of 11. (d) J1, J2, and J3 connected; fanout of 17.

What can you conclude from your recorded voltages?

  1. Now use the function generator to apply a 1 MHz square wave to the input inverter and use the

an output inverter, under (a) fanout of 5, and (b) fanout of 17.oscilloscope to measure the propagation delay from the input of the input inverter to the output of