Académique Documents
Professionnel Documents
Culture Documents
ECEn/CS 224
14 COUNTERSI Page 1
ECEn/CS 224
14 COUNTERSI Page 2
An Incrementable Counter
State Memory Current State
Inputs
Next State
DD QQ
INC Q1 Q0 N1 N0
Note that the next state is a function of the input INC as well as the current state.
0 0 0 0 1 1 1 1
0 0 1 1 0 0 1 1
0 1 0 1 0 1 0 1
0 0 1 1 0 1 1 0
0 1 0 1 1 0 1 0
ECEn/CS 224
14 COUNTERSI Page 3
INC Q1 Q0 N1 N0 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 0 1 1 0 1 1 0 0 1 0 1 1 0 1 0
Doing the KMaps for this results in: N1 = (INCQ1Q0) + (INCQ1) + (Q1Q0) N0 = (INCQ0) + (INCQ0) = INCQ0
ECEn/CS 224
14 COUNTERSI Page 4
CLK
The counter increments on the clock edge only when INC is asserted
ECEn/CS 224
14 COUNTERSI Page 5
CLR = INC = 0 No state transition CLR = 0 INC = 1 Counter Increments CLR = 1 INC = 0 Counter resets to 00 CLR = 1 INC = 1 What should it do?
0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1
0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
0 0 1 1 0 1 1 0 0 0 0 0 ? ? ? ?
0 1 0 1 1 0 1 0 0 0 0 0 ? ? ? ?
ECEn/CS 224
14 COUNTERSI Page 6
ECEn/CS 224
14 COUNTERSI Page 7
Case 1 Do Nothing
CLR INC Q1 Q0 N1 N0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 1 1 0 1 1 0 0 0 0 0 0 0 1 1 0 1 0 1 1 0 1 0 0 0 0 0 0 1 0 1
N1 =
N0 =
ECEn/CS 224
14 COUNTERSI Page 8
N1 =
N0 =
ECEn/CS 224
14 COUNTERSI Page 9
N1 =
N0 =
ECEn/CS 224
14 COUNTERSI Page 10
N1 =
N0 =
What happens in the real circuit when INC=CLR=1? It depends on the final equations
ECEn/CS 224
14 COUNTERSI Page 11
N1 =
N0 =
In the end, Xs in TTs result in some predictable behavior, you just dont care what that is
ECEn/CS 224
14 COUNTERSI Page 12
ECEn/CS 224
14 COUNTERSI Page 13
Inputs
Next State
State Memory
Current State
DD QQ
Outputs
ECEn/CS 224
14 COUNTERSI Page 14
Inputs
Next State
State Memory
Current State
DD QQ
Outputs
ECEn/CS 224
14 COUNTERSI Page 15
Moore outputs usually require multiple entries in TT. Mealy outputs often require only one.
ECEn/CS 224
14 COUNTERSI Page 16
CLK
Z output is TRUE whenever count=3 (it is static function of current state) Y output is TRUE whenever count=3 AND INC=1 (it is dynamic function of current state and input)
ECEn/CS 224
14 COUNTERSI Page 17
10
11
00