Digital Electronics Principles & Applications Sixth Edition Roger L. Tokheim Chapter 8 Counters 2003 Glencoe/McGraw-Hill
INTRODUCTION Overview of Counters Characteristics of Counters Ripple Up Counter Ripple Counter with Waveforms Ripple Down Counter Self-stopping Counter Frequency Division using Counters Using Counter ICs Magnitude Comparators Troubleshooting Hints
Overview of Counters Counter-by definition One input (clock) Outputs follow defined sequence Common tasks of counter Count up or down Increment or decrement count Sequence events Divide frequency Address memory As memory
QUIZ 1. A digital counter has a single clock input with many outputs and the counter follows defined sequence such as 000, 001, 010, 011, 100, 101, 110, 111, 000, etc. (True or False) 2. Several common tasks of a counter are to count up or down, divide frequency, or as memory. (True or False) True True
Characteristics of Counters Number of bits (4-bit, 8-bit, etc.) Maximum count 4 bit = 2 4 = 0000 to 1111 in binary 8 bit = 2 8 = 0000 0000 to 1111 1111 in binary Modulus of counter-number of states Decade counter 4-bit 8-bit Up or down counter Asynchronous or synchronous counter Presettable counter Self-stopping counter
QUIZ 1. A4 4-bit counter will count from binary 0000 to. 1111 2. The modulus of a counter is the number of state it will cycle through such as a decade counter has a modulus of. 3. Counters can be designed to count up or downward or devised to be self-stopping. (True or False) 10 True 4. A 4-bit counter would have modulus of 4 (mod-4 counter) because it is constructed using four flip-flops. (True or False) False
Ripple Counter Clock Input Binary Output 01 10 10 10 Pulse 12 34 56 78 This PS On and the 4-bit CLR next counter input clock has pulse All 16 J-K (8) states flip-flops all FFs and will will count toggle are from because binary each 0000 will through in the receive 1111 a H-to-L and INACTIVE then pulse- reset one back TOGGLE after to another. 0000. MODE Watch The the counter has ripple a modulus thru the of counter. 16.
Ripple Counter With Waveforms Clock Input Binary Output 0 0 1 1 0 0 1 Pulse 12 34 5 Clock input FFs triggered on 1s output H-to-L pulse. CLK toggles 1s FF. 1s FF toggles 2s FF. 2s output 2s FF toggles 4s FF. 4s output
QUIZ Q#1- Q#2-1 the of the Q#3-2 the of the Q#4- After will will be pulse 8 the output of the mod-16 be 15. the output of the mod-16 will be. counter will be binary.. 1 01 10 1 01 0 0 0 01 Input Pulse Pulses 15 12 8
Decade Counter Clock Input Binary Output 0111 1000 1001 0000 0001 0010 0011 0100 0101 0 0 Pulse 12 34 56 78 Short negative pulse To clear input of each FF All J & K inputs = 1 All PR inputs = 1 To change mod-16 counter to decade counter: Count is at 1001. Reset count to 0000 after 1001 (9) count. Next clock pulse will increment counter for a When count hits 1010 reset to 0000. short time to 1010 which will activate the NAND gate See added 2-input NAND gate that clears all and reset the counter to 0000. JK FFs to 0 when count hits 1010.
QUIZ Q#1- Q#2- Q#3- This This The is circuit a gate can (mod-10, generates be described mod-16) a very as up short a counter. LOW (decade, pulse 4-bit) Q#4- After 0110, the counting sequence would be 0111, when 1000, the up count counter. 1001, reaches 1010, 1011, 10101100, and 1101, resets 1110, to counter 1111, 0000, to 0000. etc. (T or F) ANS: mod-10 decade ANS: ANS: NAND False 0110 1 0 Input pulses To clear input of each FF
Down Counter 1 0 0 1 10 Pulse 12 34 5 Changes from Ripple Up Counter are wiring from Q outputs (instead of Q outputs) to the CLK input of the next FF.
QUIZ Q#1- This i can be described as a 3-bit ripple (down-counter, Q#2- Q#3- This The circuit counting up-counter). is a sequence self-stopping of this 3-bit circuit ripple is 111, down 110, counter. 101, (T 100, or 011, F) 010, 001, 000, 111, 110, 101, 100, etc. (T or F) ANS: down-counter ANS: False ANS: True 111 1 1 Input pulses
Self-Stopping Down Counter 1 0 1 0 10 The count remained at binary 000. Pulse 12 34 56 78 This is a 3-bit down counter. The 1s FF is in TOGGLE mode when counting (J & K = 1). The 1s FF switches to HOLD mode when the J and K inputs are forced LOW by the OR gate when the count decrements to 000. The count stops at 000.
QUIZ Q#1- This circuit could be described as a 3-bit (decade, Q#2- Q#3-With The self-stopping) 3-input the count OR gate 111, ripple generates the OR gate counter. a outputs (HIGH, a LOW) HIGH when which the places count the decreases left FF in to the 000 toggle which mode. stops the (T or count F) at 000. ANS: self-stopping ANS: LOW ANS: True 1 1 1 Input tpulses
Counter Used for Frequency Division 8 200 Hz 4 100 Hz 400 Hz 50 Hz 2 16 Clock Input 800 Hz
QUIZ Q#1- Q#2- is the Q#3- is is the the from from the 1s J-K with an from Q#4- Q#5- the the What The 2s J-K 8s 4s J-K is output the output from with with frequency the an 4-bit an from the 8s J-K of flip-flop 3200 Hz? p with an input counter frequency is referred of of of 3200 3200 3200 to as Hz? Hz? Hz? the ANS: 1600 ANS: 800 (divide-by-4, divide-by-16) output. 400 ANS: divide-by-16 200 Clock Input Frequency? 3200 Hz
Using the 7493 Counter IC Counters are available in IC form. Either ripple (7493 IC) or synchronous (74192 IC) counters are available. 100? Hz Hz 400? Hz Hz 800? Hz Hz 1600 Hz 7493 Counter IC wired as a 4-bit binary counter
Magnitude Comparator A magnitude comparator is a combinational logic device that compares the value of two binary numbers and responds with one of three outputs (A=B or A>B or A<B). A(0) Input binary 0111 1111 0001 Input binary 0110 0111 1100 A(1) A(2) A(3) B(0) B(1) B(2) 74HC85 Magnitude Comparator A > B A = B A < B HIGH HIGH HIGH B(3)
QUIZ Q#1- The 74HC85 Comparator IC compares two 4-bit (binary, Q#2- Q#3- decimal) numbers of the (A and B) and IC generates will be one Q#4- Which output of of the the comparator IC IC will will be be activated of three outputs with with including two two 4-bit 4-bit (1) A = B, (2) A > B, or as as with these two 4-bit binary numbers as (3) inputs? A < B. 0101 1101 A(0) A(1) A(2) A(3) B(0) B(1) 1010 B(2) B(3) 0101 1011 74HC85 Magnitude Comparator A>B A = B A < B??? ANS: binary = < ANS: A > B
Simple Troubleshooting Hints Feel topofictodetermineifitishot of if it is Look for broken connections, signs of excessive heat Smell for overheating Check power source Trace path of logic through circuit Know the normal operation of the circuit
QUIZ 1. The first three steps in troubleshooting are the use of your senses to (1) feel the top of the ICs for overheating, (2) to for broken connections, and (3) to smell for signs of overheating. 2. The forth step in troubleshooting is to use a simple handheld instrument called a to check the power sources at each IC. 3. Your knowledge of the normal operation of the circuit and equipment is very important in troubleshooting. (True or False) look logic probe True
REVIEW Overview of Counters Characteristics of Counters Ripple Up Counter Ripple Counter with Waveforms Ripple Down Counter Self-stopping Counter Frequency Division using Counters Using Counter ICs Magnitude Comparators Troubleshooting Hints