Professional Documents
Culture Documents
OBJECTIVES
1. To test the operation of a 74LS74 D flip-flop and compare the operation with the
predicted behavior
2. To test the operation of a 74LS112 J-K flip-flop and compare the operation with the
predicted behavior
3. To measure propagation delays of a 74LS112 J-K flip-flop
4. To build and test an enhanced adder-subtractor
II.
PARTS LIST
Equipment:
IBM PC or Compatible with Windows 2000 or Higher
Quartus II Design SoftwareVersion 9.1
Frequency Generator
Oscilloscope
Parts:
2 330 resistors, W
1 74LS74 dual D flip-flop
1 74LS112 dual J-K flip-flop
1 eSOC III FPGA Board
III.
2 Red LEDs
1 Green LED
1 SPDT Switch, DIP configuration
PROCEDURE
Laboratory Number: 7
Page 1 of 14
2. Using the circuit, verify that the operation follows the truth table for this device.
Laboratory Number: 7
Page 2 of 14
The circuit construction is shown below (if you are not able to find a similar SPDT switch in
your parts and tools box as shown in the circuit diagram, try to use a jumper wire to switch
between Vcc and the Ground)
The circuit operation should reflect the theoretical truth table. You need to show some
photos here to demonstrate the circuit operations.
Laboratory Number: 7
Page 3 of 14
You can use the scope to measure clock signal generated. Adjust the signal as necessary.
Laboratory Number: 7
Page 4 of 14
Use DMM to measure voltage points when checking the circuit and performing
troubleshooting.
3. What happens when both PRE and CLR are set low?
Ground pins 1 and 4 and Observe the output LEDs status.
__________________________________________________________________
Laboratory Number: 7
Page 5 of 14
2. Using the circuit, verify that the operation follows the truth table for this device.
Laboratory Number: 7
Page 6 of 14
The clock input from the function generator (refer to the previous discussion and
photo)
Use DMM to measure voltage points when check the circuit the doing
troubleshooting
3. Increase the pulse generator output to 1.0 MHz. Set the switches so that all of the flipflop inputs are high and remove the LEDs and resistors. Using the oscilloscope, measure
the propagation times for the Q output from the active clock edge. Record the value
below.
Laboratory Number: 7
Page 7 of 14
If you are not able to get 1 MHz from your pulse generator, you may try to get a lower
frequency (lets say 450 KHz) as shown below.
Laboratory Number: 7
Page 8 of 14
The signal below shows the delay time between input signal and output signal. You can run
the stop mode on the scope, decease the time scale to have better view of the signals. Review
the concepts of and how to measure t pLH and t pHL (if they are not clear in the lecture or
in the textbook, there are good websites explaining them). Check datasheet for the
theoretical range and your measurements should be within it.
tPHL = ______________________
tPLH = ________________
Laboratory Number: 7
Page 9 of 14
C. Enhanced Adder-Subtractor
1. The adder-subtractor circuit built in Lab 5 has a fundamental weakness. Whenever any of
the inputs is changed, the output changes. This would present a significant problem in
building a calculator since the user only wants the selected operation to occur when the
equal button is pressed. We can modify the circuit from Lab 5 to operate in this way by
adding in flip-flops to store the outputs only on the activation of a clock signal.
2. Using Quartus II, modify the circuit from Lab 5 as shown in Figure 7.3 by adding three
7474 D-flip-flip chips. Note that a clear function has been added and that the flip-flop
presets are inactive since they are tied to +5V (labeled VCC).
Make sure your circuit is wired correctly. It is easy to make a simple mistake and you need to
double check. One wiring error is going to cost you a lot of troubleshooting effort.
Laboratory Number: 7
Page 10 of 14
For the above waveforms Case 1: from time duration 0-1000 ns:
A=0011; B=0001; ADDSUB = 1 (meaning performing subtraction); the SUM output
S4S3S2S1=0010; and Carry COUT=1 (meaning positive result). You dont need to perform
2s complement for positive result.
The waveform verifies that in Base-10, its: 3-1=+2
Case 2: from time duration 1000-2000 ns:
A=0010; B=0101; ADDSUB = 1 (meaning performing subtraction); the SUM output
S4S3S2S1=1101; and Carry COUT=0 (meaning negative result).
2s complement for SUM = 0011
The waveform verifies that in Base-10, its: 2-5= -3
Laboratory Number: 7
Page 11 of 14
4. Assign pins to the inputs and outputs. Use the DIP switches for your inputs (0-3 for A, 811 for B, 7 for CLEAR, 15 for ADDSUB), one of the debounced pushbuttons for
CLOCK and the red LEDs for outputs (RD0-4).
The pin planner map is shown below.
5. Download your program to the eSOC III board and test the operation of the circuit.
6. Photograph your final circuit for submission (online) or demonstrate your circuit to your
professor (onsite or blended).
Photos below show the circuit after the program is successfully downloaded and executed.
Below demonstrate Case 1: A=0011; B=0001; ADDSUB = 1 (meaning performing
subtraction); the SUM output S4S3S2S1=0010; and Carry COUT=1 (meaning positive
result).
Laboratory Number: 7
Page 12 of 14
Laboratory Number: 7
Page 13 of 14
Laboratory Number: 7
Page 14 of 14