MODULE-5
Registers and Counters
1
Objective
2
Introduction
3
Registers and Register Transfers
4
When Load = 0, the register is not clocked, and it holds its present value
When Load = 1, the clock signal (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.
Registers and Register Transfers
5
If the Q outputs are 0000 (Q3 = Q2 = Q1 = Q0 = 0) and the data inputs are 1101 (D3 = 1, D2 = 1, D1 = 0 and D0 = 1), after the falling edge of the clock Q will change from 0000 to 1101 as indicated.
Registers and Register Transfers
6
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 flip-flops, following the falling edge of the clock
Registers and Register Transfers
7
Registers and Register Transfers
8
Figure shows how data can be transferred from the output of one of two registers into a third register using tri-state buffers.
Registers and Register Transfers
9
Registers and Register Transfers
10
Figure (a) shows an integrated circuit register that contains eight D flip-flops with tri-state buffers at the flip-flop outputs. These buffers are enabled when En = 0.
A symbol for this 8-bit register is shown in Figure (b).
Registers and Register Transfers
11
Figure shows how data can be transferred from one of four 8-bit registers into one of two other registers.
8 bits of data are transferred in parallel from register A, B, C, or D to register G or H or both.
Registers and Register Transfers
12
Registers and Register Transfers�Parallel Adder with Accumulator
13
Registers and Register Transfers�Parallel Adder with Accumulator
14
X = xn . . . x2x1 is stored in the accumulator
Y= yn . . . y2 y1 is applied to the full adder inputs,
The sum of X and Y appears at the adder outputs
Add signal (Ad) is used to load the adder outputs into the accumulator flip-flops on the rising clock edge
Registers and Register Transfers�Parallel Adder with Accumulator
15
Registers and Register Transfers�Parallel Adder with Accumulator
16
Shift Registers
17
Shift Registers
18
Shift Registers
19
When Shift = 1, the clock is enabled and shifting occurs on the rising clock edge. When Shift = 0, no shifting and No changed in flip flop.
The serial input (SI) is loaded into the first flip-flop (Q3) by the rising edge of the clock.
At the same time, the output of the first flip-flop is loaded into the second flip-flop, the output of the second flip-flop is loaded into the third flip-flop, and the output of the third flip-flop is loaded into the last flip-flop
Shift Registers
20
Shift Registers
21
Shift Registers
22
Clk | Serial In | Q | R | S | T |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
0
0
0
1
0
1
0
A
1
0
1
0
0
B
0
0
0
1
D
0
0
0
0
0
C
0
0
1
0
Shift Registers
23
If we connect the serial output to the serial input, as shown by the dashed line, the resulting cyclic shift register performs an end-around shift.
If the initial contents of the register is 0111, after one clock cycle the contents is 1011.
After a second pulse, the state is 1101, then 1110, and the fourth pulse returns the register to the initial 0111 state.
Shift Registers
24
Shift Registers
25
Shift Registers
26
Shift Registers
27
Shift Registers
28
Shift Registers
29
Sh | L | Q3+ | Q2+ | Q1+ | Q0+ | Action |
0 | 0 | Q3 | Q2 | Q1 | Q0 | No Change |
0 | 1 | D3 | D2 | D1 | D0 | Parallel Data loaded from D3,D2,D1,D0 |
1 | 0 | SI | Q3 | Q2 | Q1 | Serial input from SI |
1 | 1 | SI | Q3 | Q2 | Q1 |
Shift Registers
30
Timing Diagram for Shift Register
Assuming that the register is initially clear (Q3Q2Q1Q0 = 0000), that the serial input is SI = 0 throughout, and that the data inputs D3D2D1D0 are 1011 during the load time (t0).
Shifting occurs at the end of t1, t2, and t3, and the serial output can be read during these clock times
Shift Registers
31
Shift Registers
32
Shift Registers
33
Clock Pulse | Q0 | Q1 | Q2 | Q3 |
0 | 1 | 0 | 0 | 0 |
1 | 0 | 1 | 0 | 0 |
2 | 0 | 0 | 1 | 0 |
3 | 0 | 0 | 0 | 1 |
4 | 1 | 0 | 0 | 0 |
5 | 0 | 1 | 0 | 0 |
6 | 0 | 0 | 1 | 0 |
7 | 0 | 0 | 0 | 1 |
Shift Registers
34
Shift Registers
35
Shift Registers
36
Design of Binary Counters
37
Design of Binary Counters
38
Design of Binary Counters
39
Design of Binary Counters
40
Design of Binary Counters
41
Design of Binary Counters
42
000
001
010
011
101
110
111
100
Design of Binary Counters
43
Design of Binary Counters
44
TC = BA
TB = A.
TA = 1
Design of Binary Counters
45
Design of Binary Counters
46
Flip Flop Input | ||
DC | DB | DA |
0 | 0 | 1 |
0 | 1 | 0 |
0 | 1 | 1 |
1 | 0 | 0 |
1 | 0 | 1 |
1 | 1 | 0 |
1 | 1 | 1 |
0 | 0 | 0 |
Design of Binary Counters
47
DC = C+ = C′BA + CB′ + CA′
= C′BA + C(BA)′
= C ⊕ BA
DB = B+ = BA′ + B′A
= B ⊕ A
DA = A+ = A′
Design of Binary Counters
48
Design of Binary Counters
49
Design of Binary Counters
50
Design of Binary Counters
51
000
111
110
101
011
010
001
100
Design of Binary Counters
52
Present State | Next State | Flip Flop Input | ||||||
C | B | A | C+ | B+ | A+ | TC | TB | TA |
0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 |
0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 |
0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 1 |
0 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 1 |
1 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 |
1 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 1 |
1 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 1 |
1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 1 |
Design of Binary Counters
53
A CB | 0 | 1 |
00 | 1 | 0 |
01 | 0 | 0 |
11 | 0 | 0 |
10 | 1 | 0 |
TC=A’B’
A CB | 0 | 1 |
00 | 1 | 0 |
01 | 1 | 0 |
11 | 1 | 0 |
10 | 1 | 0 |
TB=A’
TA=1
Design of Binary Counters
54
Design of Binary Counters
55
Design of Binary Counters
56
Design of Binary Counters
57
U/D’ | Present State | Next State | Flip Flop Input | ||||||
M | C | A | B | C+ | B+ | A+ | DC | DB | DA |
0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 |
0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 |
0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 1 |
0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 1 | 0 |
0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 1 |
0 | 1 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 |
0 | 1 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | 1 |
0 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 1 | 0 |
1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 |
1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 |
1 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 1 | 1 |
1 | 0 | 1 | 1 | 1 | 0 | 0 | 1 | 0 | 0 |
1 | 1 | 0 | 0 | 1 | 0 | 1 | 1 | 0 | 1 |
1 | 1 | 0 | 1 | 1 | 1 | 0 | 1 | 1 | 0 |
1 | 1 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | 1 |
1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 |
Design of Binary Counters
58
BA MC | 00 | 01 | 11 | 10 |
00 | 1 | 0 | 0 | 0 |
01 | 0 | 1 | 1 | 1 |
11 | 1 | 1 | 0 | 1 |
10 | 0 | 0 | 1 | 0 |
DC=C ⨁ (MAB+M’A’B’)
BA MC | 00 | 01 | 11 | 10 |
00 | 1 | 0 | 1 | 0 |
01 | 1 | 0 | 1 | 0 |
11 | 0 | 1 | 0 | 1 |
10 | 0 | 1 | 0 | 1 |
DB= B ⊕ (MA + M’A′)
BA MC | 00 | 01 | 11 | 10 |
00 | 1 | 0 | 0 | 1 |
01 | 1 | 0 | 0 | 1 |
11 | 1 | 0 | 0 | 1 |
10 | 1 | 0 | 0 | 1 |
DA= A’
Design of Binary Counters
59
Design of Binary Counters
60
Counters for Other Sequences
61
Counters for Other Sequences
62
Counters for Other Sequences
63
Present Output | Next Output | Flip Flop Inputs | ||||||
C | B | A | C+ | B+ | A+ | TC | TB | TA |
0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 |
0 | 0 | 1 | X | X | X | X | X | X |
0 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 1 |
0 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 1 |
1 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 1 |
1 | 0 | 1 | X | X | X | X | X | X |
1 | 1 | 0 | X | X | X | X | X | X |
1 | 1 | 1 | 0 | 1 | 0 | 1 | 0 | 1 |
Counters for Other Sequences
64
Counters for Other Sequences
65
Counters for Other Sequences
66
Counter Design Using S-R and J-K Flip-Flops
67
Counter Design Using S-R and J-K Flip-Flops
68
Counter Design Using S-R and J-K Flip-Flops
69
Counter Design Using S-R and J-K Flip-Flops
70
Counter Design Using S-R and J-K Flip-Flops
71
Counter Design Using S-R and J-K Flip-Flops
72
Present State | Next State | Inputs | |||||||||
Q2 | Q1 | Q0 | Q2+1 | Q1+1 | Q0+1 | J2 | K2 | J1 | K1 | J0 | K0 |
0 | 0 | 1 | 0 | 1 | 0 | 0 | X | 1 | X | X | 1 |
0 | 1 | 0 | 1 | 0 | 1 | 1 | X | X | 1 | 1 | X |
1 | 0 | 1 | 1 | 1 | 1 | X | 0 | 1 | X | X | 0 |
1 | 1 | 1 | 0 | 0 | 1 | X | 1 | X | 1 | X | 0 |
Output | Input | ||
Qn | Qn+1 | J | K |
0 | 0 | 0 | X |
0 | 1 | 1 | X |
1 | 0 | X | 1 |
1 | 1 | X | 0 |
Counter Design Using S-R and J-K Flip-Flops
73
Counter Design Using S-R and J-K Flip-Flops
74
Counter Design Using S-R and J-K Flip-Flops
75
Counter Design Using S-R and J-K Flip-Flops
76
Counter Design Using S-R and J-K Flip-Flops
77
Present State | Next State | Inputs | |||||||||
Cn | Bn | An | Cn+1 | Bn+1 | An+1 | JC | KC | JB | KB | JA | KA |
0 | 0 | 0 | 0 | 0 | 1 | 0 | X | 0 | X | 1 | X |
0 | 0 | 1 | 0 | 1 | 0 | 0 | X | 1 | X | X | 1 |
0 | 1 | 0 | 0 | 1 | 1 | 0 | X | X | 0 | 1 | X |
0 | 1 | 1 | 1 | 0 | 0 | 1 | X | X | 1 | X | 1 |
1 | 0 | 0 | 1 | 0 | 1 | X | 0 | 0 | X | 1 | X |
1 | 0 | 1 | 0 | 0 | 0 | X | 1 | 0 | X | X | 1 |
1 | 1 | 0 | 0 | 0 | 0 | X | 1 | X | 1 | 0 | X |
1 | 1 | 1 | 0 | 0 | 0 | X | 1 | X | 1 | X | 1 |
Counter Design Using S-R and J-K Flip-Flops
78
Counter Design Using S-R and J-K Flip-Flops
79
Counter Design Using S-R and J-K Flip-Flops
80
Counter Design Using S-R and J-K Flip-Flops
81
Counter Design Using SR and JK Flip Flops
82
1
2
3
4
5
6
7
8
16
15
14
13
12
11
10
9
CLK1
PRE1
CLR1
J1
VCC
CLK2
PRE2
CLR2
K1
Q1
GND
K2
Q2
J2
I
C
7
4
7
6
J1
Q1
K1
J2
Q2
K2
Counter Design Using S-R and J-K Flip-Flops
83
Counter Design Using S-R and J-K Flip-Flops
84
Present State | Next State | ||||
Cn | Bn | An | Cn+1 | Bn+1 | An+1 |
0 | 0 | 0 | 0 | 0 | 1 |
0 | 0 | 1 | 0 | 1 | 0 |
0 | 1 | 0 | 0 | 1 | 1 |
0 | 1 | 1 | 1 | 0 | 0 |
1 | 0 | 0 | 1 | 0 | 1 |
1 | 0 | 1 | 0 | 0 | 0 |
Counter Design Using S-R and J-K Flip-Flops
85
Present State | Next State | Inputs | |||||||||
Cn | Bn | An | Cn+1 | Bn+1 | An+1 | JC | KC | JB | KB | JA | KA |
0 | 0 | 0 | 0 | 0 | 1 | 0 | X | 0 | X | 1 | X |
0 | 0 | 1 | 0 | 1 | 0 | 0 | X | 1 | X | X | 1 |
0 | 1 | 0 | 0 | 1 | 1 | 0 | X | X | 0 | 1 | X |
0 | 1 | 1 | 1 | 0 | 0 | 1 | X | X | 1 | X | 1 |
1 | 0 | 0 | 1 | 0 | 1 | X | 0 | 0 | X | 1 | X |
1 | 0 | 1 | 0 | 0 | 0 | X | 1 | 0 | X | X | 1 |
Output | Input | ||
Qn | Qn+1 | J | K |
0 | 0 | 0 | X |
0 | 1 | 1 | X |
1 | 0 | X | 1 |
1 | 1 | X | 0 |
Counter Design Using S-R and J-K Flip-Flops
86
Counter Design Using S-R and J-K Flip-Flops
87
Difference between Asynchronous and Synchronous Counter
Asynchronous Counter
Synchronous Counter
88
PROBLEM SOLVING WITH MULTIPLE METHODS
89
PROBLEM SOLVING WITH MULTIPLE METHODS
90
Difference between Combinational and Sequential Circuits
Combinational Circuits
Sequential Circuits
91
Difference between Combinational and Sequential Circuits
Combinational Circuits
Sequential Circuits
92
State Tables and Graphs
93
State Tables and Graphs
94
State Tables and Graphs
Moore model
Mealy model
95
State Tables and Graphs
Moore model
Mealy model
96
State Tables and Graphs
97
State Tables and Graphs�Moore Model
98
State Tables and Graphs�Moore Model
99
In Moore model each state and output is defined within a circle in state transition diagram in the format s/Y where s represents a symbol or memory values identified with a state and Y represents the output of the circuit.
An arrow sign marks state transition following an input value 0 or 1 that is written along the path. Note that X represents the binary data input from which sequence '011' is to be detected.
State Tables and Graphs�Moore Model
100
State Tables and Graphs�Moore Model
101
State Tables and Graphs�Moore Model
102
State Tables and Graphs�Moore Model
103
State Tables and Graphs�Moore Model
104
State Tables and Graphs�Moore Model
105
State Tables and Graphs�Mealy Model
106
State Tables and Graphs�Mealy Model
107
The output is written by the side of input along arrow path in the format X/Y, where X and Y represent input and output respectively.
State Tables and Graphs�Mealy Model
108
State Tables and Graphs�Mealy Model
109
State Tables and Graphs�Mealy Model
110
State Tables and Graphs�Mealy Model
111