COUNTERS AND REGISTERS

Similar documents
Spec. Instructor: Center

Module -18 Flip flops

DM74AS169A Synchronous 4-Bit Binary Up/Down Counter

DM74ALS169B Synchronous Four-Bit Up/Down Counters

Page 1. Last time we looked at: latches. flip-flop

Module-20 Shift Registers

Chapter 4: FLIP FLOPS. (Sequential Circuits) By: Siti Sabariah Hj. Salihin ELECTRICAL ENGINEERING DEPARTMENT EE 202 : DIGITAL ELECTRONICS 1

SN54HC161, SN74HC161 4-BIT SYNCHRONOUS BINARY COUNTERS

EXPERIMENT #5 COMBINATIONAL and SEQUENTIAL LOGIC CIRCUITS Hardware implementation and software design

DM74LS191 Synchronous 4-Bit Up/Down Counter with Mode Control

HIGH LOW Astable multivibrators HIGH LOW 1:1

Synchronous Binary Counter with Synchronous Clear

Fan in: The number of inputs of a logic gate can handle.

GATE Online Free Material

54AC191 Up/Down Counter with Preset and Ripple Clock

EE 308-Digital Electronics Laboratory EXPERIMENT 8 FLIP FLOPS AND SEQUENTIAL CIRCUITS

Combinational Logic Circuits. Combinational Logic

Outline. EECS Components and Design Techniques for Digital Systems. Lec 12 - Timing. General Model of Synchronous Circuit

Lecture 20: Several Commercial Counters & Shift Register

INTEGRATED CIRCUITS. For a complete data sheet, please also download:

logic system Outputs The addition of feedback means that the state of the circuit may change with time; it is sequential. logic system Outputs

DM74LS161A DM74LS163A Synchronous 4-Bit Binary Counters

Digital Logic Circuits

CHAPTER FIVE - Flip-Flops and Related Devices

Laboratory Manual CS (P) Digital Systems Lab

EC O4 403 DIGITAL ELECTRONICS

INTEGRATED CIRCUITS. For a complete data sheet, please also download:

DM54LS190 DM74LS190 DM54LS191 DM74LS191 Synchronous 4-Bit Up Down Counters with Mode Control

DATA SHEET. HEF4059B LSI Programmable divide-by-n counter. For a complete data sheet, please also download: INTEGRATED CIRCUITS

CD4541BC Programmable Timer

CONTENTS Sl. No. Experiment Page No

COMBINATIONAL and SEQUENTIAL LOGIC CIRCUITS Hardware implementation and software design

Winter 14 EXAMINATION Subject Code: Model Answer P a g e 1/28

Model 305 Synchronous Countdown System

ANLAN203. KSZ84xx GPIO Pin Output Functionality. Introduction. Overview of GPIO and TOU

SN54ALS161B, ALS162B, ALS163B, AS161, AS163 SN74ALS161B, ALS163B, AS161, AS163 Synchronous 4-Bit Decade and Binary Counters

EE283 Electrical Measurement Laboratory Laboratory Exercise #7: Digital Counter

Design and build a prototype digital motor controller with the following features:

Sequential Logic Circuits

E2.11/ISE2.22 Digital Electronics II

INTEGRATED CIRCUITS. For a complete data sheet, please also download:

DIGITAL ELECTRONICS: LOGIC AND CLOCKS

UMAINE ECE Morse Code ROM and Transmitter at ISM Band Frequency

ANALOG TO DIGITAL CONVERTER

We ve looked at timing issues in combinational logic Let s now examine timing issues we must deal with in sequential circuits

SN54ALS190, SN54ALS191, SN74ALS190, SN74ALS191 SYNCHRONOUS 4-BIT UP/DOWN DECADE AND BINARY COUNTERS

DM Segment Decoder/Driver/Latch with Constant Current Sink Outputs

Design considerations (D)

1. The decimal number 62 is represented in hexadecimal (base 16) and binary (base 2) respectively as

NOTE: The Flatpak version has the same pinouts (Connection Diagram) as the Dual In-Line Package.

11 Counters and Oscillators

CS302 - Digital Logic Design Glossary By

EECS 270: Lab 7. Real-World Interfacing with an Ultrasonic Sensor and a Servo

INTEGRATED CIRCUITS. 74ALS161B/74ALS163B 4-bit binary counter. Product specification 1991 Feb 08 IC05 Data Handbook

Module 5. DC to AC Converters. Version 2 EE IIT, Kharagpur 1

DS1802 Dual Audio Taper Potentiometer With Pushbutton Control

CMOS Digital Integrated Circuits Analysis and Design

Homework Problem Set: Combinational Devices & ASM Charts. Answer all questions on this sheet. You may attach additional pages if necessary.

NOTE: The Flatpak version has the same pinouts (Connection Diagram) as the Dual In-Line Package.

ENGR-4300 Spring 2008 Test 3. Name SOLUTION. Section 1(MR 8:00) 2(TF 2:00) 3(MR 6:00) (circle one) Question I (20 points) Question II (20 points)

INTEGRATED CIRCUITS. For a complete data sheet, please also download:

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified) SUMMER-16 EXAMINATION Model Answer

Technical Information Manual

EECS-140/141 Introduction to Digital Logic Design Lecture 7:Sequential Logic Basics

74F160A 74F162A Synchronous Presettable BCD Decade Counter

EE 42/100 Lecture 24: Latches and Flip Flops. Rev B 4/21/2010 (2:04 PM) Prof. Ali M. Niknejad

4. Forward bias of a silicon P-N junction will produce a barrier voltage of approximately how many volts? A. 0.2 B. 0.3 C. 0.7 D. 0.

The entire range of digital ICs is fabricated using either bipolar devices or MOS devices or a combination of the two. Bipolar Family DIODE LOGIC

Linear & Digital IC Applications (BRIDGE COURSE)

NTE40192B & NTE40193B Integrated Circuit CMOS, Presettable Up/Down Counters (Dual Clock with Reset)

MAINTENANCE MANUAL DIGITAL SELECTOR MODULE 19D902519G1 TABLE OF CONTENTS

74F50729 Synchronizing dual D-type flip-flop with edge-triggered set and reset with metastable immune characteristics

UNIVERSITY OF BOLTON SCHOOL OF ENGINEERING BENG (HONS) ELECTRICAL & ELECTRONICS ENGINEERING SEMESTER TWO EXAMINATION 2017/2018

M74HC4518TTR DUAL DECADE COUNTER

DM Segment Decoder/Driver/Latch with Constant Current Sink Outputs

E2.11/ISE2.22 Digital Electronics II

Logic Families. Describes Process used to implement devices Input and output structure of the device. Four general categories.

EE 42/100 Lecture 24: Latches and Flip Flops. Rev A 4/14/2010 (8:30 PM) Prof. Ali M. Niknejad

Designing with the Si9976DY N-Channel Half-Bridge Driver and LITTLE FOOT Dual MOSFETs

HCF40103B 8-STAGE PRESETTABLE SYNCHRONOUS 8 BIT BINARY DOWN COUNTERS

UNDERSTANDING THE DDC112 s CONTINUOUS AND NON-CONTINUOUS MODES OVERVIEW

UNIT-IV Combinational Logic

Sr. No. Instrument Specifications. TTL (Transistor-Transistor Logic) based on bipolar junction transistors

Electronics. Digital Electronics

EE 330 Lecture 5. Other Logic Styles Improved Device Models Stick Diagrams

SN54HC191, SN74HC191 4-BIT SYNCHRONOUS UP/DOWN BINARY COUNTERS

74F5074 Synchronizing dual D-type flip-flop/clock driver

Unit-6 PROGRAMMABLE INTERRUPT CONTROLLERS 8259A-PROGRAMMABLE INTERRUPT CONTROLLER (PIC) INTRODUCTION

74F160A*, 74F161A, 74F162A*, 74F163A 4-bit binary counter INTEGRATED CIRCUITS. Product specification 1996 Jan 29 IC15 Data Handbook

FUNCTION OF COMBINATIONAL LOGIC CIRCUIT

B.E. SEMESTER III (ELECTRICAL) SUBJECT CODE: X30902 Subject Name: Analog & Digital Electronics

74F161A 74F163A Synchronous Presettable Binary Counter

First Optional Homework Problem Set for Engineering 1630, Fall 2014

EXPERIMENT 2: Introduction to Cadence Tools (Schematic Capture and Circuit Simulation)

. HIGH SPEED .LOW POWER DISSIPATION .HIGH NOISE IMMUNITY M54/74HC40102 M54/74HC STAGE PRESETTABLE SYNCHRONOUS DOWN COUNTERS

16.2 DIGITAL-TO-ANALOG CONVERSION

LM2240 Programmable Timer Counter

EECS 150 Homework 4 Solutions Fall 2008

(

Sequential Logic Design (Latch & FF)

Transcription:

H P T E R 7 OUNTERS N REGISTERS OUTLINE Part 7- synchronous (Ripple) ounters 7-2 Propagation elay in Ripple ounters 7-3 Synchronous (Parallel) ounters 7-4 ounters with MO Numbers 6 2 N 7-5 Synchronous own and Up/ own ounters 7-6 Presettable ounters 7-7 I Synchronous ounters 7-8 ecoding a ounter 7-9 nalyzing Synchronous ounters 7- Synchronous ounter esign 7- asic ounters Using HLs 7-2 Full-Featured ounters in HL 7-3 Wiring HL Modules Together 7-4 State Machines Part 2 7-5 Integrated ircuit Registers 7-6 Parallel In/Parallel Out The 74LS74/74H74 7-7 Serial In/Serial Out The 74LS66/74H66 7-8 Parallel In/Serial Out The 74LS65/74H65 7-9 Serial In/Parallel Out The 74LS64/74H64 7-2 Shift-Register ounters 7-2 Troubleshooting 7-22 HL Registers 7-23 HL Ring ounters 7-24 HL One-Shots

OJETIVES Upon completion of this chapter, you will be able to: Understand the operation and characteristics of synchronous and asynchronous counters. onstruct counters with MO numbers less than 2 N. onstruct both up and down counters. onnect multistage counters. nalyze and evaluate various types of counters. esign arbitrary-sequence synchronous counters. Understand several types of schemes used to decode different types of counters. escribe counter circuits using different levels of abstraction in HL. ompare the major differences between ring and Johnson counters. Recognize and understand the operation of various types of I registers. escribe shift registers and shift register counters using HL. pply existing troubleshooting techniques used for combinational logic systems to troubleshoot sequential logic systems. INTROUTION In hapter 5, we saw how flip-flops could be connected to function as counters and registers. t that time we studied only the basic counter and register circuits. igital systems employ many variations of these basic circuits, mostly in integrated-circuit form. In this chapter, we will look at how FFs and logic gates can be combined to produce different types of counters and registers. ecause there are a great number of topics in this chapter, it has been divided into two parts. In PRT, we will cover the principles of counter operation, the various counter circuit arrangements, and representative I counters. PRT 2 will present several types of I registers, shift register counters, and troubleshooting. Each part includes a section containing HL descriptions of counters and registers. s you progress through this chapter, you will find that you are constantly drawing on your understanding of the material we have covered in the preceding chapters. It is a good idea to go back and review previously learned material whenever you need to. 36

362 HPTER 7/OUNTERS N REGISTERS PRT 7- SYNHRONOUS (RIPPLE) OUNTERS Figure 7- shows a four-bit binary counter circuit such as the one discussed in hapter 5. Recall the following points concerning its operation:. The clock pulses are applied only to the input of flip-flop.thus, flipflop will toggle (change to its opposite state) each time the clock pulses make a negative (HIGH-to-LOW) transition. Note that J K for all FFs. 2. The normal output of flip-flop acts as the input for flip-flop, and so flip-flop will toggle each time the output goes from to. Similarly, flip-flop will toggle when goes from to, and flip-flop will toggle when goes from to. 3. FF outputs,,, and represent a four-bit binary number, with as the MS. Let s assume that all FFs have been cleared to the state (LER inputs are not shown). The waveforms in Figure 7- show that a binary counting sequence from to is followed as clock pulses are continuously applied. 4. fter the NGT of the fifteenth clock pulse has occurred, the counter FFs are in the condition. On the sixteenth NGT, flip-flop goes from to, which causes flip-flop to go from to, and so on, until the J J J J * K K K K * *ll J and K inputs assumed to be. LOK 2 3 4 5 6 7 8 9 2 3 4 5 6 7 8 (count) Recycle to FIGURE 7- Four-bit asynchronous (ripple) counter.

SETION 7-/SYNHRONOUS (RIPPLE) OUNTERS 363 counter is in the state. In other words, the counter has gone through one complete cycle ( through ) and has recycled back to. From this point, it will begin a new counting cycle as subsequent clock pulses are applied. In this counter, each FF output drives the input of the next FF. This type of counter arrangement is called an asynchronous counter because the FFs do not change states in exact synchronism with the applied clock pulses; only flip-flop responds to the clock pulses. FF must wait for FF to change states before it can toggle; FF must wait for FF, and so on. Thus, there is a delay between the responses of successive FFs. This delay is typically 5 2 ns per FF. In some cases, as we shall see, this delay can be troublesome. This type of counter is also often referred to as a ripple counter because of the way the FFs respond one after another in a kind of rippling effect. We will use the terms asynchronous counter and ripple counter interchangeably. Signal Flow It is conventional in circuit schematics to draw the circuits (wherever possible) so that the signal flow is from left to right, with inputs on the left and outputs on the right. In this chapter, we will often break with this convention, especially in diagrams showing counters. For example, in Figure 7-, the inputs of each FF are on the right, the outputs are on the left, and the input clock signal is shown coming in from the right. We will use this arrangement because it makes the counter operation easier to understand and follow (because the order of the FFs is the same as the order of the bits in the binary number that the counter represents). In other words, FF (which is the LS) is the rightmost FF, and FF (which is the MS) is the leftmost FF. If we adhered to the conventional left-to-right signal flow, we would have to put FF on the left and FF on the right, which is opposite to their positions in the binary number that the counter represents. In some of the counter diagrams later in the chapter, we will employ the conventional leftto-right signal flow so that you will get used to seeing it. EXMPLE 7- The counter in Figure 7- starts off in the state, and then clock pulses are applied. Some time later the clock pulses are removed, and the counter FFs read. How many clock pulses have occurred? Solution The apparent answer seems to be 3 because is the binary equivalent of 3. With the information given, however there is no way to tell whether or not the counter has recycled. This means that there could have been 9 clock pulses; the first 6 pulses bring the counter back to, and the last 3 bring it to. There could have been 35 pulses (two complete cycles and then three more), or 5 pulses, and so on. MO Number The counter in Figure 7- has 6 distinctly different states ( through ). Thus, it is a MO-6 ripple counter. Recall that the MO number is generally equal to the number of states that the counter goes through in

364 HPTER 7/OUNTERS N REGISTERS each complete cycle before it recycles back to its starting state. The MO number can be increased simply by adding more FFs to the counter. That is, MO number 2 N (7-) where N is the number of FFs connected in the arrangement of Figure 7-. EXMPLE 7-2 counter is needed that will count the number of items passing on a conveyor belt. photocell and light source combination is used to generate a single pulse each time an item crosses its path. The counter must be able to count as many as one thousand items. How many FFs are required? Solution It is a simple matter to determine what value of N is needed so that 2 N Ú. Since 2 9 52, 9 FFs will not be enough. 2 24, so FFs would produce a counter that could count as high as 2 23. Therefore, we should use FFs. We could use more than, but it would be a waste of FFs because any FF past the tenth one will not be needed. Frequency ivision In hapter 5, we saw that in the basic counter each FF provides an output waveform that is exactly half the frequency of the waveform at its input. To illustrate, suppose that the clock signal in Figure 7- is 6 khz. Figure 7-2 shows the FF output waveforms. The waveform at output is an 8-kHz square wave, at output it is 4 khz, at output it is 2 khz, and at output it is khz. Notice that the output of flip-flop has a frequency equal to the original clock frequency divided by 6. In general, In any counter, the signal at the output of the last FF (i.e., the MS) will have a frequency equal to the input clock frequency divided by the MO number of the counter. For example, in a MO-6 counter, the output from the last FF will have a frequency of /6 of the input clock frequency. Thus, it can also be called a divide-by-6 counter. Likewise, a MO-8 counter has an output frequency of 8 the input frequency; it is a divide-by-8 counter. LOK FIGURE 7-2 ounter waveforms showing frequency division by 2 for each FF.

SETION 7-2/PROPGTION ELY IN RIPPLE OUNTERS 365 EXMPLE 7-3 The first step involved in building a digital clock is to take the 6-Hz signal and feed it into a Schmitt-trigger, pulse-shaping circuit* to produce a square wave, as illustrated in Figure 7-3. The 6-Hz square wave is then put into a MO-6 counter, which is used to divide the 6-Hz frequency by exactly 6 to produce a -Hz waveform. This -Hz waveform is fed to a series of counters, which then count seconds, minutes, hours, and so on. How many FFs are required for the MO-6 counter? FIGURE 7-3 Example 7-3. 6 Hz Pulse shaper 6 Hz MO-6 counter Hz ounters, displays,etc. Solution There is no integer power of 2 that will equal 6. The closest is 2 6 64. Thus, a counter using six FFs would act as a MO-64 counter. Obviously, this will not satisfy the requirement. It seems that there is no solution using a counter of the type shown in Figure 7-. This is partly true; in Section 7-4, we will see how to modify basic binary counters so that almost any MO number can be obtained and we will not be limited to values of 2 N. REVIEW QUESTIONS. True or false: In an asynchronous counter, all FFs change states at the same time. 2. ssume that the counter in Figure 7- is holding the count. What will be the count after 27 clock pulses? 3. What would be the MO number of the counter if three more FFs were added? 7-2 PROPGTION ELY IN RIPPLE OUNTERS Ripple counters are the simplest type of binary counters because they require the fewest components to produce a given counting operation. They do, however, have one major drawback, which is caused by their basic principle of operation: each FF is triggered by the transition at the output of the preceding FF. ecause of the inherent propagation delay time (t pd ) of each FF, this means that the second FF will not respond until a time t pd after the first FF receives an active clock transition; the third FF will not respond until a time equal to 2 * t pd after that clock transition; and so on. In other words, the propagation delays of the FFs accumulate so that the Nth FF cannot change states until a time equal to N * t pd after the clock transition occurs. This is illustrated in Figure 7-4, where the waveforms for a three-bit ripple counter are shown. The first set of waveforms in Figure 7-4(a) shows a situation where an input pulse occurs every ns (the clock period T ns) and it is assumed that each FF has a propagation delay of 5 ns (t pd 5 ns). Notice *See Section 5-2.

366 HPTER 7/OUNTERS N REGISTERS FIGURE 7-4 Waveforms of a three-bit ripple counter illustrating the effects of FF propagation delays for different input pulse frequencies. Input ns # #2 #3 #4 #5 5 ns ns (a) 5 ns # #2 #3 #4 #5 Input ns 5 ns 5 ns 5 ns (b) The condition does not occur. that the flip-flop output toggles 5 ns after the NGT of each input pulse. Similarly, toggles 5 ns after goes from to, and toggles 5 ns after goes from to. s a result, when the fourth input NGT occurs, the output goes HIGH after a delay of 5 ns. In this situation, the counter does operate properly in the sense that the FFs do eventually get to their correct states, representing the binary count. However, the situation worsens if the input pulses are applied at a much higher frequency. The waveforms in Figure 7-4(b) show what happens if the input pulses occur once every ns. gain, each FF output responds 5 ns after the -to- transition at its input (note the change in the relative time scale). Of particular interest is the situation after the falling edge of the fourth input pulse, where the output does not go HIGH until 5 ns later, which is the same time that the output goes HIGH in response to the fifth input pulse. In other words, the condition, (count of ) never appears because the input frequency is too high. This could cause a serious problem if this condition were supposed to be used to control some other operation in a digital system. Problems such as this can be avoided if the period between

SETION 7-3/SYNHRONOUS (PRLLEL) OUNTERS 367 input pulses is made longer than the total propagation delay of the counter. That is, for proper counter operation we need T clock Ú N * t pd (7-2) where N the number of FFs. Stated in terms of input-clock frequency, the maximum frequency that can be used is given by f max = N * t pd (7-3) For example, suppose that a four-bit ripple counter is constructed using the 74LS2 J-K flip-flop. Table 5-2 shows that the 74LS2 has t PLH 6 ns and t PHL 24 ns as the propagation delays from to Q. To calculate f max,we will assume the worst case ; that is, we will use t pd t PHL 24 ns, so that f max = learly, as the number of FFs in the counter increases, the total propagation delay increases and f max decreases. For example, a ripple counter that uses six 74LS2 FFs will have f max = 4 * 24 ns 6 * 24 ns =.4 MHz = 6.9 MHz Thus, asynchronous counters are not useful at very high frequencies, especially for counters with large numbers of bits. nother problem caused by propagation delays in asynchronous counters occurs when we try to electronically detect (decode) the counter s output states. If you look closely at Figure 7-4(a), for a short period of time (5 ns in our example) right after state, you see that state occurs before. This is obviously not the correct binary counting sequence, and while the human eye is much too slow to see this temporary state, our digital circuits will be fast enough to detect it. These erroneous count patterns can generate what are called glitches in the signals that are produced by digital systems using asynchronous counters. In spite of their simplicity, these problems limit the usefulness of asynchronous counters in digital applications. REVIEW QUESTIONS. Explain why a ripple counter s maximum frequency limitation decreases as more FFs are added to the counter. 2. certain J-K flip-flop has t pd 2 ns. What is the largest MO counter that can be constructed from these FFs and still operate up to MHz? 7-3 SYNHRONOUS (PRLLEL) OUNTERS The problems encountered with ripple counters are caused by the accumulated FF propagation delays; stated another way, the FFs do not all change states simultaneously in synchronism with the input pulses. These limitations can be overcome with the use of synchronous or parallel counters in which all of the FFs are triggered simultaneously (in parallel) by the clock input pulses.

368 HPTER 7/OUNTERS N REGISTERS J J J J LR K LR K LR K LR K Input (a) ount 2 3 4 5 6 7 8 9 2 3 4 5........ etc. (b)... FIGURE 7-5 Synchronous MO-6 counter. Each FF is clocked by the NGT of the clock input signal so that all FF transitions occur at the same time.... ecause the input pulses are applied to all the FFs, some means must be used to control when an FF is to toggle and when it is to remain unaffected by a clock pulse. This is accomplished by using the J and K inputs and is illustrated in Figure 7-5 for a four-bit, MO-6 synchronous counter. If we compare the circuit arrangement for this synchronous counter with its asynchronous counterpart in Figure 7-, we can see the following notable differences: The inputs of all of the FFs are connected together so that the input clock signal is applied to each FF simultaneously. Only flip-flop, the LS, has its J and K inputs permanently at the HIGH level. The J, K inputs of the other FFs are driven by some combination of FF outputs. The synchronous counter requires more circuitry than does the asynchronous counter.

SETION 7-3/SYNHRONOUS (PRLLEL) OUNTERS 369 ircuit Operation For this circuit to count properly, on a given NGT of the clock, only those FFs that are supposed to toggle on that NGT should have J K when that NGT occurs. Let s look at the counting sequence in Figure 7-5(b) to see what this means for each FF. The counting sequence shows that the flip-flop must change states at each NGT. For this reason, its J and K inputs are permanently HIGH so that it will toggle on each NGT of the clock input. The counting sequence shows that flip-flop must change states on each NGT that occurs while. For example, when the count is, the next NGT must toggle to the state; when the count is, the next NGT must toggle to the state; and so on.this operation is accomplished by connecting output to the J and K inputs of flip-flop so that J K only when. The counting sequence shows that flip-flop must change states on each NGT that occurs while. For example, when the count is, the next NGT must toggle to the state; when the count is, the next NGT must toggle to the state; and so on. y connecting the logic signal to FF s J and K inputs, this FF will toggle only when. In a like manner, we can see that flip-flop must toggle on each NGT that occurs while. When the count is, the next NGT must toggle to the state; when the count is, the next NGT must toggle to the state. y connecting the logic signal to FF s J and K inputs, this FF will toggle only when. The basic principle for constructing a synchronous counter can therefore be stated as follows: Each FF should have its J and K inputs connected so that they are HIGH only when the outputs of all lower-order FFs are in the HIGH state. dvantage of Synchronous ounters over synchronous In a parallel counter, all of the FFs will change states simultaneously; that is, they are all synchronized to the NGTs of the input clock pulses. Thus, unlike the asynchronous counters, the propagation delays of the FFs do not add together to produce the overall delay. Instead, the total response time of a synchronous counter like the one in Figure 7-5 is the time it takes one FF to toggle plus the time for the new logic levels to propagate through a single N gate to reach the J, K inputs. That is, for a synchronous counter, total delay FF t pd N gate t pd This total delay is the same no matter how many FFs are in the counter, and it will generally be much lower than with an asynchronous counter with the same number of FFs. Thus, a synchronous counter can operate at a much higher input frequency. Of course, the circuitry of the synchronous counter is more complex than that of the asynchronous counter. ctual Is There are many synchronous I counters in both the TTL and the MOS logic families. Some of the most commonly used devices are: 74LS6/62, 74H6/62: synchronous decade counters 74LS6/63, 74H6/63: synchronous MO-6 counters

37 HPTER 7/OUNTERS N REGISTERS EXMPLE 7-4 (a) etermine f max for the counter of Figure 7-5(a) if t pd for each FF is 5 ns and t pd for each N gate is 2 ns. ompare this value with f max for a MO-6 ripple counter. (b) What must be done to convert this counter to MO-32? (c) etermine f max for the MO-32 parallel counter. Solution (a) The total delay that must be allowed between input clock pulses is equal to FF t pd N gate t pd.thus, T clock Ú 5 + 2 = 7 ns, and so the parallel counter has f max = MO-6 ripple counter uses four FFs with t pd 5 ns. Thus, f max for the ripple counter is f max = 7 ns 4 * 5 ns = 4.3 MHz (parallel counter) = 5 MHz (ripple counter) (b) fifth FF must be added because 2 5 32. The input of this FF is also tied to the input pulses. Its J and K inputs are fed by the output of a four-input N gate whose inputs are,,, and. (c) f max is still determined as in (a) regardless of the number of FFs in the parallel counter. Thus, f max is still 4.3 MHz. REVIEW QUESTIONS. What is the advantage of a synchronous counter over an asynchronous counter? What is the disadvantage? 2. How many logic devices are required for a MO-64 parallel counter? 3. What logic signal drives the J, K inputs of the MS flip-flop for the counter of question 2? 7-4 OUNTERS WITH MO NUMERS < 2 N The basic synchronous counter of Figure 7-5 is limited to MO numbers that are equal to 2 N, where N is the number of FFs. This value is actually the maximum MO number that can be obtained using N flip-flops. The basic counter can be modified to produce MO numbers less than 2 N by allowing the counter to skip states that are normally part of the counting sequence. One of the most common methods for doing this is illustrated in Figure 7-6, where a three-bit counter is shown. isregarding the NN gate for a moment, we can see that the counter is a MO-8 binary counter that will count in sequence from to. However, the presence of the NN gate will alter this sequence as follows:. The NN output is connected to the asynchronous LER inputs of each FF. s long as the NN output is HIGH, it will have no effect on the counter. When it goes LOW, however, it will clear all of the FFs so that the counter immediately goes to the state.

SETION 7-4/OUNTERS WITH MO NUMERS <2 N 37 FIGURE 7-6 MO-6 counter produced by clearing a MO-8 counter when a count of six () occurs. J J J K LR LR K LR K Input pulses 2 3 4 5 6 7 8 9 2 NN output 2. The inputs to the NN gate are the outputs of the and flip-flops, and so the NN output will go LOW whenever.this condition will occur when the counter goes from the state to the state on the NGT of input pulse 6.The LOW at the NN output will immediately (generally within a few nanoseconds) clear the counter to the state. Once the FFs have been cleared, the NN output goes back HIGH because the condition no longer exists. 3. The counting sequence is, therefore, (temporary state needed to clear counter)

372 HPTER 7/OUNTERS N REGISTERS lthough the counter does go to the state, it remains there for only a few nanoseconds before it recycles to. Thus, we can essentially say that this counter counts from (zero) to (five) and then recycles to. It essentially skips and so that it goes through only six different states; thus, it is a MO-6 counter. Notice that the waveform at the output contains a spike or glitch caused by the momentary occurrence of the state before clearing. This glitch is very narrow and so would not produce any visible indication on indicator LEs or numerical displays. It could, however, cause a problem if the output were being used to drive other circuitry outside the counter. It should also be noted that the output has a frequency equal to one-sixth of the input frequency; in other words, this MO-6 counter has divided the input frequency by six. The waveform at is not a symmetrical square wave (5 percent duty cycle) because it is HIGH for only two clock cycles, whereas it is LOW for four cycles. State Transition iagram Figure 7-7(a) is the state transition diagram for the MO-6 counter of Figure 7-6, showing how FFs,, and change states as pulses are applied to the input of flip-flop. Recall that each circle represents one of the possible counter states and that the arrows indicate how one state changes to another in response to an input clock pulse. If we assume a starting count of, the diagram shows that the states of the counter change normally up until the count of. When the next clock pulse occurs, the counter temporarily goes to the count before going to the stable count. The dotted lines indicate the temporary nature of the state. s stated earlier, the duration of this temporary state is so short that for most purposes we can consider that the counter goes directly from to (solid arrow). Note that there is no arrow into the state because the counter can never advance to that state. However, the state can occur on power-up when the FFs come up in random states. If that happens, the condition will produce a LOW at the NN gate output and immediately clear the counter to. Thus, the state is also a temporary condition that ends up at. isplaying ounter States Sometimes during normal operation, and very often during testing, it is necessary to have a visible display of how a counter is changing states in response to the input pulses. We will take a detailed look at several ways of doing this later in the text. For now, Figure 7-7(b) shows one of the simplest methods using individual indicator LEs for each FF output. Each FF output is connected to an INVERTER whose output provides the current path for the LE. For example, when output is HIGH, the INVERTER output goes LOW and the LE turns ON. n LE that is turned on indicates. When output is LOW, the INVERTER output is HIGH and the LE turns OFF. When the LE is turned off, it indicates.

SETION 7-4/OUNTERS WITH MO NUMERS <2 N 373 Temporary state (a) 5 V 33 33 33 LE is on when FF is HIGH. J J J LR K LR K LR K (b) FIGURE 7-7 (a) State transition diagram for the MO-6 counter of Figure 7-6. (b) LEs are often used to display the states of a counter.

374 HPTER 7/OUNTERS N REGISTERS EXMPLE 7-5 (a) What will be the status of the LEs when the counter is holding the count of five? (b) What will the LEs display as the counter is clocked by a -khz input? (c) Will the state be visible on the LEs? Solution (a) ecause 5 2, the 2 and 2 2 LEs will be ON, and the 2 LE will be OFF. (b) t khz, the LEs will be switching ON and OFF so rapidly that they will appear to the human eye to be ON all the time at about half the normal brightness. (c) No; the state will persist for only a few nanoseconds as the counter recycles to. hanging the MO Number The counter of Figures 7-6 and 7-7 is a MO-6 counter because of the choice of inputs to the NN gate. ny desired MO number can be obtained by changing these inputs. For example, using a three-input NN gate with inputs,, and, the counter would function normally until the condition was reached, at which point it would immediately reset to the state. Ignoring the very temporary excursion into the state, the counter would go from through and then recycle back to, resulting in a MO-7 counter (seven states). EXMPLE 7-6 etermine the MO number of the counter in Figure 7-8(a). lso determine the frequency at the output. Solution This is a four-bit counter, which would normally count from through. The NN inputs are,, and, which means that the counter will immediately recycle to when the (decimal 4) count is reached. Thus, the counter actually has 4 stable states through and is therefore a MO-4 counter. ecause the input frequency is 3 khz, the frequency at output will be 3 khz 4 = 2.4 khz General Procedure To construct a counter that starts counting from all s and has a MO number of X:. Find the smallest number of FFs such that 2 N Ú X, and connect them as a counter. If 2 N X, do not do steps 2 and 3. 2. onnect a NN gate to the asynchronous LER inputs of all the FFs. 3. etermine which FFs will be in the HIGH state at a count X; then connect the normal outputs of these FFs to the NN gate inputs.

SETION 7-4/OUNTERS WITH MO NUMERS <2 N 375 J J J J LR K LR K LR K LR K 3 khz (a) J J J J LR K LR K LR K LR K MHz FIGURE 7-8 (a) MO-4 ripple counter; (b) MO- (decade) ripple counter. (b) EXMPLE 7-7 onstruct a MO- counter that will count from (zero) through (decimal 9). Solution 2 3 = 8 and 2 4 = 6; thus, four FFs are required. ecause the counter is to have stable operation up to the count of, it must be reset to zero when the count of is reached. Therefore, FF outputs and must be connected as the NN gate inputs. Figure 7-8(b) shows the arrangement. ecade ounters/ ounters The MO- counter of Example 7-7 is also referred to as a decade counter.in fact, a decade counter is any counter that has distinct states, no matter what

376 HPTER 7/OUNTERS N REGISTERS the sequence. decade counter such as the one in Figure 7-8(b), which counts in sequence from (zero) through (decimal 9), is also commonly called a counter because it uses only the code groups,,...,, and. To reiterate, any MO- counter is a decade counter; and any decade counter that counts in binary from to is a counter. ecade counters, especially the type, find widespread use in applications where pulses or events are to be counted and the results displayed on some type of decimal numerical readout. We shall examine this later in more detail. decade counter is also often used for dividing a pulse frequency exactly by. The input pulses are applied to the paralleled clock inputs, and the output pulses are taken from the output of flip-flop, which has onetenth the frequency of the input signal. EXMPLE 7-8 In Example 7-3, a MO-6 counter was needed to divide the 6-Hz line frequency down to Hz. onstruct an appropriate MO-6 counter. Solution 2 5 = 32 and 2 6 = 64, and so we need six FFs, as shown in Figure 7-9. The counter is to be cleared when it reaches the count of 6 (). Thus, the outputs of flip-flops Q 5, Q 4, Q 3, and Q 2 must be connected to the NN gate. The output of flip-flop Q 5 will have a frequency of Hz. REVIEW QUESTIONS. What FF outputs should be connected to the clearing NN gate to form a MO-3 counter? 2. True or false: ll counters are decade counters. 3. What is the output frequency of a decade counter that is clocked from a 5-kHz signal? Q 4 Q 3 Q 2 Q Q Q 3 Q 2 Q Q Q 2 Q Q Q Q Q Q 5 J Q 4 J Q 3 J Q 2 J Q J Q J LR K LR K LR K LR K LR K LR K 6 Hz Q 2 Q 3 Q 4 Q 5 FIGURE 7-9 MO-6 counter.

SETION 7-5/SYNHRONOUS OWN N UP/OWN OUNTERS 377 7-5 SYNHRONOUS OWN N UP/OWN OUNTERS In Section 7-3, we saw that using the output of lower-order FFs to control the toggling of each FF creates a synchronous up counter. synchronous down counter is constructed in a similar manner except that we use the inverted FF outputs to control the higher-order J, K inputs. omparing the synchronous, MO-6, down counter in Figure 7- with the up counter in Figure 7-5 shows that we need only to substitute the corresponding inverted FF output in place of the,, and outputs. For a down count sequence, the LS FF () still needs to toggle with each NGT of the clock input signal. Flip-flop must change states on the next NGT of the clock when ( = ). Flip-flop changes states when ( = ), and flip-flop changes states when ( = ). This circuit configuration will produce the count sequence: 5, 4,3,2,...,3,2,,,5,4,and so on, as shown in the timing diagram. Figure 7-(a) shows how to form a parallel up/down counter. The control input Up/ own controls whether the normal FF outputs or the inverted FF outputs are fed to the J and K inputs of the successive FFs. When Up/own is held HIGH, N gates and 2 are enabled while N gates 3 and 4 are disabled (note the inverter). This allows the and outputs through gates and 2 to the J and K inputs of FFs and. When Up/own is held LOW, N gates and 2 are disabled while N gates 3 and 4 are enabled. This allows the inverted and outputs through gates 3 and 4 into the J and K inputs of FFs and. The waveforms in Figure 7-(b) illustrate the operation. Notice that for the first five clock pulses, Up/own = and the counter counts up; for the last five pulses, Up/own =, and the counter counts down. J J J J LR K LR K LR K LR K Input Input FIGURE 7- Synchronous, MO-6, down counter and output waveforms.

378 HPTER 7/OUNTERS N REGISTERS Up/own 2 4 3 J J J K K K LR LR LR LOK (a) Up/own LOK ount () Up own FIGURE 7- (a) MO-8 synchronous up/down counter. (b) The counter counts up when the control input Up/own = ; it counts down when the control input Up/own =. (b) The nomenclature used for the control signal (Up/own) was chosen to make it clear how it affects the counter. The count-up operation is active- HIGH; the count-down operation is active-low. EXMPLE 7-9 What problems might be caused if the Up/own signal changes levels on the NGT of the clock? Solution The FFs might operate unpredictably because some of them would have their J and K inputs changing at about the same time that a NGT occurs at their input. However, the effects of the change in the control signal must propagate through two gates before reaching the J, K inputs, so it is more likely that the FFs will respond predictably to the levels that are at J, K prior to the NGT of.

SETION 7-6/PRESETTLE OUNTERS 379 REVIEW QUESTIONS. What is the difference between the counting sequence of an up counter and a down counter? 2. What circuit changes will convert a synchronous, binary up counter into a binary down counter? 7-6 PRESETTLE OUNTERS Many synchronous (parallel) counters that are available as Is are designed to be presettable; in other words, they can be preset to any desired starting count either asynchronously (independent of the clock signal) or synchronously (on the active transition of the clock signal). This presetting operation is also referred to as parallel loading the counter. Figure 7-2 shows the logic circuit for a three-bit presettable parallel up counter. The J, K, and inputs are wired for operation as a parallel up counter. The asynchronous PRESET and LER inputs are wired to perform asynchronous presetting. The counter is loaded with any desired count at any time by doing the following:. pply the desired count to the parallel data inputs, P 2, P, and P. 2. pply a LOW pulse to the PRLLEL LO input, PL. Parallel data inputs P 2 P P PRE Q 2 J PRE Q J PRE Q J LR K LR K LR K Parallel load PL FIGURE 7-2 Synchronous counter with asynchronous parallel load.

38 HPTER 7/OUNTERS N REGISTERS This procedure will perform an asynchronous transfer of the P 2, P, and P levels into flip-flops Q 2, Q, and Q, respectively (Section 5-7).This jam transfer occurs independently of the J, K, and inputs. The effect of the input will be disabled as long as PL is in its active-low state because each FF will have one of its asynchronous inputs activated while PL =. Once PL returns HIGH, the FFs can respond to their inputs and can resume the countingup operation starting from the count that was loaded into the counter. For example, let s say that P 2 =, P =, and P =. While PL is HIGH, these parallel data inputs have no effect. If clock pulses are present, the counter will perform the normal count-up operation. Now let s say that PL is pulsed LOW when the counter is at the count (i.e., Q 2 =, Q =, and Q = ).This LOW at PL will produce LOWs at the LR input of Q and at the PRE inputs of Q 2 and Q so that the counter will go to the count regardless of what is occurring at the input. The count will hold at until PL is deactivated (returned HIGH); at that time the counter will resume counting up at each clock pulse from the count of. This asynchronous presetting is used by several I counters, such as the TTL 74LS9, 74LS9, 74LS92, and 74LS93 and the MOS equivalents, 74H9, 74H9, 74H92, and 74H93. Synchronous Presetting Many I parallel counters use synchronous presetting whereby the counter is preset on the active transition of the same clock signal that is used for counting. The logic level on the parallel load control input determines if the counter is preset with the applied input data at the next active clock transition. Examples of I counters that use synchronous presetting include the TTL 74LS6, 74LS6, 74LS62, and 74LS63 and their MOS equivalents, 74H6, 74H6, 74H62, and 74H63. REVIEW QUESTIONS. What is meant when we say that a counter is presettable? 2. escribe the difference between asynchronous and synchronous presetting. 7-7 I SYNHRONOUS OUNTERS The 74LS6-63/74H6-63 Series Figure 7-3 shows the logic symbol, modulus, and function table for the 74LS6 through 74LS63 series of I counters (and the equivalent MOS counterparts, 74H6 through 74H63). These recycling, four-bit counters have outputs labeled Q, Q, Q, Q, where Q is the LS and Q is the MS. They are clocked by a PGT applied to. Each of the four different part numbers has a different combination of two feature variations. s seen in Figure 7-3(b), two of the counters are MO- counters (74LS6 and 74LS62), while the other two are MO-6 binary counters (74LS6 and 74LS63). The other variation for these parts is in the operation of the clear function [as highlighted in Figure 7-3(c)]. The 74LS6 and 74LS6 each has an asynchronous clear input. This means that as soon as LR goes LOW ( LR is active-low for all four parts), the counter s output will be reset to. On the other hand, the 74LS62 and 74LS63 I counters are synchronously cleared. For these counters to be synchronously cleared, the LR input must be LOW and a PGT must be applied to the clock input. The clear input has priority over all other functions

SETION 7-7/I SYNHRONOUS OUNTERS 38 FIGURE 7-3 74LS6-74LS63 series synchronous counters: (a) logic symbol; (b) modules; (c) function table. ENT ENP LR LO 74LS6-74LS63 (a) RO Q Q Q Q Part Number Modulus 74LS6 74LS6 6 74LS62 74LS63 6 (b) LR LO 74LS6-74LS63 Function Table ENP ENT Function Part Numbers L L H H H H X X L H H H X X X H L X X X X H X L X X X synch. lear Synchr. lear Synchr. Load ount up No change No change 74LS6 & 74LS6 74LS62 & 74LS63 ll ll ll ll (c) for this series of I counters. lear will override all other control inputs, as indicated by the Xs in the Figure 7-3(c) function table. The second priority function available in this series of I counters is the parallel loading of data into the counter s flip-flops.to preset a data value, make the clear input inactive (HIGH), apply the desired four-bit value to the data input pins,,, ( is LS and is MS), apply a LOW to the LO input control, and then clock the chip with a PGT. The load function is therefore synchronous and has priority over counting, so it does not matter what logic levels are applied to ENT or ENP. To count from the preset state it will be necessary to disable the load (with a HIGH) and enable the count function. If the load function is inactive, it does not matter what is applied to the data input pins. To enable counting, the lowest-priority function, both LR and LO control inputs must be inactive. dditionally, there are two active-high count enable controls, ENT and ENP. ENT and ENP are essentially Ned together to control the count function. If either or both of the count enable controls is inactive (LOW), the counter will hold the current state. Therefore, to increment the count with each PGT on, all four of the control inputs must be HIGH. When counting, the decade counters (74LS6 and 74LS62) will automatically recycle to after state (9) and the binary counters (74LS6 and 74LS63) will automatically recycle after (5). This series of I counter chips has one more output pin, RO. The function of this active-high output is to detect (decode) the last or terminal state of the counter. The terminal state for a decade counter is (9), while the terminal state for a MO-6 counter is (5). ENT, the primary count enable input, also controls the operation of RO. ENT must be HIGH for the counter to indicate with the RO output that it has reached its terminal state. You will see that this feature is very useful in connecting two or more counter chips together in a multistage arrangement to create larger counters.

382 HPTER 7/OUNTERS N REGISTERS EXMPLE 7- Refer to Figure 7-4, where a 74H63 has the input signals given in the timing diagram applied. The parallel data inputs are permanently connected as. ssume the counter is initially in the state, and determine the counter output waveforms. Solution Initially (at t ), the counter s FFs are all LOW. Since this is not the terminal state for the counter, output RO will be LOW also.the first PGT on the input occurs at t and, since all control inputs are HIGH, the counter will increment to. The counter continues to count up with each PGT until t 2. The LR input is LOW for t 2. This will synchronously reset the counter to at t 2. fter t 2, the LR input goes inactive (HIGH) so the counter will 74H63 ENT ENP ENT ENP RO RO LR LR LO LO Q Q Q Q Q Q Q Q (a) t t t 2 t 3 t 4 t 5 t 6 t 7 LR LO ENT ENP Q Q Q Q RO FIGURE 7-4 Example 7-. (b)

SETION 7-7/I SYNHRONOUS OUNTERS 383 start counting up again from with each subsequent PGT. The LO input is LOW for t 3. This will synchronously load the applied data value (2) into the counter at t 3. fter t 3, the LO input goes inactive (HIGH), so the counter will continue counting up from with each subsequent PGT until t 4. The counter output does not change at t 4 or t 5, since either ENP or ENT (the count enable inputs) is LOW. This holds the count at (4). t t 6, the counter is enabled again and counts up to (5), its terminal state. s a result, the RO output now goes HIGH. t t 7, another PGT on will make the counter recycle to and RO returns to a LOW output. EXMPLE 7- Refer to Figure 7-5, where a 74H6 has the input signals given in the timing diagram applied. The parallel data inputs are permanently connected as 74H6 ENT ENP ENT ENP RO RO LR LR LO LO Q Q Q Q Q Q Q Q (a) t t t 2 t 3 t 4 t 5 t 6 t 7 t 8 t 9 t LR LO ENT ENP Q Q Q Q RO FIGURE 7-5 Example 7-. (b)

384 HPTER 7/OUNTERS N REGISTERS. ssume the counter is initially in the state, and determine the counter output waveforms. Solution Initially (at t ) the counter s FFs are all LOW. Since this is not the terminal state for the counter, output RO will be LOW also. The first PGT on the input occurs at t and, since all control inputs are HIGH, the counter will increment to. The counter continues to count up with each PGT until t 2. The asynchronous LR input goes LOW at t 2 and will immediately reset the counter to at that point. t t 3, the LR input is still active (LOW), so the PGT of the input will be ignored and the counter will stay at. Later the LR input goes inactive again and the counter will count up to and then to. t t 4, the count enable ENP is LOW, so the count holds at. For subsequent PGTs of the input, the counter is enabled and counts up until t 5. The LO input is LOW for t 5. This will synchronously load the applied data value (7) into the counter at t 5. t t 6, the count enable ENT is LOW, so the count holds at. For the two subsequent PGTs after t 6, the counter will continue counting up since it is re-enabled. t t 7, the counter reaches its terminal state (9) and the RO output now goes HIGH. t t 8, ENP is LOW and the counter stops counting (remaining at ). t t 9, while ENT is LOW, the RO output will be disabled so that it returns to a LOW even though the counter is still at its terminal state (). Recall that only ENT controls the RO output. When ENT returns HIGH during the counter s terminal state, RO goes HIGH again. t t the counter is enabled, and it recycles to and then counts to on the last PGT. The 74LS9-9/74H9-9 Series Figure 7-6 shows the logic symbol, modulus, and function table for the 74LS9 and 74LS9 series of I counters (and the equivalent MOS counterparts, 74H9 and 74H9). These recycling, four-bit counters have outputs labeled Q, Q, Q, Q, where Q is the LS and Q is the MS. They are clocked by a PGT applied to. The only difference between the two part numbers is the counter s modulus. The 74LS9 is a MO- counter and the 74LS9 is a MO-6 binary counter. oth chips are up/down counters and have an asynchronous, active-low load input. This FIGURE 7-6 74LS9-74LS9 series synchronous counters: (a) logic symbol; (b) modulus; (c) function table. 74LS9-74LS9 TEN RO Part Number Modulus 74LS9 74LS9 6 (b) /U LO Max /Min 74LS9-74LS9 Function Table LO TEN /U Function Q Q Q Q L H H H X L L H X L H X X X synch. Load ount up ount down No change (a) (c)

SETION 7-7/I SYNHRONOUS OUNTERS 385 means that as soon as LO goes LOW, the counter will be preset to the parallel data on the,,, ( is LS and is MS) input pins. If the load function is inactive, it does not matter what is applied to the data input pins. The load input has priority over the counting function. To count, the LO control input must be inactive (HIGH) and the count enable control TEN must be LOW. The count direction is controlled by the /U control input. If /U is LOW, the count is incremented with each PGT on, while a HIGH on /U will decrement the count. oth counters automatically recycle in either count direction. The decade counter recycles to after state (9) when counting up or to after state when counting down. The binary counter will recycle to after (5) when counting up or to after state when counting down. These counter chips have two more output pins, MX/MIN and RO. MX/MIN is an active-high output that detects (decodes) the terminal state of the counter. Since they are up/down counters, the terminal state depends on the direction of the count. The terminal state (MIN) for either counter when counting down is (). However when counting up, the terminal state (MX) for a decade counter is (9), while the terminal state for a MO-6 counter is (5). Note that MX/MIN detects only one state in the count sequence it just depends on whether it is counting up or down. The active- LOW RO output also detects the appropriate terminal state for the counter, but it is a bit more complicated. First, it is only enabled when TEN is LOW. dditionally, RO will only be LOW while the input is also LOW. So essentially RO will mimic the waveform only during the terminal state while the counter is enabled. EXMPLE 7-2 Refer to Figure 7-7, where a 74H9 has the input signals given in the timing diagram applied. The parallel data inputs are permanently connected as. ssume the counter is initially in the state, and determine the counter output waveforms. Solution Initially (at t ), the counter s FFs are all LOW. Since the counter is enabled (TEN = ) and the count direction control /U =, the counter will start counting up on the first PGT applied to at t and continues to count up with each PGT until t 2, where the count has reached. The asynchronous LO input goes LOW at t 2 and will immediately load into the counter at that point. t t 3, the LO input is still active (LOW), so the PGT of the input will be ignored and the counter will stay at. Later the LO input goes HIGH again and the counter will count up to at the next PGT. t t 4, the counter increments to, which is the terminal state for a up counter and the MX/MIN output goes HIGH. uring t 5, the counter is at its terminal state and the input is LOW, so RO goes LOW. For subsequent PGTs of the input, the counter recycles to and continues to count up until t 6. Just prior to t 6, the /U control changes to a HIGH. This will make the counter count down at t 6 and again at t 7, where it will be at state, which now is the terminal state since we are counting down, and MX/MIN will output a HIGH. uring t 8, when the input goes LOW, the RO output again will be LOW. t t 9, the counter is disabled with TEN = and the counter holds at. For the subsequent pulses, the counter continues to count down.

386 HPTER 7/OUNTERS N REGISTERS 74H9 TEN /U LO TEN /U LO (a) RO Max /Min Q Q Q Q t t t 2 t 3 t 4 t 5 t 6 t 7 t 8 t 9 /U LO TEN Q Q Q Q MX/MIN RO FIGURE 7-7 Example 7-2. (b) EXMPLE 7-3 ompare the operation of two counters, one with synchronous load and the other with asynchronous load. Refer to Figure 7-8(a), in which a 74LS63 and a 74LS9 have been wired in a similar fashion to count up in binary. oth chips are driven by the same clock signal and have their Q and Q outputs NNed together to control the respective LO input control. ssume that both counters are initially in the state. (a) etermine the output waveform for each counter. (b) What is the recycling count sequence and modulus for each counter? (c) Why do they have different count sequences?

SETION 7-7/I SYNHRONOUS OUNTERS 387 74LS63 74LS9 ENT ENP RO TEN RO S-L LR LO Q Q Q Q S3 S2 S S T-L /U LO Max /Min Q Q Q Q T3 T2 T T (a) S3 S2 S S S-L T3 T2 T T T-L FIGURE 7-8 Example 7-3. (b) Solution (a) Starting at state, each counter will count up until it reaches state (2) as shown in Figure 7-8(b). The output of each NN gate will apply a LOW to the respective LO input at that time. The 74LS63 has a synchronous LO and will wait until the next PGT on to load the data

388 HPTER 7/OUNTERS N REGISTERS input into the counter. The 74LS9 has an asynchronous LO and will immediately load the data input into the counter. This will make the state a temporary or transient state for the 74LS9. The transient state will produce some spikes or glitches for some of the counter s outputs because of their rapid switching back and forth. (b) The 74LS63 circuit has a recycling count sequence of through and is a MO-2 counter. The 74LS9 circuit has a recycling count sequence of through and is a MO- counter. Transient states are not included in determining the modulus for a counter. (c) The counter circuits have different count sequences because one has a synchronous load and the other has an asynchronous load. Multistage rrangement Many standard I counters have been designed to make it easy to connect multiple chips together to create circuits with a higher counting range. ll of the counter chips presented in this section can be simply connected in a multistage or cascading arrangement. In Figure 7-9, two 74LS63s are connected in a two-stage counter arrangement that produces a recycling, binary sequence from to 255 for a maximum modulus of 256. pplying a LOW to the LR input will synchronously clear both counter stages, and applying a LOW to L will synchronously preset the eight-bit counter to the binary value on inputs 7, 6, 5, 4, 3, 2,, ( LS). The block on the left (stage ) is the low-order stage and provides the least-significant counter outputs Q3, Q2, Q, Q (with Q LS). Stage 2 on the right provides the most-significant counter outputs Q7, Q6, Q5, Q4 (with Q7 MS). EN, the enable for the eight-bit counter, is connected to the ENT input on stage. Note that we must use the ENT input and not ENP, since only ENT controls the RO output. Using ENT and RO makes cascading very easy. oth counter blocks are clocked together synchronously, but the block on the right (stage 2) is disabled until the least-significant output nibble has reached its terminal state, which will be indicated by the T output. When Q3, Q2, Q, Q reaches and if EN is HIGH, then T will output a HIGH. This will allow both counter stages to count up one with the next PGT on the clock. Stage 74LS63 74LS63 EN T ENT RO ENP ENT ENP RO T2 To higher-order counter stages LR L LR LO leastsignificant nibble LR LO 3 2 Q Q Q Q Q3 Q2 Q Q (LS) 7 6 5 4 Q Q Q Q Q7 Q6 Q5 Q4 stage stage 2 FIGURE 7-9 Two 74LS63s connected in a two-stage arrangement to extend the maximum counting range. To higher-order counter stages