Unit 3
Unit 3
Unit 3
Karteek
I Output of combinational circuits depends only and immediately on their inputs, they
have no memory.
I Sequential circuits, however, act as storage elements and have memory.
I The outputs in a sequential circuit are a function not only of the inputs, but also of the
present state of the storage elements.
I The next state of the storage elements is also a function of external inputs and the
present state.
I A sequential circuit is specified by a time sequence of inputs, outputs, and internal states.
Karteek
I A synchronous sequential circuit is a system whose behaviour can be defined from the
knowledge of its signals at discrete instants of time.
I The behaviour of an asynchronous sequential circuit depends upon the input signals at
any instant of time and the order in which the inputs change.
I The storage elements commonly used in asynchronous sequential circuits are time-delay
devices.
I Synchronous sequential circuits are highly stable, whereas, asynchronous sequential
circuits may become unstable due to feedback and delay.
I Synchronization is achieved by a timing device called a clock generator.
I The clock pulses determine when computational activity will occur within the circuit, and
other signals determine what changes will take place.
I The storage elements (memory) used in clocked sequential circuits are called flip-flops.
I A flip-flop is a binary storage device capable of storing one bit of information.
I The value stored in the flip-flop is updated at the transition of clock pulses and depends
on the input.
Karteek
Fig. 2: Block diagram of sequential circuit.
I Prior to the occurrence of the clock pulse, the combinational logic forming the next value
of the flip-flop must have reached a stable value.
I The speed at which the combinational logic circuits operate is critical.
I The combinational logic must respond to a change in the state of the flip-flop in time to
be updated before the next pulse arrives.
I Propagation delays play an important role in determining the minimum interval between
Karteek
clock pulses.
I A latch is a type of bistable logic device or multivibrator.
I An active-HIGH input S-R (SET-RESET) latch is formed with two cross-coupled NOR
gates.
I An active-LOW input S-R latch is formed with two cross-coupled NAND gates.
I An invalid condition in the operation of an active-HIGH input S-R latch occurs when
HIGHs are applied to both S and R at the same time.
I An invalid condition in the operation of an active-LOW input S-R latch occurs when
LOWs are applied to both S and R at the same time.
I In normal operation, the outputs of a latch are always complements of each other.
I In comparing the NAND with the NOR latch as shown in Figs. 3 and 4, note that the
input signals for the NAND require the complement of those values used for the NOR
latch.
I NAND gate latch is sometimes referred to as an S̄-R̄ latch.
I The action of resetting a latch or a flip-flop is also called clearing, and both terms are
used interchangeably in the digital field.
Karteek
Fig. 3: NOR gate SET-RESET (S-R) latches.
I One way to eliminate the undesirable condition of the indeterminate state in the SR latch
is to ensure that inputs S and R are never equal to 1 at the same time.
Karteek
I This is done in the D latch, as shown in Fig. 5 which is gated.
I As long as the enable input is at 0, the cross-coupled SR latch has both inputs at the 1
level and the circuit cannot change state.
I When En = 1 and D = 1, the Q output goes to 1, placing the circuit in the set state.
I When En = 1 and D = 0, output Q goes to 0, placing the circuit in the reset state.
I It holds data in its internal storage and is suited for use as a temporary storage for binary
information.
Fig. 6: D latch.
Karteek
Fig. 7: Symbols for latches.
I A contact debouncing circuit shown in Fig. 8 has two inputs via VCC through pull-up
resistors and a ground connection from the mechanical switch.
I The input has two combinations 10 or 01 at the input terminals.
I From the truth table of Fig. 4, it can be easily understood that the circuit operates as
switch and eliminates the intermediate “bouncing.”
Karteek
I Flip-flops are synchronous bistable devices, also known as bistable multivibrators.
I Synchronous means that the output changes state only at a specified point (leading or
trailing edge) on the triggering input called the clock (CLK).
I Flip-flops are edge-triggered or edge-sensitive whereas gated latches are level-sensitive.
I An edge-triggered flip-flop changes state and is sensitive to its inputs only either at the
positive edge (rising edge) or at the negative edge (falling edge) of the clock pulse.
I The graphical representation of both rising and falling edge trigger for two types of
flip-flops is shown in Fig. 9
I Clocked S-R flip-flop with its responses for both positive and negative edge triggers are
shown in Figs. 10 to 12.
I Implementation of edge detectors is shown in Fig. 13.
Karteek
Fig. 9: Edge-triggered flip-flop logic symbols (top: positive edge-triggered; bottom: negative
edge-triggered).
Karteek
(a) S-R flip-flop and function table (b) Typical waveforms.
Karteek
Fig. 11: Clocked S-R flip-flop that triggers only on negative-going transitions.
Fig. 12: Simplified version of the internal circuitry for an edge-triggered S-R flip-flop.
Karteek
Fig. 13: Implementation of edge-detector circuits used in edge-triggered flip-flops: (a) Positive; (b)
Negative. The duration of the CLK∗ pulses is typically 2-5 ns.
Karteek
I J-K flip-flop is similar to the S-R flip-flop, except that J = K = 1 condition does not
result in an ambiguous output.
I When J and K are both 1, the FF will always go to its opposite state upon the positive
transition of the clock signal, called as toggle mode of operation.
Karteek
I A D flip-flop can be implemented using J-K flip-flop and an inverter gate as shown in
Fig. 16.
Karteek
I A J-K flip-flop has three operations: set, reset, compliment.
D = JQ0 + K 0 Q
I When J = 1 and K = 0, D = Q0 + Q = 1, so the next clock edge sets the output to 1.
I When J = 0 and K = 1, D = 0, so the next clock edge resets the output to 0.
I When both J = K = 1 and D = Q0 , the next clock edge complements the output.
I When both J = K = 0 and D = Q, the clock edge leaves the output unchanged.
I For a D flip-flop
Q(t + 1) = D
I For a T flip-flop
Q(t + 1) = T ⊕ Q = T Q0 + T 0 Q
Karteek
Fig. 20: Characteristic table.
I For a JK flip-flop
Q(t + 1) = JQ0 + K 0 Q
I Some flip-flops have asynchronous inputs that are used to force the flip-flop to a
particular state independently of the clock.
I The input that sets the flip-flop to 1 is called preset or direct set.
I The input that clears the flip-flop to 0 is called clear or direct reset.
Karteek
Fig. 21: D flip-flop using 3 SR flip-flops with asynchronous reset.
Karteek
I A logic symbol for a D flip-flop with preset and clear inputs is shown in Fig. 22.
I These inputs are active-LOW, as indicated by the bubbles.
I These preset and clear inputs must both be kept HIGH for synchronous operation.
I In normal operation, preset and clear would not be LOW at the same time.
Karteek Fig. 26: J-K flip-flops used to generate a binary count sequence.
I A register is a digital circuit with two basic functions: data storage and data movement.
I A D flip-flop is generally used to store single bit information.
I Various classifications of registers:
1. Parallel in/parallel out (PIPO)
2. Serial in/serial out (SISO)
3. Parallel in/serial out (PISO)
4. Serial in/parallel out (SIPO)
I Serial data flow through a register is generally called shifting, and the data may be shifted
either to the left or to the right.
I If the serial output data is fed back into the serial input of the same register, the
operation is called a data rotate.
I Parallel inputting of data is often described as a register load.
I A PIPO can be implemented using 74ALS174/74HC174 IC as shown in Fig. 29.
I The same IC can also be used for SISO operation as shown in Fig. 30.
Karteek
Karteek
Fig. 27: Data transfer circuits: (a) PIPO; (b) SISO; (c) PISO; (d) SIPO.
Fig. 28: Basic data movement in shift registers.
Karteek
Fig. 29: Parallel in parallel out using 74ALS174.
Karteek
I A serial in/serial out shift register will have data loaded into it one bit at a time.
I The data will move one bit at a time with each clock pulse through the set of flip-flops
toward the other end of the register.
I The logic diagram and schematic symbol for the 74HC166 is shown in Fig. 31 and an
example timing diagram is shown in Fig. 32
I A serial in/serial out shift register can be used to provide a time delay td from input to
output that is a function of both the number of stages (n) in the register and the clock
Karteek
frequency f , td = n/f .
I A cascade of JK FFs are used to implement asynchronous (ripple) counters.
I J = K = 1 is applied to all the FFs, output Q of one stage is applied as clock to the next
stage.
I For the circuit in Fig. 38, binary counting sequence from 0000 to 1111 is followed as clock
pulses are continuously applied.
Karteek
I Problems such as this can be avoided if the period between input pulses is made longer
than the total propagation delay of the counter.
I For proper counter operation with N FFs,
Tclock ≥ N × tpd
1
fmax =
N × tpd
I As the number of FFs in the counter increases, the total propagation delay increases and
fmax decreases.
I Asynchronous counters are not useful at very high frequencies, especially for counters
with large numbers of bits.
I Another issue is erroneous count patterns that can generate glitches.
Karteek
I For example, in Fig. 39, right after state 011, state 010 occurs before 100 for a small
duration of 50 ns.
I Digital circuits will be fast enough to detect it.
I Suppose that a four-bit ripple counter is constructed using the 74LS112 JK flip-flop that
has tP LH = 16 ns and tP HL = 24 ns as the propagation delays from CLK to Q.
I To calculate fmax , assume the “worst case”, tpd = tP HL = 24 ns, so that
1
fmax = = 10.4 MHz
4 × 24 × 10−9
I If there are 6 FFs,
1
fmax = = 6.9 MHz
6 × 24 × 10−9
I Asynchronous counters are not useful at very high frequencies, especially for counters
with large numbers of bits.
Karteek
I A synchronous counter is one in which all the flip-flops in the counter are clocked at the
same time by a common clock pulse.
I J-K flip-flops are used to illustrate most synchronous counters.
I D flip-flops can also be used but generally require more logic because of having no direct
toggle or no-change states.
I Fig. 40 shows a 2-bit synchronous binary counter.
Karteek
(a) (b)
J0 = K0 = 1
I FF1 (Q1 ) changes on the next clock pulse each time Q0 = 1 and Q3 = 0.
J1 = K1 = Q0 Q3
I FF2 (Q2 ) changes on the next clock pulse each time both Q0 = 1 and Q1 = 1.
J2 = K2 = Q0 Q1
I Finally, FF3 (Q3 ) changes to the opposite state on the next clock pulse each time Q0 = 1,
Q1 = 1, and Q2 = 1 (state 7), or when Q0 = 1 and Q3 = 1 (state 9).
J3 = K3 = Q0 Q1 Q2 + Q0 Q3
J0 = K0 = 1
J1 = K1 = Q0 · UP + Q0 · DOWN
J2 = K2 = Q1 · Q0 · UP + Q1 · Q0 · DOWN
Karteek
Fig. 52: Up/Down 3-bit binary counter.
Karteek
Fig. 53: Up/Down 3-bit binary sequence.
Karteek
I A state machine is a sequential circuit having a limited number of states occurring in a
prescribed order.
I A counter is an example of a state machine; the number of states is called the modulus.
I Two basic types of state machines are the Moore and the Mealy.
I In Moore state machine, the outputs depend only on the internal present state.
I In Mealy state machine, the outputs depend on both the internal present state and inputs.
I Both types have a timing input (clock) that is not considered a controlling input.
I A simple counter of MOD X is an example of Moore state machine.
I If the value of X is selected based on the input, it becomes Mealy state machine.
I For example, assume that the tablet-bottling system uses three different sizes of bottles: a
25-tablet bottle, a 50-tablet bottle, and a 100-tablet bottle.
I This operation requires a state machine with three terminal counts: 25, 50, and 100.
I The combinational logic sets the modulus of the counter depending on the modulus-select
inputs as shown in Fig. 55.
I The output of the counter depends on both the present state and the modulus-select
inputs.
Karteek
Fig. 54: Two types of sequential logic.
Karteek
Fig. 58: Karnaugh maps for present-state J and K inputs.
Karteek
I The next step is to obtain the logic expressions from the Karnaugh maps:
J0 = Q2 Q1 + Q2 Q1 = Q2 ⊕ Q1
K0 = Q2 Q1 + Q2 Q1 = Q2 ⊕ Q1
J1 = Q2 Q0
K1 = Q2 Q0
J2 = Q1 Q0
K2 = Q1 Q0
I The final step is to implement:
Karteek