Professional Documents
Culture Documents
Digital Logic Design No6 Counters and Registers
Digital Logic Design No6 Counters and Registers
1 J CP K Q0 CP Q0 Q0 Q1 K Q0 J Q1
J 0 0 1 1
K 0 1 0 1
Q1
0 0
1 0
0 1
1 1
0 0
1 J CP
K Q0 CP Q0 Q0 Q1 Q2
Q1
Q2
Simple Registers
No external gates. Example: A 4-bit register. A new 4-bit data is loaded on every clock cycle.
A4 A3 A2 A1
Q D CP I4
Q D
Q D
Q D
I3
I2
I1
I2
S Q R
A2
I3
S Q R
A3
I4
S Q R
A4
CP Clear
Register with Parallel Load Using D Flip Load Flops Load A + Load I
1 1
D Q I1
A1
D Q I2
A2
I3
D Q
A3
I4 CP Clear
D Q
A4
Clock Pulse
Combinational Circuit
Outputs
The external inputs and present states of the register determine the next states of the register and the external outputs, through the combinational circuit. The combinational circuit may be implemented by any of the methods covered in MSI components and Programmable Logic Devices.
State Table
Input x 0 1 0 1 0 1 0 1
Logic Diagram
Output y 0 0 0 1 0 0 0 1 x y
A1 . x A2 x
A1 A2
A1 x A2
1 2 3
8X3 ROM
1 2 3 y
CLK
Shift Register
SO
SI
SO
Wordtime
T1
T2
T3
T4
Shift Register A 1 1 1 0 1 0 1 1 1 0 1 0 1 1 1 1 1 0 1 1
Shift Register B 0 1 1 0 1 0 0 1 1 0 1 0 0 1 1 0 1 0 0 1
Serial output of B 0 1 0 0 1
Clear
Q D
Q D
Q D
Q D
CLK
S1 S0
4x1 MUX 3 2 1 0
4x1 MUX 3 2 1 0
4x1 MUX 3 2 1 0
4x1 MUX 3 2 1 0
I4
I3 Parallel inputs
I2
I1
An Application-Serial Addition
Most operations in digital computers are done in parallel. Serial operations are slower but require less equipment. A serial adder is shown below. A A+B.
SI 1010 Shift register A SI 0111 Shift register B SO SO x y FA z Q D S C
Clear
X 1 X 0
S=x+y + Q JQ = xy KQ = xy =(x+y)
Shift register A
SO=x
J Q
Clear
S=x+y + Q JQ = xy KQ = xy =(x+y)
K 0 1 0 1
J 1
0 1 1
Q To next stage
Count pulses K 1 K 1 K 1 K 1
0000
0001
0010
0011
0100
1001
1000
0111
0110
0101
1 Q J
0 Q J
0 Q J
1 Q J 1 Count pulses
J 0 0 1 1
K 0 1 0 1
Q1 Q2 0 Q3 0 Q4 0 Q5 0
1 0 0 0 0 1 0 0 1 1 0 0 0 0 1 0 1 0 1 0 0 1 1 0 1 1 1 0 0 0 0 1 1 0 0 1 0 0 0 0
Q8 Q4 Q2 Q1
Q8 Q4 Q2 Q1
Q8 Q4 Q2 Q1
BCD Counter
102 digit 0-999
BCD Counter
101 digit 0-99
BCD Counter
100 digit 0-9
Count pulses
J 0 0 1 1
K 0 1 0 1
A4
A3
A2
A1
Q/
K
Q J
Q/ K
Q J
Q/ K
Q J
Q/ K
Q J CP
To next stage
Count enable
T 0 1
Q/ T
Q/ T
Q/ T
Q/ T
CP
To Next stage
UP
Down
Flip-flop inputs
Q1
0 1 0 1 0 1 0 1 0 1
Output Carry
y
0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1
Q4
0 0 0 0 1 1 1 1 0 0
Q2
0 0 1 1 0 0 1 1 0 0
TQ8
0 0 0 0 0 0 0 1 0 1
TQ4
0 0 0 1 0 0 0 1 0 0
TQ2
0 1 0 1 0 1 0 1 0 0
TQ1
Using K-maps, we get TQ1 =1 TQ2 = Q/8Q1 TQ4 = Q2Q1 TQ8 = Q8Q1 + Q4Q2Q1 y = Q8Q1 Now logic diagram can be drawn for BCD synchronous counter
Q(t) Q(t+1) 0 0 1 1 0 1 0 1
T 0 1 1 0
Q8 Q8
T CP
Q4 Q4
T
Q2 Q2
Q1 Q1
Count Load I1
JQ K
A1
I2
JQ K
A2
I3
JQ K
A3
J 0 0 1 1
K 0 1 0 1
I4
JQ K
A4
Clear CP
Carry out
Timing Sequences
Start CP Stop R S Q Word-time control
CP
3-bit counter
Count enable
Shift right
T0
T1
T2
T3
2X4 decoder
Count enable
2-bit counter
D Q
D Q
D Q
D Q
A/
B/
C/
E/
CP
Flip-flop outputs A B C E
0 1 1 1 1 0 0 0 0 0 1 1 1 1 0 0 0 0 0 1 1 1 1 0 0 0 0 0 1 1 1 1