Documente Academic
Documente Profesional
Documente Cultură
Unit 12
Registers and Counters
EE KAIST
Hae-Wook Choi
Data in
(a) Using gated clock
4-Bit D Flip-Flop Registers
− (Load=1, Clk ↓) D Æ Q
− (Load=0) Data out is held.
− For Gated Clk, clock delay and timing
problems may happen. Æ they can be
solved by Clock Enable signal.
4-Bit D Flip-Flop
Registers with
Data, Load,
Clear, and
Clock Inputs
(fig. 12-1)
Logic Diagram for 8-Bit Register with Tri-State Output (fig. 12-3)
input enable
output enable
If EF = 00 , A → G( LdG = 1 ) H ( LdH = 1 )
Values of registers A, B, C, D
If EF = 01, B → G( LdG = 1 ) H ( LdH = 1 )
are stored into G or H by E and
F which are Decoder inputs If EF = 10 ,C → G( LdG = 1 ) H ( LdH = 1 )
If EF = 11, D → G( LdG = 1 ) H ( LdH = 1 )
Store a number (xi) in a register and add yn to it and store again the result
to the accumulator (xi)
(xi + yi) Î xi
(Data Load)
@ Ld =1 , Ad = don’t care, Clk ↑
yi Î Multiplexer Out Î xi
input data is saved at DFF
(addition)
@ Ld =0 , Ad=1, Clk ↑
yi renewed
xi + yi = si
(Data Accumulation)
@ Ld = 0, Ad = 1, Clk ↑
si Î xi
xi + yi = si for each Clk ↑
Initially 0101
load to Q7 appear at Q0
width decided by
clock period
After Serial in, serial-out at the 8th clock (i.e., 7 clock periods)
falling edge
Sh=0, no change
The inverted output of the last FF is fed back into the input of the first FF.
Two loops can exist:
. 000 => 100 => 110 => 111 => 011 => 001 => 000 …
. 010 => 101 => 010 => 101
FF inputs
TC TB TA
0 0 1
0 1 1
0 0 1
1 1 1
0 0 1
0 1 1
0 0 1
Karnaugh Map for Binary Counter (fig. 12-14)
1 1 1
0 0 0 DB = B + = BA' + B ' A = B ⊕ A
( B change state when A = 1)
DC = C + = C ' BA + CB ' + CA' = C ' BA + C ( BA) '
= C ⊕ BA ( C change state when B = A = 1)
EE KAIST, Hae-Wook Choi 24 Logic Design-U12-Registers & Counters
12.3 Design of Binary Counters
CBA C + B + A+
UP DOWN
000 001 111
001 010 000
010 011 001
011 100 010
100 101 011
101 110 100
110 111 101
111 000 110
When U=1, Up counting
When D=1, Down counting
EE KAIST, Hae-Wook Choi 26 Logic Design-U12-Registers & Counters
12.3 Design of Binary Counters
Case U=1, D=0 Equivalent to a binary Up-counter
Present Next
FF inputs
state state
C B A D D D
C B A
+ + + C B A
0 0 0 0 0 1 0 DA = A+ = A'
0 0 1 0 1 0 0 DB = B+ = BA' + B' A = B ⊕ A
0 1 0 0 1 1 0
DC = C + = C ' BA + CB' + CA' = C ' BA + C( BA)' = C ⊕ BA
0 1 1 1 0 0 1
1 0 0 1 0 1 1
1 0 1 1 1 0 1
1 1 0 1 1 1 1
1 1 1 0 0 0 0
Present Next FF
state state inputs
C B A D D D
C B A
+ + + C B A
DA = A+ = A ⊕ 1 = A' ( A change state every clock cycle)
0 0 0 1 1 1 1
DB = B + = B ⊕ A' ( B change state when A = 0)
0 0 1 0 0 0 0
DC = C + = C ⊕ B' A' ( C change state when B = A = 0)
0 1 0 0 0 1 0
0 1 1 0 1 0 0
1 0 0 0 1 1 0
1 0 1 1 0 0 1
1 1 0 1 0 1 1
1 1 1 1 1 0 1
DA = A+ = A ⊕ (U + D)
DB = B + = B ⊕ (UA + DA' )
DC = C + = C ⊕ (UBA + DB ' A' )
ClrN Ld Ct C + B + A+
Ld ~ Load, Ct ~ Count 0 × × 0 0 0
1 1 × DC DB DA (load )
1 0 0 C B A (no change)
1 0 1 present state + 1
(b)
State table (fig. 12-
19(b))
EE KAIST, Hae-Wook Choi 31 Logic Design-U12-Registers & Counters
12.3 Design of Binary Counters
C B A C+ B+ A+
0 0 0 1 0 0
0 0 1 - - -
0 1 0 0 1 1
0 1 1 0 0 0
1 0 0 1 1 1
1 0 1 - - -
1 1 0 - - -
1 1 1 0 1 0
State Graph for Counter (fig. 12-21) State Table for fig. 21.21(Table 12-
3)
Present Next
FF inputs
state state
C B A T T T
C B A
+ + + C B A
0 0 0 1 0 0 1
0 0 1 - - - 0
0 1 0 0 1 1 0
0 1 1 0 0 0 0
1 0 0 1 1 1 0
1 0 1 - - - 1
1 1 0 - - - 1
1 1 1 0 1 0 1
S R Q Q+ Q Q+ R
S RS Q Q+ S
R RS
0 0 0 0 0 0 0 0 0 0 0 ×
0 0 1 1 0 1 0 1 1 0
0 1 0 0 0 1 1 0 1 0 0 1
0 1 1 0 1 0 0 1 1 1 × 0
1 0 0 1 1 1 0 0
1 0 1 1 1 0
1 1 0 - Inputs not allowed
1 1 1 -
(a) (b) (c)
S-R Flip-Flop Inputs (Table 12-5)
With columns added for the S and R flip-flop inputs (Table 12-6)
Design of a counter (Fig. 12-21) of using S-R Flip-Flop (fig. 12-27 (c))
J K Q Q+ Q Q+ J K Q Q+ J K
0 0 0 0 0 0 0 0 0 0 0 ×
0 0 1 1 0 1
0 1 1 ×
0 1 0 0 0 1 1 0
0 1 1 0
1 0 × 1
1 1
1 0 0 1 1 0 0 1
1 1 × 0
1 0 1 1 1 1
1 1 0 1 1 1 0 0
1 1 1 0 1 0
Logic Circuit of Counter of Figure 12-21 Using J-K Flip-Flops (fig. 12-28(c))
Figure 12-28
Counter of Figure 12-21
Using J-K Flip-Flops
Figure 12-29
Derivation of Flip-Flop
Input Equations Using
4-Varable Maps