Sequential Logic Design Practices: 5.1 Sequential Circuit Documentation Standards
Sequential Logic Design Practices: 5.1 Sequential Circuit Documentation Standards
• Cascaded elements. In a similar way, registers, counters and shift registers that
use multiple IC’s should have the multiple IC’s grouped together in the schematic so that
the cascading structure is obvious.
Several different types of discrete latches and flip-flops are available as SSI parts.
These devices are most commonly used in the design of state machines and
“unstructured” sequential circuits that don’t fall into the category of shift registers,
counters and other sequential MSI functions. However, SSI latches and flip-flops are
eliminated to a large extent in modern designs as their functions are embedded in larger,
1
structured logic devices such as PLDs. Nevertheless some of them are still used in most
digital systems.
Some of the most common SSI parts are 74x74 which contains two independent
positive-edge-triggered D flip-flops with preset and clear inputs. Faster version of this
part namely 74F74 and 74ACT74, find application in synchronizers for asynchronous
input signals.
2
(1)
/OE
(11)
CLK
(3)
1D D
(2)
1Q
CLK
(4)
2D D
(5)
CLK 2Q
(7)
3D D
(6)
CLK 3Q
(8)
4D D
(9)
CLK 4Q
(13)
5D D
(12)
CLK 5Q
(14)
6D D
(15)
CLK 6Q
(17)
7D D
(16)
CLK 7Q
(18)
8D D
(19)
CLK 8Q
Figure 5.1 Logic diagram for 74x374 8-bit register with its pin numbers.
3
74x374
(11)
CLK
(1) OE (2)
(3) 1D 1Q
(4) (5)
2D 2Q
(7) (6)
3D 3Q
(8) (9)
4D 4Q
(13) (12)
5D 5Q
(14) (15)
6D 6Q
(17) (16)
7D 7Q
(18) (19)
8D 8Q
74x373
(11)
C
(1)
OE (2)
(3) 1D 1Q
(4) (5)
2D 2Q
(7) (6)
3D 3Q
(8) (9)
4D 4Q
(13) (12)
5D 5Q
(14) (15)
6D 6Q
(17) (16)
7D 7Q
(18) (19)
8D 8Q
One variation of 74x374 is the 74x373. The ‘373 uses D latches instead of edge-triggered
flip-flops. Therefore its outputs follow the corresponding inputs whenever C is asserted,
and latch the last input when C is negated.
4
5.3.1 Counters
The name counter is used for any clocked sequential circuit whose state diagram
contains a single cycle, as shown in fig 5.4. The modulus of a counter is the number of
states in the cycle. A counter with m states is also called a modulo-m counter or
sometimes, a divide-by-m counter. A counter whose modulus is not a power of 2 will, of
necessity contains extra states that are not used in normal operation.
The most commonly used counter type is n-bit binary counter. Such a counter has
n flip-flops and has 2n states, which are visited in the sequence 0, 1, and 2…. 2n-1, 0, 1.
Each of the foregoing states is encoded in the corresponding n-bit binary integer.
S1 S2
S3
Sm
S5 S4
An n-bit binary ripple counter is constructed using a set of T flip-flops. Each bit
of this counter toggle if and only if the immediately preceding bit changes from 1 to 0.
This corresponds to a normal binary counting sequence-when particular bit changes from
1 to 0; it generates a carry to the most significant bit. The counter is called a ripple
counter as the carry information from the less significant bit ripples from the less
significant bits to the more significant bits one at a time. This is shown in figure 5.5.
5
5.3.3 Synchronous counters
Synchronous counter Fig 5.6 connects all of its flip-flop clock inputs to the same
common clock CLK signal, so that all of the flip-flop output change at the same time
after only tpTQ ns of delay where tpTQ is the propagation delay of each toggle flip-flop.
Like the binary ripple counter, a synchronous n-bit binary counter can be built with a
fixed amount of logic per bit-in this case, a T flip-flop with enable and a 2-input AND
gate.
Q Q0
CLK T
Q
Q Q1
T
Q
Q Q2
T
Q
Q Q3
T
Q
This is also called synchronous serial counter because the combinational enable
signals propagate serially from the least significant bit to the most significant bits. If the
clock period is too short, there may not be enough change for a change in the counter’s
LSB to propagate to MSB. Driving each enable input with a dedicated AND gate, just a
single level of logic eliminates this problem. Called a synchronous parallel counter, this
is the fastest binary counter structure.
6
CNTEN EN Q Q0
CLK T
Q Q1
T
Q Q2
T
Q Q3
T
7
Figure 5.6 A synchronous 4-bit binary counter with serial enable logic
CNTEN
EN Q Q0
CLK
T
Q Q1
EN
T
Q Q2
EN
T
Q Q3
EN
T
Figure 5.7 A synchronous 4-bit binary counter with parallel enable logic
The most popular counter is the 74x163, a synchronous 4-bit binary counter with
load and clear inputs. The ‘163 use D flip-flops rather than T flip-flops internally to
facilitate the load and clear functions. Each D input is driven by 2-input multiplexer
consisting of an OR gate and two AND gates.
A shift register is an n-bit register with a provision for shifting its stored data by
one bit position at each tick of the clock. Figure 5.8 shows the structure of serial-in,
serial-out shift register. The serial input. SERIN, specifies a new bit to be shifted into one
end at each clock tick. This bit appears at the serial output, SEROUT, after n clock ticks,
and is lost one tick later. Thus an n-bit serial-in serial-out shift register can be used to
delay a signal by n clock ticks.
A serial-in parallel-out register is shown in figure 5.9, has outputs for all its stored
bits, making them available to other circuits. Such a shift register can be used to perform
serial-to-parallel conversion.
8
5.3.6 MSI Shift registers
The two most popular MSI 8-bit shift registers are 74x164 a serial-in parallel out
device with an asynchronous clear input and 74x166 a parallel-in, serial-out shift register
with a asynchronous clear input. The registers described so far are unidirectional shift
registers because they can shift its contents in only one direction. 74x194 is a bi-
directional shift register. It is capable of shifting
SERIN D
CLOCK CK
D Q
CK
D Q SEROUT
CK
SERIN D Q 1Q
CLOCK CK
D Q 2Q
CK
D Q NQ
CK
data in both directions. 74x299 is a universal shift register because it can be made to
function unidirectional register or bi-directional register. The most common application
of shift registers is to convert parallel data into serial format for transmission or storage,
and to convert serial data back to parallel format for processing or display.
9
A shift register can be combined with combinational logic to form a state machine
whose state diagram is cyclic. Such a circuit is called a shift-register counter. Unlike a
binary counter a shift-register counter does not count in an ascending or descending
sequence binary sequence, but is useful in many “control” applications. Some of the shift
register counters are ring counters, Johnson counters, Linear Feedback Shift register
counters.
In other words clock skew subtracts from the hold time margin. The example given here
can happen in several ways. In a large system a single clock may not have adequate
fanout to drive all the devices with clock inputs, so it maybe necessary to provide two or
more copies of the clock signal. One method of doing this is by buffering the clock as
shown in figure 5.10 and fig5.11.
CLOCK CLOCK
CLOCK1
CLOCK2
Figure 5.10 Buffering the clock thereby introducing excessive clock skew
10
all in same IC package
/CLOCK CLOCK1
CLOCK2
CLOCK3
The buffering method of figure 5.10 produces excessive clock skew since
CLOCK1 and CLOCK2 are delayed through an extra buffer compared to CLOCK. A
recommended buffering method is shown in figure 5.11. The entire clock signals in this
case through identical buffers and has roughly equal delays. Ideally all the buffers should
be part of the same IC package. so that they all have similar delay characteristics and are
operating at identical power supply voltage and temperature.
Even the method in Figure 5.11 produce excessive clock skew if one clock signal
is loaded more heavily then the other; transitions on the more heavily loaded clock appear
to occur later because of increases in output transistor switching delay and signal rise and
fall times. Therefore it becomes necessary for a designer to balance the loads on multiple
clocks, looking at both DC load (fanout) and AC load (wiring and input capacitance).
Another bad situation can occur when signals on a PCB or in an ASIC are routed
automatically by a CAD program. Under this condition clock skew is introduced due to
improper layout of clock signals by the CAD program. This clock skew problem may be
detected using CAD timing analysis program. Then the problem can be remedied by
inserting extra delay in the too-fast data paths.
A risky design method used to enable or disable the clock signal is called gating a
clock. This is shown in Fig 5.12. A signal CLKEN is asserted to enable the clock, and is
simply ANDed with the clock to produce the gated clock GCLK. This approach has two
problems:
CLOCK GCLK
CLKEN
11
HIGH. This produces glitch on GCLK, and false clocking at the registers controlled by
GCLK.
A method of gating the clock that generates, only minimal clock skew is shown in
Figure 5.13. Here, both an ungated clock and several gated clocks are generated from the
same active-low master clock signal. Gates in the same IC package are used to minimize
the possible differences in their delays. The CLKEN signal may change arbitrarily
whenever /CLOCK is LOW, which is when CLOCK is HIGH. This condition is okay as
CLKEN signal is typically produced by a state machine whose outputs change right after
CLOCK goes HIGH.
/CLOCK CLOCK
CLKEN1 GCLK1
CLKEN2 GCLK2
CLKEN3 GCLK3
12