CH 12
CH 12
1
Learning Objectives
Explain the operation of registers. Show how to transfer data
between registers using a tri-state bus.
Explain the operation of shift registers, show how to build them
using flip-flops, and analyze their operation. Construct a timing
diagram for a shift register.
Explain the operation of binary counters, show how to build them
using flip-flops and gates, and analyze their operation.
2
Learning Objectives
Given the present state and desired next state of a flip-flop,
determine the required flip-flop inputs.
Given the desired counting sequence for a counter, derive the
flip-flop input equations.
Explain the procedures used for deriving flip-flop input equations.
3
Registers and Counters
4
Registers and Counters
Several D flip-flops may be grouped together with a common clock to
form a register.
Next slide shows a register that can store four bits of information.
Load signal is ANDed with a clock signal.
When Load = 0, register is not clocked and it holds its present value.
To load data into the register, Load is set to 1 for one clock period, and
data is applied to D inputs so it can be loaded on the falling edge of
the clock.
Register has asynchronous clear inputs (ClrN)
Alternatively, the flip-flops may have a clock enable (CE) input. We
can apply the load signal to (CE).
5
Registers and Register Transfers
4-Bit D Flip-Flop Registers with Data, Load, Clear, and Clock Inputs.
When Load = 1, the Clk is transmitted to the flip-flop clock inputs and the data
applied to the D inputs will be loaded into the flip-flops on the falling edge of the
clock. 6
Registers and Register Transfers
4-Bit D Flip-Flop Registers with Data, Load, Clear, and Clock Inputs.
When Load = 0, the clock is disabled, and the register holds its data. When Load
is 1, the clock is enabled, and the data applied to the D inputs will be loaded into
the FF, following the falling edge of the clock. 7
Data Transfer Between Registers
If En=1 and Load=1, the
output of register A is
enabled onto the tri-state
bus and the data in
register A will be stored in
Q after the rising edge of
the clock.
10
Parallel Adder With Accumulator
12
Full adder cell with an associated accumulator flip-
flop and Load capability of an operand
Cell i has inputs ci , xi and yi and outputs si and ci+1.
Accumulator flip-flop can either be loaded from yi or from the
sum si of the adder output.
When Ld = 1 and Ad = 0, the multiplexer selects yi to be loaded
in the accumulator flip-flop Q on the rising edge.
When Ad = 1 and Ld = 0, the adder output (si) is loaded into Q.
The Ad and Ld are ORed to enable clock.
When Ad = Ld = 0, the clock is disabled.
Ad and Ld cannot be 1 at the same time.
13
Shift Registers
A shift register is a register in which binary data can be stored, and this
data can be shifted to the left or right when a shift signal is applied.
Bits shifted out at one end of the register may be lost, or if the shift
register is of cyclic type, bits shifted out at one end are shifted back in
at the other end.
When Shift = 1, clock is enabled and shifting occurs on rising edge.
When Shift = 0, no shifting occurs and data in the register is
unchanged.
Serial input (SI) is loaded into flip-flop Q3 at the rising edge of clock.
If the register initially contains 0101 and serial input sequence is
1,1,0,1. Sequence of states will be 0101, 1010, 1101, 0110, 1011.
If we connect serial output to serial input, and initially the register
holds 0111, Sequence of states will be 1011, 1101, 1110, 0111. 14
Right – Shift Registers
15
8-Bit Serial-In, Serial-Out Shift Register
Serial in means that data is shifted into the first FF one bit at a time, and the FFs cannot
be loaded in parallel.
Serial out means that data can only be read out of the last FF and the outputs from the
other FFs are not connected to terminals of the integrated circuit. 16
Typical Timing Diagram for Shift Register
17
4-bit Parallel-in, Parallel-out Right Shift Register
Parallel-in means that all 4-bits can be loaded at the same time.
Parallel-out means that all 4-bits can be read out at the same
time.
Shift register has two control inputs: shift enable (Sh) and load
enable (L).
If Sh = 1 (and L=0 or L=1), clocking the register causes Serial input
(SI) to be shifted into the first flip-flop.
If Sh = 0 and L = 1, load 4 data inputs in parallel.
If Sh = L = 0, clocking register causes no change in Q.
18
4-bit Parallel-in, Parallel-out Right Shift Register
19
4-bit Parallel-in, Parallel-out Right Shift Register
20
4-bit Parallel-in, Parallel-out Right Shift Register
The next-state equations for the flip-flops are as follows:
21
4-bit Parallel-in, Parallel-out Right Shift Register
Timing Diagram for Shift Register
22
Shift Register with Inverted Feedback
twisted ring counter or Johnson counter
23
Design of Binary Counters
24
Binary Counters Using 3 T Flip-Flops
We will first construct a binary counter using three T flip-flops to
count clock pulses.
TA = 1, TB = A, TC = AB 25
Binary Counters Using 3 T Flip-Flops
26
Binary Counters Using 3 T Flip-Flops
TA = 1
TB = A
TC = AB
27
Binary Counters Using 3 D Flip-Flops
28
Binary Counters Using 3 D Flip-Flops
The D input equations derived from the maps are
DA = A+ = A′
DB = B+ = BA′ + B′A = B ⊕ A
DC = C+ = C′BA + CB′ + CA′ = C′BA + C(BA)′ = C ⊕ BA
29
Binary Counters Using 3 D Flip-Flops
DA = A′
DB = B ⊕ A
DC = C ⊕ BA
30
Design of 3-bit Up/Down Binary Counter
31
Design of 3-bit Up/Down Binary Counter
32
Design of 3-bit Up/Down Binary Counter
33
Design of 3-bit Up/Down Binary Counter
34
Design of 3-bit Up/Down Binary Counter
35
Design of 3-bit Up/Down Binary Counter
When X = 0, the equations are reduced to the equations of a
binary up counter:
36
Design of 3-bit Up/Down Binary Counter
When X = 1, the equations are reduced to the equations of a
binary down counter:
37
Design of 3-bit Up/Down Binary Counter
DA = A+ = A’
DB = B+ = X ⊕ A ⊕ B
DC = C+ = C’(X’BA + XB’A’)
+ C((X ⊕ A)’ + (X ⊕ B)’)
38
Loadable Counter with Count Enable
39
Loadable Counter with Count Enable
40
Counters for Other Sequences
We will design a counter for the transition table shown in Table 12-3
using T Flip-Flops
41
Counters for Other Sequences
42
Counters for Other Sequences
43
Procedure for Counter Design Using S-R Flip-Flops
Instead of deriving an input equation for each D or T flip-flop,
the S and R input equations must be derived.
44
Procedure for Counter Design Using S-R Flip-Flops
45
Procedure for Counter Design Using S-R Flip-Flops
46
Procedure for Counter Design Using S-R Flip-Flops
47
Procedure for Counter Design Using S-R Flip-Flops
48
Counter Design Using J-K Flip-Flops
49
Counter Design Using J-K Flip-Flops
J-K Flip-Flop Table
50
Counter Design Using J-K Flip-Flops
51
Counter Design Using J-K Flip-Flops
Logic Circuit
52
Design of 2-bit Binary Counters Using JK Flip-Flops
state diagram
53
Design of 2-bit Binary Counters Using JK Flip-Flops
54
Design of 2-bit Binary Counters Using JK Flip-Flops
0 0 0 X 0 X 0 X 1 X
0 1 0 X X 0 1 X X 1
1 0 X 0 0 X X 0 1 X
1 1 X 0 X 0 X 1 X 1
Excitation Table
55
Design of 2-bit Binary Counters Using JK Flip-Flops
56
Circuit of 2-bit Binary Counters Using JK Flip-Flops
57