04-Sequential-circuits-1
04-Sequential-circuits-1
Neeraj Goel
IIT Ropar
Sequential circuits
• Output depends on – present inputs as well as
past inputs
Z = f(At, At-1, At-2...., Bt, Bt-1, Bt-2...., Ct, Ct-1, Ct-2...)
A
Two types:
B Z Finite memory system
Sequential circuit
Infinite memory system
C
T
∆t
X Y
01 10 01
S
P
`
How to set a particular output?
` Q
01 R
P Q
S
R
10
10 10
simultaneously R
Q’
`
• Unstable output
• For valid inputs both the
outputs are complementary to ` Q
S
each
0 1 1 X 1
1 0 1 X 0 ` Q
1 1 1 X Invalid S
` Q
D
D Q
D Latch
G Q’
Tw
D Q
Q’
CLK
Characteristic equation: Q+ = D
D D Q D Q Q
D Latch D Latch
CLOCK Q’ Q’
G G
Q+ = JQ’ + K’Q
Q+ = D (for DFF)
D = JQ’ + K’Q Digital Logic Design:Sequential Circuits.
Clock divider using DFF
T Flip-flop with T always 1
D Q
Q’
CLK
CLK
D CLK/8
D CLK/4
D CLK/2
Q’
Q’ CLK/4
Q’ CLK/2
CLK
D2 Q2 D1 Q1 D0 Q0
D0 = Q0’
D1 = Q1’Q0 + Q1 Q0’
D2 = Q2’Q1Q0 + Q2 (Q1’ + Q0’)
= Q2 Q1Q0
Digital Logic Design:Sequential Circuits.
Modulo 6 bit counter
Q2 Q1 Q0 Q2+ Q1+ Q0+
0 0 0 0 0 1 Q0+ = Q0’
Q1+ = Q2Q1’Q0 + Q1 Q0’
0 0 1 0 1 0 Q2+ = Q1Q0 + Q2Q0’
0 1 0 0 1 1
0 1 1 1 0 0 Clock division by 6
1 0 0 1 0 1
1 0 1 0 0 0
1 1 0 x x X
1 1 1 x x X
Clear
Clear
CE CE CE
4
Q
CE D Sum
Load 32
CLK 32
Input
Combinational circuit
Clock
Output Registers
Data path +
Control path
Current state
Din D3 Q3 D2 Q2 D1 Q1 D0 Q0
D D D D Out
FlipFlop FlipFlop FlipFlop FlipFlop
Q’
CLK CLK CLK CLK
CLK
DIN
Q3
Q2
Q1
Q0
Shift operations: N bit number
• Shift right 01100 11100
0 0110 1
0 1110
– Divide by 2
00110
– Arithmetic shift right 01100
– Logical shift right 11000 Overflow!
• Shift left
– Multiply by 2
Implementation Shift registers
0 D3 Q3 D2 Q2 D1 Q1 D0 Q0
D D D D
LSR FlipFlop FlipFlop FlipFlop FlipFlop
Q’
CLK CLK CLK CLK
CE CE CE CE
Shift
0 D3 Q3 D2 Q2 D1 Q1 D0 Q0
D3 D D2 D D D0 D
D1
C1 FlipFlop C FlipFlop C FlipFlop C FlipFlop
Q’
CLK CLK CLK CLK
CE CE CE CE
C2
CLK
Operation C1 C0
Shift right 0 0
Shift left 0 1
Retain 1 0
Load data 1 1
CE
N Data-out
N=8, K= 10; Size = 1KB
N=16, K= 22; Size = 8MB
5x32 Decoder
0 1 2 Y 31
0
1
A0 2
A1
5x32 X 32 Y + X
A2
Decoder
A3
A4
31
Data
A[9:0]
Memory1
A[11:10] CE
2 to 4
decoder Data
A[9:0]
Memory2
CE
Data
A[9:0] Memory3
CE