Download presentation
Presentation is loading. Please wait.
1
CS 140 Lecture 18 Professor CK Cheng 12/3/02
2
Standard Sequential Modules 1.Register 2.Shift Register 3.Counter
3
3. Counter(Modulo-n counter) LD D Q TC Q (t+1) = (0, 0,.., 0)if CLR = 1 = Dif LD = 1 and CLR = 0 = (Q(t)+1)mod nif LD = 0, CNT = 1 and CLR = 0 = Q (t) if LD = 0, CNT = 0 and CLR = 0 CNT CLR CLK TC = 1 if Q (t) = n-1 and CNT = 1 = 0otherwise
4
Given a mod 16 counter, construct a mod-m counter (1 < m < 16) with AND, OR, NOT gates m = 6 Q 3 Q 2 Q 1 Q 0 3 2 1 0 CLK CLR CNT D 3 D 2 D 1 D 0 0 0 LD Q1Q1 Q0Q0 X Set LD = 1 when X = 1 and (Q 3 Q 2 Q 1 Q 0 ) = (0101)
5
Given a mod 16 counter, construct an a-to-b counter (0 < a < b < 15) 5 to 11 Q 3 Q 2 Q 1 Q 0 CLK CLR CNT D 3 D 2 D 1 D 0 0 1 LD Q3Q3 Q0Q0 X Set LD = 1 when X = 1 and (Q 3 Q 2 Q 1 Q 0 ) = b (in this case, 1011) Q1Q1
6
Given a mod 16 counter, construct a counter with sequence 0 1 5 6 2 3 7 Q 2 Q 1 Q 0 CLK CLR CNT D 2 D 1 D 0 LD Q 2’ Q0Q0 X Q2Q2 Q 0 Q 1 Q 0 Q 0’ When Q = 1, load D = 5 When Q = 6, load D = 2 When Q = 3, load D = 7
7
Q200001111Q200001111 Q100110011Q100110011 Q001010101Q001010101 LD 0 1 0 1 - 0 1 0 Id 0 1 2 3 4 5 6 7 D2-1-1--0-D2-1-1--0- D1-0-1--10D1-0-1--10 D0-1-1--01D0-1-1--01 LD = Q 2’ Q 0 + Q 2 Q 0’ D 2 = Q 0 D 1 = Q 1 D 0 = Q 0 K Mapping LD and D, we get
8
Q200001111Q200001111 Q100110011Q100110011 Q001010101Q001010101 LD 1 - 0 1 Id 0 1 2 3 4 5 6 7 D20----101D20----101 D11----101D11----101 D00----100D00----100 D 2 = Q 0 D 1 = Q 1’ + Q 0 D 0 = Q 1’ Q 0 LD = Q 2’ Q 1’ + Q 2 Q 0 + Q 2 Q 1 K Mapping LD and D, we get Sequence 0 2 3 4 5 7 6 LD = 1 D = 2 When Q(t) = 0 LD = 1 D = 7 When Q(t) = 5 LD = 1 D = 6 When Q(t) = 7 LD = 1 D = 0 When Q(t) = 6
9
Cascade Counter CNT LD TC CLK Q 7, Q 6, Q 5, Q 4 D 7, D 6, D 5, D 4 CNT LD TC CLK Q 3, Q 2, Q 1, Q 0 D 3, D 2, D 1, D 0 X
10
TC = 1 when X = 1, (Q 3, Q 2, Q 1, Q 0 ) = (1,1,1,1) (Q 7 (t+1) Q 6 (t+1) Q 5 (t+1) Q 4 (t+1) ) = (Q 7 (t) Q 6 (t) Q 5 (t) Q 4 (t) ) + 1 if TC = 1 & X = 1 The whole thing therefore can be viewed as a modulo 256 counter. (Q 3, Q 2, Q 1, Q 0 ) 0 1 2 3 4 13 14 15 0 1 2 3 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 TC (Q 7, Q 6, Q 5, Q 4 )
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.