



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Purpose: The purpose of this laboratory is to examine the difference in delays of a four-bit D Flip Flop counter given by a simulator and the actual circuit. The counter will be created using 74LS74A flip flops, and a “sum” bit will be examined from each flip flop’s “Q” output. Since this flip flop triggers on the rising edge of the clock signal, the delay will be calculated from each clock rising edge to the change of the “sum” bit in the count sequence. The simulated circuit will be constructed using 7474 flip flops of the Altera library, and analyzed via MAXPlus+ II wave form simulations. Each sum bit of the actual counter circuit will be analyzed on the oscilloscope.
The delay will be calculated using each method of evaluation. The overall intent of this experiment is to either gain or lose trust in circuit simulators.
Procedure: The simulation of the circuit is the first part of this lab that was completed. The circuit was simulated using a MAXPlus+ II Block Diagram/Schematic File and components of the Altera library. The four-bit binary-up ripple adder requires two 74LS74A D flip-flops, three input pins, and four output pins. These components were found in the Altera library under the labels “7474”, “input”, and “output”. The 7474 D flip-flop (see fig. 1) requires two true-low inputs for Preset and Clear, both of which must be high in order for the counter to function. This is accomplished by using two of the three input pins for Preset and Clear. The final input pin was used for a clock signal with a period to be later determined. The basic design of the counter consisted of a connection between the QN output and D input of the same flip-flop, and another connection to the following flip-flop’s CLK input. Since each Preset and Clear input requires the same value, the Preset and Clear pins were connected in a parallel fashion. The Q output of the first flip-flop is representative of the counter’s binary sum output at the least significant bit, repeated until the most significant bit has been reached (see fig. 2). Using the MAXPlus+ II compiler, the complete circuit schematic was prepared for simulation. After opening a new Vector Waveform file, the node finder tool was used to add all input and output nodes of the circuit to the waveform simulator. As discussed previously, the counter will only function when the Preset and
Figure 1 - 7474
Figure 2 – 4 bit binary-up D flip-flop counter
and the T1 cursor was used to mark the point in time where the clock signal intersected this value. The V1 and V2 cursors were then moved to the minimum and maximum values of Q 0 (as described previously for clock) and the 50% threshold of Q 0 was calculated. The V1 cursor was then moved to this threshold value, and the T2 cursor was used to mark the point in time where the Q 0 signal intersected this value. The time difference between T1 and T2 (∆t on the oscilloscope display) represents the delay measurement from the clock’s rising edge to the change of this counter bit. To obtain the delay measurements for the remainder of the count bits, each 50% threshold was calculated following the same procedure as Q 0 , and the time from the clock’s 50% threshold to Qx’s 50% threshold represented the delay of that bit (see fig. 9 in Results).
Results Figure 6 shows the resulting waveform generated from the simulated D flip-flop counter. Clear and Preset are forced to 1, and Clock is set to a period of 20.0ns. The sum output bits are shown below, with resulting waveforms in a counting sequence.
Figure 6
Table 1 shows data measured from the simulator for each transition of the sum bits and their corresponding delay times from each rising edge of the clock. As mentioned previously, the Preset and Clear inputs must be initialized to high voltage in order for the NAND gates of the D flip-flops to give correct values. Using the waveform editor, it is possible to force all initial values to zero using the 0 waveform button in the left toolbar. This table shows that there is in fact a trend. The order of changing flip-flops is a sequence and each value of this sequence has its own corresponding Delay value.
Table 1
Transition # Flip-Flops Changing Delay Time 0000>>0001 1 6.424ns 0001>>0010 2 7.638ns 0010>>0011 1 6.424ns 0011>>0100 3 9.159ns 0100>>0101 1 6.424ns 0101>>0110 2 7.638ns 0110>>0111 1 6.424ns 0111>>1000 4 10.348ns 1000>>1001 1 6.424ns 1001>>1010 2 7.638ns 1010>>1011 1 6.424ns 1011>>1100 3 9.159ns 1100>>1101 1 6.424ns 1101>>1110 2 7.638ns 1110>>1111 1 6.424ns 1111>>0000 4 10.348ns
Figure 7 (above left) shows the actual circuit on a protoboard which represents the D flip- flop counter. The 555 timer chip (top left) creates the clock signal, two 7474 D flip-flop packages (directly below) and the active-high Set and Reset (Preset and Clear) switches (labeled S, R to the right) are shown. Figure 8 (above right) shows the oscilloscope output of (in order from bottom to top of the display) the clock signal, (lsb) sum bit 0, sum bit 1, sum bit 2, (msb) sum bit 3. Note the count sequence, similar to that of Figure 6.
Table 2 shows the measured ∆t values for the delay of each sum bit as measured on the oscilloscope.
Figure 9 shows the actual ∆t value being calculated for sum bit Q 0 as measured on the oscilloscope.
Sum Bit ∆t Q 0 28.00ns Q 1 32.00ns Q 2 48.00ns Q 3 60.00ns Table 2
Figure 7 Figure 8
Figure 9