Download presentation
Presentation is loading. Please wait.
Published byAllan Knight Modified over 8 years ago
1
Counters - II
2
Outline Synchronous (Parallel) Counters Up/Down Synchronous Counters Designing Synchronous Counters Decoding A Counter Counters with Parallel Load
3
Outline Synchronous (Parallel) Counters Up/Down Synchronous Counters Designing Synchronous Counters Decoding A Counter Counters with Parallel Load
4
Synchronous (Parallel) Counters Synchronous (parallel) counters: the flip-flops are clocked at the same time by a common clock pulse. We can design these counters using the sequential logic design process. Example: 2-bit synchronous binary counter (using T flip-flops, or JK flip-flops with identical J,K inputs). 0100 1011
5
Synchronous (Parallel) Counters Example: 2-bit synchronous binary counter (using T flip-flops, or JK flip-flops with identical J,K inputs). TA 1 = A 0 TA 0 = 1 1 K J K J A1A1 A0A0 C C CLK Q Q' Q Q
6
Synchronous (Parallel) Counters Example: 3-bit synchronous binary counter (using T flip-flops, or JK flip-flops with identical J, K inputs). TA 2 = A 1.A 0 A2A2 A1A1 A0A0 1 1 TA 1 = A 0 TA 0 = 1 A2A2 A1A1 A0A0 1 11 1 A2A2 A1A1 A0A0 111 1111 1
7
Synchronous (Parallel) Counters Example: 3-bit synchronous binary counter (cont’d). TA 2 = A 1.A 0 TA 1 = A 0 TA 0 = 1 1 A2A2 CP A1A1 A0A0 K Q JK Q JK Q J
8
Synchronous (Parallel) Counters Note that in a binary counter, the n th bit (shown underlined) is always complemented whenever 011…11 100…00 or111…11 000…00 Hence, X n is complemented whenever X n-1 X n-2... X 1 X 0 = 11…11. As a result, if T flip-flops are used, then TX n = X n-1. X n-2..... X 1. X 0
9
Synchronous (Parallel) Counters Example: 4-bit synchronous binary counter. TA 3 = A 2. A 1. A 0 TA 2 = A 1. A 0 TA 1 = A 0 TA 0 = 1 1 K J K J A1A1 A0A0 C C CLK Q Q' Q Q K J A2A2 C Q K J A3A3 C Q A 1.A 0 A 2.A 1.A 0
10
Synchronous (Parallel) Counters Example: Synchronous decade/BCD counter. T 0 = 1 T 1 = Q 3 '.Q 0 T 2 = Q 1.Q 0 T 3 = Q 2.Q 1.Q 0 + Q 3.Q 0
11
Synchronous (Parallel) Counters Example: Synchronous decade/BCD counter (cont’d). T 0 = 1 T 1 = Q 3 '.Q 0 T 2 = Q 1.Q 0 T 3 = Q 2.Q 1.Q 0 + Q 3.Q 0 1 Q1Q1 Q0Q0 CLK T C Q Q' Q Q2Q2 Q3Q3 T C Q Q T C Q Q T C Q Q
12
Outline Synchronous (Parallel) Counters Up/Down Synchronous Counters Designing Synchronous Counters Decoding A Counter Counters with Parallel Load
13
Up/Down Synchronous Counters Up/down synchronous counter: a bidirectional counter that is capable of counting either up or down. An input (control) line Up/Down (or simply Up) specifies the direction of counting. Up/Down = 1 Count upward Up/Down = 0 Count downward
14
Up/Down Synchronous Counters Example: A 3-bit up/down synchronous binary counter. TQ 0 = 1 TQ 1 = (Q 0.Up) + (Q 0 '.Up' ) TQ 2 = ( Q 0.Q 1.Up ) + (Q 0 '. Q 1 '. Up' ) Up counter TQ 0 = 1 TQ 1 = Q 0 TQ 2 = Q 0.Q 1 Down counter TQ 0 = 1 TQ 1 = Q 0 ’ TQ 2 = Q 0 ’.Q 1 ’
15
Up/Down Synchronous Counters Example: A 3-bit up/down synchronous binary counter (cont’d). TQ 0 = 1 TQ 1 = (Q 0.Up) + (Q 0 '.Up' ) TQ 2 = ( Q 0.Q 1.Up ) + (Q 0 '. Q 1 '. Up' ) 1 Q1Q1 Q0Q0 CLK T C Q Q' Q T C Q Q T C Q Q Up Q2Q2
16
Outline Synchronous (Parallel) Counters Up/Down Synchronous Counters Designing Synchronous Counters Decoding A Counter Counters with Parallel Load
17
Designing Synchronous Counters Covered in previous units. Example: A 3-bit Gray code counter (using JK flip-flops). 100 000 001 101 111 110 011 010
18
Designing Synchronous Counters 3-bit Gray code counter: flip-flop inputs. 0 10 1 00 01 11 10 Q2Q2 Q1Q0Q1Q0 XXXX 1 JQ 2 = Q 1.Q 0 ' 0 10 1 00 01 11 10 Q2Q2 Q1Q0Q1Q0 XXXX 1 KQ 2 = Q 1 '.Q 0 ' 0 10 1 00 01 11 10 Q2Q2 Q1Q0Q1Q0 XX XX1 JQ 1 = Q 2 '.Q 0 0 10 1 00 01 11 10 Q2Q2 Q1Q0Q1Q0 XX XX 1 KQ 1 = Q 2.Q 0 0 10 1 00 01 11 10 Q2Q2 Q1Q0Q1Q0 XX XX1 JQ 0 = Q 2.Q 1 + Q 2 '.Q 1 ' = (Q 2 Q 1 )' 1 0 10 1 00 01 11 10 Q2Q2 Q1Q0Q1Q0 XX XX1 1 KQ 0 = Q 2.Q 1 ' + Q 2 '.Q 1 = Q 2 Q 1
19
Designing Synchronous Counters 3-bit Gray code counter: logic diagram. JQ 2 = Q 1.Q 0 ' JQ 1 = Q 2 '.Q 0 JQ 0 = (Q 2 Q 1 )' KQ 2 = Q 1 '.Q 0 ' KQ 1 = Q 2.Q 0 KQ 0 = Q 2 Q 1 Q1Q1 Q0Q0 CLK Q2Q2 J C Q Q' K J C Q K J C Q K Q2'Q2' Q0'Q0' Q1'Q1'
20
Outline Synchronous (Parallel) Counters Up/Down Synchronous Counters Designing Synchronous Counters Decoding A Counter Counters with Parallel Load
21
Decoding A Counter Decoding a counter involves determining which state in the sequence the counter is in. Differentiate between active-HIGH and active-LOW decoding. Active-HIGH decoding: output HIGH if the counter is in the state concerned. Active-LOW decoding: output LOW if the counter is in the state concerned.
22
Decoding A Counter Example: MOD-8 ripple counter (active-HIGH decoding). A' B' C' 123456789 Clock HIGH only on count of ABC = 000 A' B' C HIGH only on count of ABC = 001 A' B C' HIGH only on count of ABC = 010 100 ABCABC HIGH only on count of ABC = 111......
23
Decoding A Counter Example: To detect that a MOD-8 counter is in state 0 (000) or state 1 (001). A' B' 123456789 Clock HIGH only on count of ABC = 000 or ABC = 001 100 Example: To detect that a MOD-8 counter is in the odd states (states 1, 3, 5 or 7), simply use C. C 123456789 Clock HIGH only on count of odd states 100 A' B' C' A' B' C
24
Outline Synchronous (Parallel) Counters Up/Down Synchronous Counters Designing Synchronous Counters Decoding A Counter Counters with Parallel Load
25
Counters with Parallel Load Counters could be augmented with parallel load capability for the following purposes: To start at a different state To count a different sequence As more sophisticated register with increment/decrement functionality.
26
Counters with Parallel Load Different ways of getting a MOD-6 counter: Count = 1 Load = 0 CP I 4 I 3 I 2 I 1 Count = 1 Clear = 1 CP A 4 A 3 A 2 A 1 Inputs = 0 Load (a) Binary states 0,1,2,3,4,5. I 4 I 3 I 2 I 1 A 4 A 3 A 2 A 1 Inputs have no effect Clear (b) Binary states 0,1,2,3,4,5. I 4 I 3 I 2 I 1 Count = 1 Clear = 1 CP A 4 A 3 A 2 A 1 0 0 1 1 Load (d) Binary states 3,4,5,6,7,8. I 4 I 3 I 2 I 1 Count = 1 Clear = 1 CP A 4 A 3 A 2 A 1 1 0 Load Carry-out (c) Binary states 10,11,12,13,14,15.
27
Counters with Parallel Load 4-bit counter with parallel load.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.