Beruflich Dokumente
Kultur Dokumente
Experiment #9
Fall 2001
Introduction
Most physical quantities can assume any value within some continuous range; this value varies
with time in a dynamic process. The output voltage of a transducer that observes it will change
with time in an analogous way. Such continuous signals, V = V(t), are called analog signals, and
circuits which preserve the information in this form, such as linear amplifiers and sine-wave
oscillators, are collectively known as Analog Electronics.
In contrast to this, the voltages in digital circuits have only two states: HIGH and LOW.
Information is conveyed by the pattern of HI and LO voltages. These may occur at the same time
in a set of parallel wires (parallel or combinational logic); or as a time sequence of HIGHs and
LOWs moving along a single wire (sequential logic).
Analog information can be translated into digital form by an Analog-to-Digital Converter
(ADC). A set of N on/off values or BITS has 2N possible different values. If you try to represent
a voltage, V, by a 7 bit sequence, your uncertainty will be about 1%, since there are 27 = 128
possible combinations of digital values. A higher accuracy needs more digits or bits.
Readings
1. D & H, 11.1-11.5, 12.1-12.5.
2. (Optional) (a) Horowitz and Hill Chapter 8. (b) Brophy: Chapter 9 Digital Electronics.
Pages 272-290: Digital logic, Boolean Algebra, and Logic circuits. (c) TTL Cookbook,
Don Lancaster, SAMS (1974).
Experiment #9
9.1
Fall 2001
Outline
1. Set up and test the 10-element LEDs as logic state indicators.
2. Verify the truth tables for the NAND, NOR, and INVERT gates. Carry out the INVERT
operation by making suitable connections first to a NAND gate, then to a NOR gate. Thus
you can dispense with the INVERT gates if only a few are needed.
3. Verify the truth table for an EXCLUSIVE OR (XOR) gate. Design, build, and test your own
XOR circuit using only NAND and NOR chips.
4. Design, build, and test a TTL Digital Clock using a 555 timer chip. Convert the clock to an
electronic stop-watch. Use a NAND gate to control the flow of pulses and the counter/timer
to totalize the number of them in your measured interval.
5. Construct a RESET- SET (RS) memory element using two NOR gates. Derive the truth table
by reasoning, then verify it with the LEDs. Demonstrate a complete memory cycle: Set,
Store, Reset, Store, Set. Examine the effect of the illegal (S=1, R=1) for both possible
previous states.
6. Construct an empirical truth table for the JK flip-flop directly from your observations with
LEDs. Does it agree with the Boolean expression for the output in Figure 9.5? With the
oscilloscope, look at the toggling action of the flip-flop for clock pulses from your TIMER
when J=K=1.
Experiment #9
9.2
Fall 2001
Experiment #9
9.3
Fall 2001
typical 3.5 V
2.8
Transition from LOW
to HIGH
0.8
LOW
typical 0.4 V
0
Time
TTL logic levels
Logical States
Logical 1 = YES = TRUE = Switch closed = +5 V (TTL Logic)
Logical 0 = NO = FALSE = Switch opened = 0 V (TTL)
Basic Logic Operation
Operation
Switches
A
AND
Condition that
circuit is closed
Series
Boolean
Notation
Symbol
Truth Table
(A AND B are
closed)
A B or
AB
A
B
A.B
(A OR B is closed)
A +B
A
B
A+B
1 means open
0 means closed
NOT A A
A
OR
B
Parallel
NOT
Same as
invert
Other Gates
NAND
Different
switch
A
B
A.B
NOR
A
B
A+B
XOR
A
B
A+B
=AB+AB
Experiment #9
9.4
A B
A.B
0 0
0 1
1
0
1 1
A B
0
0
0
1
A+B
0
0
1
1
_
A
Fall 2001
0
1
0
1
0
1
1
1
_
A A
0
1
1
0
Boolean Algebra
Fundamental laws
We imagine a logical variable, A, that takes on the values 0 or 1. If A = 0 then A = 1 and if
A = 1 then A = 0
OR
A +0 = A
A +1 = 1
A+A=A
A + A =1
AND
A0 = 0
A 1 = A
A A = A
A A =0
NOT
A + A =1
A A =0
A=A
Equality
Two Boolean expressions are equal if and only if their truth tables are identical.
Associative Laws
( A + B ) + C = A+ ( B + C)
( AB)C = A( BC)
Distributive Laws
A(B + C ) = AB + AC
Related identities:
( A + AB) = A
( A + A B) = A+ B
( A+ B) ( A + C ) = ( A + BC )
DeMorgans Theorems
A B K = A + B +K
A + B +K = A B K
Example of Method of Proof:
Heres an example of proving theorems by direct comparison of truth tables. We take on
DeMorgans first theorem for two variables, AB = A + B :
A
AB
AB
0
0
1
1
0
1
0
1
0
0
0
1
1
1
1
0
0
0
1
1
0
1
0
1
Experiment #9
9.5
A
1
1
0
0
A+B
1
0
1
0
1
1
1
0
Fall 2001
The last columns of the truth tables are identical. Thus, the first theorem is proven for two
variables .
Examples of simplification:
Boolean algebra can be used to simplify logical expressions and reduce the number of gates
required in a circuit. Here we show two ways to implement the expression, Y = A + A BC:
A) DIRECT IMPLEMENTATION using NOT, NOR, and NAND
A
A
BC
B
C
B) SIMPLIFIED CIRCUIT
ABC
BC
Y = A+ABC
= A+BC (by identity #2)
= A+BC (by property of NOT)
= A(BC) (by De Morgan's Law)
A+ABC
ABC
Y = A+ABC
A
Y = A+ABC
B
C
AB = AB = A + B
ABCD = AB.CD = AB + CD
A + B = A + B = A.B
A + B + C + D = (A+B) + (C+D)
= (A+B).(C+D)
A
B
{
{
C
D
A
B
Y = ABCD
Y = A+B+C+D
C
D
Experiment #9
9.6
Fall 2001
logic values of the earlier signals. The fundamental circuit is the RS memory element. The JK
flip-flop possesses external controls over the input to an RS memory that lies at its core.
RS (Reset-Set Memory) Element
RS MEMORY
Signals
Symbol
Circuit
Q=R+P
S
Q
SET
RESET
time S
P=S+Q
Truth Table
S
0
1
0
1
R Q P=Q
0 Stays the same
0
0 1
1
1 0
1 0
0 P=Q
Disallowed
Data inputs
C
Qn
J
Clock
Input
Qn+1
time
CLR C J
Q
C
K Q
CLR
Direct
Input
Outputs
Qn+1 Qn+1
0
0
1
1
Qn
1
0
Qn
0
1
1
1
1
0
1
0
1
anything
Qn
0
1
Qn
1
Experiment #9
9.7
Fall 2001
downward going trailing edge of the clock pulse, as indicated by the downward arrow in the
truth table.
The direct input, CLR, overrides the clock and data inputs. During normal operation, CLR = 1.
At the moment CLR goes to zero, the output goes to zero and remains there so long as CLR = 0.
All these options are contained in the Boolean expression in the figure.
555 Timer and digital clock
Control
5
Voltage
Threshold 6
3
Output
Lower
Comp.
Clear
5 k
1 GND
2 TRIG
DIS
3 OUT
Discharge 7
Ground
R Q
+
Reset
Output
Amplifier
5 k Comparitor
5 k
Trigger
RST
555
DC supply 8
THR 6
BYP 5
Discharge
switch
Experiment #9
9.8
Fall 2001
2 TRIG
DIS
3 OUT
THR
4 RST
BYP 5
555
Output
1 GND
RA
RB
VC
0.1uf
C
0V
.667 V+
Threshold Level
.333 V+
Trigger Level
time
t2
DC Volts
V+
t1
Pin 3
Output Voltage
time
Problems
1. Enter in your lab book the circuit diagrams and truth tables of all the circuits you will test.
2. Prove DeMorgans second theorem by comparing the truth table for both sides of the
equation:
A +B = A B
Use the laws of Boolean algebra (see discussion on following pages) to derive the following:
Experiment #9
9.9
Fall 2001
A + AB = A
A ( A + B) = A
A + A B = A+ B
3. Design a circuit to perform the EXCLUSIVE OR function. Try to simplify the circuit so that
you use the smallest possible number of NAND and NOR gates. Show your Boolean
calculation. Check the result using truth tables.
4. Derive the truth table for a RS memory element made from two NOR gates. (See Fig. 9.4).
Show the details of your derivation.
5. Design a 1KHz clock based on the type 555 TIMER chip. Make the low level pulses 1/4
period in length. Arrange that the clock can also be made to run at 1 Hz (for visual
observation of LEDs) by substituting a larger capacitor. Predict the output for the NAND
gate in Fig. 9.10 for VB=0 or 5 V (see Figs. 9.6 and 9.10)
6. A JK flip-flop with J=K=1 and CLR=1 is driven at the clock input by 1 KHz pulses from the
NAND gate following the TIMER. Diagram the waveforms for the clock and the Q output on
the same time scale. (See Fig. 9.5 and 9.11).
Experimental Details
7400 Series TTL Chips
Logic Levels. For the TTL family, logical 0 is 0 V and logical 1 is 5 V, ideally. In
practice, LOW is roughly 0.4 V and HIGH is 3.5 V.
DIP Packages. DIP means dual-in-line arrangement of pins. This is the type of chip
package that plugs into your circuit board. A DUAL chip means that there are two elements
of the same kind in one package, QUAD means four and HEX means six. Straighten the pins
gently before you plug into the board. Lever out with a screwdriver.
Power supply. Check your power supply before connecting to the circuit board:
+5.0 V
Absolute maximum:
+5.5 V
Current:
Type 7486:
Output. The output from each individual gate can drive up to ten other TTL inputs. This is
called the fan-out number. The output is delayed 10 nsec after the input for the INV,
NAND, and NOR gates. The delay is 18 nsec for the EXCLUSIVE OR, and 25 nsec for the
JK flip-flop.
Experiment #9
9.10
Fall 2001
Pin Layouts. Each chip has a dot or notch to indicate the ends at which pins 1 and 14 are
located. The pin numbers increase sequentially as you go counter-clockwise around the chip
in a top view.
In 14 pin chips, Pin 7 is always grounded (0 V) and Pin 14 is always connected to the
+5 V supply.
Power Supply. Set the voltage to 5 V BEFORE connecting to the circuit board. A previous
user may have left it on 15 V. The logic chips burn out around 6 V. If the voltage drops when
you connect to the circuit, DO NOT TRY TO INCREASE V. Increase the current limit
instead.
Decoupling of Voltage Spikes: Fast voltage spikes originating from electrical machinery in
the building, or from other chips on the board, can be transmitted through the power lines to
your circuit board and/or other chips, and cause unwanted triggering of the flip flops. As a
precaution, always mount a capacitor of at least 0.1 f between the +5V line and ground on
your circuit board at each chip.
Data Records in the Logic Labs: For the experiments in the logic labs, write in your lab book
the circuit, the Boolean equation that expresses its function, and the predicted truth table
beforehand. Enter the observed logical values of the outputs in an adjacent, but separate
column. It is important to have the observed result along-side the predicted ones. Particular
discrepancies can suggest where to look for the wiring errors or damaged gates.
Logical inputs and observation of logical outputs with LEDs: Input logical values can be set
by connecting wires from the gate inputs to either 0 V (logical 0) or 5 V (logical 1). The logic
level of the output can be observed using a light emitting diode (LED) which is connected
Experiment #9
9.11
Fall 2001
from the output to ground. The LED lights up when the output is +5 V and is off when the
output on 0 V. The cathode of the LED is grounded, and must always have a 470 to 680
resistor in series to limit the current and prevent burnout.
A bank of ten LEDs in a DIP package (type MV57164) is available. We suggest that you keep
one bank of LEDs on your board throughout the logic experiments. The pin diagram is given
below.
1
0
0
0
ON
OFF
OFF
OFF
0
0
1
1
A
B
0
1
0
1
Y= A+B LED
MV57164
Outputs from gates connect on this side. 0V is OFF, 5V is ON
10
9
The Experiment
LED testing
Before doing anything else, check that each LED lights up when the positive end is connected to
the 5 V supply. If it fails to light, check the polarity. The truth tables in most parts of the
experiment will be verified in this way.
Truth tables for the TTL gates
Verify the truth tables for the NAND (7400), NOR (7402), and INVERT (7404) gates, using
the LED indicators.
Connect a NAND gate so that it performs the INVERT function. Do this for a NOR gate
also. This trick will be convenient in effecting economies in complex circuits.
Occasionally you will find a non-functioning gate. Label the chip immediately. Throw the
complete chip into the trash if an instructor confirms your diagnosis. Remember however, that
most problems arise from wiring mistakes.
The EXCLUSIVE OR circuit
Now build and test the XOR circuit of your own design using only the NANDs and NORs.
Experiment #9
9.12
Fall 2001
The RS memory
Build the RS memory from two NOR gates. Compare the observed truth table with your
predicted table, using LED indicators.
Demonstrate the memory property by going through a complete memory cycle: Set (R = 0, S
= 1), Store (0, 0), Reset (1, 0), Store (0, 0), Set (0, 1).
Examine the effect of the illegal input (R = 1, S = 1), for different initial states of the RS
system.
Build the 1 KHz digital clock using a 555 Timer according to your design in problem 4.
Verify with the oscilloscope that the frequency, the pulse length of 250 sec, and the nominal
5 volt amplitude are approximately correct.
Check that a suitable large capacitor placed in parallel with the existing one converts the
clock to 1 Hz.
Set up a NAND gate to control the transmission of clock pulses by means of a DC logical 0
or 1 control voltage. The output pulses for the NAND should be positive.
Convert to an electronic stopwatch, using the counter / timer and the front panel switch for
start and stop.
10X Probe
555
Clock
5V
SCOPE
CH. 4./ Trig.
CH. 1.
VB
Counter/
Timer
0V
Set to
Totalize
Panel Switch
Construct an empirical truth table for the JK from your observations using the LED
indicators. Since the output depends upon the previous state, Q, you will need to tabulate
Qn +1 for both possible previous states, Qn = 0 and Qn =1 . We suggest that you add a
redundant column, Qn + 2 , (see truth table in Fig. 9.5)to get a better feel for the behavior of the
flip-flop.
Experiment #9
9.13
Fall 2001
Set CLR = 1 and J = K = 1. Now drive the clock input of the JK with 1 KHz pulses from
your TIMER circuit. Use the oscilloscope to observe the clock input (positive pulses out of
the NAND gate), and the output, Q, of the JK. What happens when J = K = 0?
Wires from 5V or 0V
SCOPE
555
Clock
CH. 1.
C
K
5V
0V
Panel Switch
Experiment #9
9.14
Fall 2001