Beruflich Dokumente
Kultur Dokumente
9)
E3004 / UNIT10 / 1
````````````````````````
UNIT 10
OBJECTIVE
General Objective
Specific Objective
Generate Timing Diagram for digital input and digital output signals.
E3004 / UNIT10 / 2
INPUT
10.0
Sequential logic circuits are circuits that make use of logic gates and logic
devices and have one very important characteristic which is the control
element.
Control element is also known as control input. The output of the circuit can
be set and controlled by making the control element active or triggered.
The sequential circuit uses both digital signals and digital stimulus as the input
sources.
The simulation setup and analysis for sequential circuit is the same as for
combinational circuit with one extra setting of in the Digital Setup. The
timing diagram for both input and output are generated by Probe using the
same method also.
10.1
E3004 / UNIT10 / 3
By double clicking on the flip-flop graphic, the user can change the
Package Reference Designator and the Gate. The pin number on the
schematic will change automatically.
In figure 10.1, the flip-flops and the AND gates have been renamed to
make the pin numbers correspond with the gates actually used in the
circuit construction. Pspice will not allow floating input but floating
outputs are acceptable and generate signals that can be graphed by Probe.
Figure 10.1
For a counter circuit the stimulus generator is not used as a data input
device but rather as a clock used to signal the counter to advance the
count.
DSTIM1 is a clock generator that generates digital signal with 1us set per
clock cycle. This would generate a sequence of 0s and 1s for infinity.
This allows the counter to complete its 0 to 9 count and start again
counting up to 5. The loop in the stimulus could have been repeated 30
times, 100 times, or repeated forever using 1 as the number of
repetitions.
E3004 / UNIT10 / 4
The transient analysis has been set to 16us, any number over 16 cycles
would do.
The second stimulus, HI, is a stimulus that is set high and left there. Its
purpose is to provide +5 Volts to the presets, the clears, and the J and K
input for the first flip-flop.
When flip-flops are used in a circuit, the Digital Setup within the Analysis
Setup must be set.
Clicking the Digital Setup box opens a window that allows the setting of
the initial conditions for the output of the flip-flops. For this circuit, all
flip-flops should be set to 0 (low), at time zero.
Figure 10.2 shows the traces of the up-counting circuit. Trace a is the
clock signal and traces b, c, d and e show bit levels starting with the least
significant bit. The plot makes it clear that the counter properly counts to
nine and restarts at zero without the counting glitches associated with
asynchronous counters.
Figure 10.2
Figure 10.3 shows the logic level at the inverting outputs are also
available. They indicate that this counter also counts down from 15 to 6,
and then restarts at 15.
E3004 / UNIT10 / 5
Figure 10.3
10.1.2 REGISTER AS A RING COUNTER
A ring counter circuit as in figure 10.4 is a counter that does not count
numbers, instead it counts events. The number of events it counts depends
on the number of flip-flops used in the circuit. This means that 4 flip-flops
used would count 4 events and 5 flip-flops would count 5 events. The fig
10.4 is a 4-bit ring counter which would count 4 events.
The outputs of the counter labeled as Qa, Qb, Qc and Qd would produce 4
binary combinations 1000, 0100, 0010 and 0001. Each combination is a
representative of an event. The events are usually used to drive or act as
inputs to other circuits.
Fig 10.4
E3004 / UNIT10 / 6
Firstly, at the start of the simulation, the ring counter is set at logic 1 at the
output of the first flip-flop. All other flip-flops are set at logic 0. This is
done by wiring DSTIM2 to the clear and preset inputs of the flip-flops and
its attributes set as below.
Secondly, a feedback from the output of the last flip-flop to the input of
the first flip-flop has to be established to ensure the data of the last flipflop is circulated back to the first flip-flop thus producing repeatedly the
four combinations.
Each time the clock triggers, the bit 1 initially in the first flip-flop would
be shifted to the next flip-flop. Upon arriving at the last flip-flop, the bit 1
is then circulated back to the first flip-flop. In this case the clock is set for
1 kHz as shown below.
E3004 / UNIT10 / 7
After simulation, Probe is used to plot the traces for the outputs: Qa, Qb,
Qc and Qd along with clock signal. This is done by highlighting the trace
names.
The output displayed by Probe as in Figure 10.5 should agree with the
truth table of the ring counter. It is verified that initially the output
produced is 1000. After the clock triggers the first time, the output now is
0100. The second time the clock triggers the output is 0010. The third
clock triggers and the counter produce 0001. As the clock triggers again,
the output repeat the initial condition which is 1000.
Figure 10.5
E3004 / UNIT10 / 8
ACTIVITY 10a
Design and simulate a 5-bit ring counter as shown below. The counter should
be initialized at the start of the simulation.
E3004 / UNIT10 / 9
E3004 / UNIT10 / 10
d
FEEDBACK 10a
Answers :
1b. Set up clock to 1 kHz.
2b -2d. Please work it out and refer to your lecturer for the answer.
E3004 / UNIT10 / 11
INPUT
10.4
The devices used in the examples only have D-type flip-flops. Thus, the
other flip-flops will be emulated using D-type flip-flops.
E3004 / UNIT10 / 12
A D-type flip-flop presents the input data at the output after being clocked.
Its basic transfer function can be expressed as:
DT : = D
where pins DT (D True) and D are used as shown in Figure 10.6.
Note the use of := here instead of =. This indicates that the output is
registered for this equation. The difference is illustrated in Figure 10.7.
(PLD design syntax may vary. Refer to the appropriate language reference
manual.)
As shown in fig 10.6, preset and clear functions are added to the flip-flops.
This can be done with two input pins, called PR and CLR. To add these
functions to the true flip-flop signal, /CLR is added to every product term
and add one product term consisting only of PR. Likewise, for the
complement functions, /PR is added to every product term, and add one
product term consisting only of CLR. With these changes, the equation
now looks like:
E3004 / UNIT10 / 13
DT : = D * /CLR
+ PR
DC : = /D * /PR
+ CLR
In this way, when clearing the flip-flops, the active-HIGH flip-flops have
no product terms true, and go low; the active-LOW flip-flops have the last
product term true, and will therefore go HIGH. The reverse will occur for
the preset function.
There is still one hole in this design: what happens if preset and clear are
active at the same time? As it is now, both outputs will go HIGH. This
makes no sense since one signal is supposed to be the inverse of the other.
To rectify this, we can give the clear function priority over the preset
function. This can be done by placing /CLR on every product term for the
true flip-flop signal. The results are shown as follows:
DT : = D * /CLR
+ PR * /CLR
DC : = /D * /PR
+ CLR
The same basic procedure can be applied to all of the other flip-flops. The
equations are shown in Figure 10.8.
EQUATIONS
; emulating all flip-flops with D-type flip-flops
DT : = D * /CLR
+ PR * /CLR
DC : = /D * /PR
+ CLR
TT : = T * /TT * /CLR
+ /T * TT * /CLR
+ PR * /CLR
TC : = T * /TC * /PR
+ /T * TC * /PR
+ PR * /CLR
JKC : = J * /JKT * /CLR
+ K * /JKC * /CLR
+ CLR
SRT : = S * /CLR
+ /P * SRT * /CLR
+ PR * /CLR
SRC : = R * /PR
+ /S * SRC * /PR
+ CLR
Figure 10.8 Flip-Flop Equation Section
E3004 / UNIT10 / 14
E3004 / UNIT10 / 15
Notice that in some of the equations above, the output signal itself shows
up in the equations. This is the way in which feedback from the flip-flop
can be used to determine the next state of the flip-flop. An equivalent logic
drawing of the TT equation is shown in Figure 10.9.
After processing the design and correcting any mistakes, the simulation is
executed. The design file is to be simulated in the same manner as the
basic gates design.
E3004 / UNIT10 / 16
The first thing to do after turning the programmer on is to select the device
type. This tells the programmer what kind of programming data to expect.
The device type is usually selected either from a menu or by entering a
device code. The programmer manual will have the details.
Next, a JEDEC file must be downloaded. To transfer the JEDEC file from
the computer to your programmer, a connection is needed as shown in
Figure 10.10.
E3004 / UNIT10 / 17
Once the protocol has been set up the JEDEC file must be downloaded.
Enter the name of the JEDEC file to be used. The computer will then
announce that it is sending data, and tell when it is finished. Note that just
because it says it has finished sending data does not mean that the data
was received correctly.
Once the data has been received, the programmer is ready to program a
device. Place a device in the appropriate socket, and follow the
instructions for the programmer to program the device. This procedure
programs and verifies the connection in the device, and, if a JEDEC file
containing vectors was used, will perform a functional test.
The programmer will announce when the programming procedure has been
completed. Then take the device and plug it into an application.
Program the example created before and test it to verify that the device
perform as expected.
E3004 / UNIT10 / 18
ACTIVITY 10b
2. You are to use the asynchronous decade down counter circuit given in activity 10a,
Q2.
a) Build a design file for the logic circuit.
b) Create a JEDEC file from the design file you have created in 2(a).
c) Download the JEDEC file and program into a specific PAL device.
d) Plug the device into an application consisting of a seven segment display. Test the
device to see whether the seven segment will display all the 10 decimal digits
sequentially and in descending order.
FEEDBACK 10b
Answer :
E3004 / UNIT10 / 19
E3004 / UNIT10 / 20
SELF-ASSESSMENT
You are approaching SUCCESS! Try to answer ALL questions in this self-assessment
section and check your answers in the feedback section in the next page.
If you encounter any problem please discuss with your lecturer. Try your best and
SUCCESS is on your way! Good-Luck!!!
QUESTION 10.1
Draw and simulate a switch-tail counter given below. All flip-flops must be cleared at the
start of simulation and minimize on the number of ICs used.
a)
b)
c)
Plot the clock signal and the outputs Qa, Qb, Qc and Qd.
d)
e)
E3004 / UNIT10 / 21
FEEDBACK
1b.
1c.
E3004 / UNIT10 / 22
1d.
Everygreat
greatachievement
achievementwas
wasonce
onceconsidered
consideredimpossible
impossible
Every
Unknown
- -Unknown