SYNCHRONOUS COUNTERS

Similar documents
Counters and Decoders

DIGITAL ELECTRONICS. Counters. By: Electrical Engineering Department

Module 3: Floyd, Digital Fundamental

To design digital counter circuits using JK-Flip-Flop. To implement counter using 74LS193 IC.

DIGITAL COUNTERS. Q B Q A = 00 initially. Q B Q A = 01 after the first clock pulse.

Lecture 8: Synchronous Digital Systems

Asynchronous Counters. Asynchronous Counters

Counters & Shift Registers Chapter 8 of R.P Jain

Digital Logic Design Sequential circuits

Design Example: Counters. Design Example: Counters. 3-Bit Binary Counter. 3-Bit Binary Counter. Other useful counters:

Experiment # 9. Clock generator circuits & Counters. Eng. Waleed Y. Mousa

ETEC 2301 Programmable Logic Devices. Chapter 10 Counters. Shawnee State University Department of Industrial and Engineering Technologies

Asynchronous counters, except for the first block, work independently from a system clock.

WEEK 8.1 Registers and Counters. ECE124 Digital Circuits and Systems Page 1

ASYNCHRONOUS COUNTERS

DIGITAL TECHNICS II. Dr. Bálint Pődör. Óbuda University, Microelectronics and Technology Institute. 2nd (Spring) term 2012/2013

Contents COUNTER. Unit III- Counters

Cascaded Counters. Page 1 BYU

CHAPTER 11 LATCHES AND FLIP-FLOPS

Theory of Logic Circuits. Laboratory manual. Exercise 3

Digital Systems Based on Principles and Applications of Electrical Engineering/Rizzoni (McGraw Hill

Systems I: Computer Organization and Architecture

Digital Electronics Detailed Outline

Counters are sequential circuits which "count" through a specific state sequence.

Take-Home Exercise. z y x. Erik Jonsson School of Engineering and Computer Science. The University of Texas at Dallas

Upon completion of unit 1.1, students will be able to

Flip-Flops and Sequential Circuit Design. ECE 152A Winter 2012

Flip-Flops and Sequential Circuit Design

Lesson 12 Sequential Circuits: Flip-Flops

BINARY CODED DECIMAL: B.C.D.

Digital Logic Design. Basics Combinational Circuits Sequential Circuits. Pu-Jen Cheng

Chapter 8. Sequential Circuits for Registers and Counters

Memory Elements. Combinational logic cannot remember

Wiki Lab Book. This week is practice for wiki usage during the project.

Design: a mod-8 Counter

Chapter 7. Registers & Register Transfers. J.J. Shann. J. J. Shann

ENEE 244 (01**). Spring Homework 5. Due back in class on Friday, April 28.

Flip-Flops, Registers, Counters, and a Simple Processor

Modeling Sequential Elements with Verilog. Prof. Chien-Nan Liu TEL: ext: Sequential Circuit

Combinational Logic Design Process

Counters. Present State Next State A B A B

Engr354: Digital Logic Circuits

CHAPTER IX REGISTER BLOCKS COUNTERS, SHIFT, AND ROTATE REGISTERS

Finite State Machine. RTL Hardware Design by P. Chu. Chapter 10 1

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

COMBINATIONAL and SEQUENTIAL LOGIC CIRCUITS Hardware implementation and software design

CHAPTER 11: Flip Flops

7. Latches and Flip-Flops

Digital Fundamentals. Lab 8 Asynchronous Counter Applications

CHAPTER 3 Boolean Algebra and Digital Logic

Having read this workbook you should be able to: recognise the arrangement of NAND gates used to form an S-R flip-flop.

IE1204 Digital Design F12: Asynchronous Sequential Circuits (Part 1)

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

DIGITAL TECHNICS II. Dr. Bálint Pődör. Óbuda University, Microelectronics and Technology Institute

CS311 Lecture: Sequential Circuits

ECE380 Digital Logic

Registers & Counters

Lecture-3 MEMORY: Development of Memory:

DM74LS169A Synchronous 4-Bit Up/Down Binary Counter

Sequential Logic Design Principles.Latches and Flip-Flops

DIGITAL TECHNICS II. Dr. Bálint Pődör. Óbuda University, Microelectronics and Technology Institute 5. LECTURE: REGISTERS AND RELATED

SEQUENTIAL CIRCUITS. Block diagram. Flip Flop. S-R Flip Flop. Block Diagram. Circuit Diagram

DATA SHEET. HEF40193B MSI 4-bit up/down binary counter. For a complete data sheet, please also download: INTEGRATED CIRCUITS

Sequential Logic: Clocks, Registers, etc.

So far we have investigated combinational logic for which the output of the logic devices/circuits depends only on the present state of the inputs.

2 : BISTABLES. In this Chapter, you will find out about bistables which are the fundamental building blocks of electronic counting circuits.

Digital Controller for Pedestrian Crossing and Traffic Lights

DM54161 DM74161 DM74163 Synchronous 4-Bit Counters

Master/Slave Flip Flops

EXPERIMENT 8. Flip-Flops and Sequential Circuits

1.1 The 7493 consists of 4 flip-flops with J-K inputs unconnected. In a TTL chip, unconnected inputs


Fig1-1 2-bit asynchronous counter

Lecture 12: More on Registers, Multiplexers, Decoders, Comparators and Wot- Nots

Napier University. School of Engineering. Electronic Engineering A Module: SE42205 Digital Design

Copyright Peter R. Rony All rights reserved.

Chapter 9 Latches, Flip-Flops, and Timers

LAB #4 Sequential Logic, Latches, Flip-Flops, Shift Registers, and Counters

Latches, the D Flip-Flop & Counter Design. ECE 152A Winter 2012

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

Operating Manual Ver.1.1

Lab 1: Study of Gates & Flip-flops

Modeling Latches and Flip-flops

Decimal Number (base 10) Binary Number (base 2)

Digital Fundamentals

Chapter 5. Sequential Logic

DEPARTMENT OF INFORMATION TECHNLOGY

Modeling Registers and Counters

Sequential Logic. (Materials taken from: Principles of Computer Hardware by Alan Clements )

The enable pin needs to be high for data to be fed to the outputs Q and Q bar.

CSE140: Components and Design Techniques for Digital Systems

earlier in the semester: The Full adder above adds two bits and the output is at the end. So if we do this eight times, we would have an 8-bit adder.

SN54/74LS192 SN54/74LS193

The components. E3: Digital electronics. Goals:

74AC191 Up/Down Counter with Preset and Ripple Clock

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

54LS169 DM54LS169A DM74LS169A Synchronous 4-Bit Up Down Binary Counter

L4: Sequential Building Blocks (Flip-flops, Latches and Registers)

Digital Electronics Part I Combinational and Sequential Logic. Dr. I. J. Wassell

Transcription:

SYNCHRONOUS COUNTERS Synchronous digital counters have a common clock signal that controls all flip-flop stages. Since a common clock controls all flip-flops simultaneously, there are no cumulative delays that result when a clock signal must ripple through the stages, as in the case of asynchronous counters. Synchronous counters can count up and down, and can be designed to produce special purpose count sequences of nonconsecutive numbers. Synchronous Counter Analysis Synchronous counters can be analyzed by using a procedure similar to the analysis of asynchronous counters to classify fully or define the counter operation. Analyze a synchronous counter circuit by proceeding through the following steps: 1. Verify that the counter system clock is common to all flip-flop stages and that the circuit is in fact a synchronous counter. 2. Determine the number of stages of the counter by counting the flip-flops or outputs. 3. Determine the type of flip-flops and the input logic function for each stage. For reference, recall the present state-present input-next state table for each flip-flop. 4. Construct a present input-present state-next state table for the counter to determine the inputs to the flip-flops and the resulting outputs. 5. Analyze the counter using the present input-present state-next state table to determine the complete count sequence. Continue the analysis until the count sequence begins to repeat. 6. Determine the modulus of the counter. 7. Construct a state transition diagram to describe the counter operation. 8. Graph the output waveforms produced by the counter. The key to the synchronous counter analysis is the present state-present inputnext state table that serves as a truth table description of the counter operation as it progresses with each clock pulse. To complete this table properly, we need to define correctly the flip-flops of each stage by their own present input-present state-next state table. EXAMPLE (12): Synchronous Counter Analysis Problem: Analyze the counter circuit shown in Figure (16). Solution: The circuit in Figure (16) is a three-stage synchronous counter since a common clock signal controls all three J-K flip-flop stages of the counter. The J-K flip-flop operation is defined in Table (l). The present input-present state-next table describing the counter operation is constructed with the initial present state of the flip-flops assumed to be a logic LOW. The J and K inputs can be specified according to their logic equations: Present states: Q C, Q B, Q A = 0, 0, 0. 1

Present inputs: J C = K C = Q A Q B. J B = K B = Q A. J A = K A = l. Figure (16): Example (12) Synchronous Counter. Table (1): J-K Flip-Flop Operation. Present Input Present State Next State J K Q N Q N+1 0 0 0 0 Hold 0 0 1 1 0 1 0 0 Reset (Clear) 0 1 1 0 1 0 0 1 Set 1 0 1 1 1 1 0 1 Toggle 1 1 1 0 The first entries in the present input-present state-next state table are shown in Table (2). The next output state is determined by the present inputs and present state of each flip-flop. Given the initial input conditions-the Q A output will toggle and the Q B and Q c outputs will remain unchanged. The resulting 0, 0, 1 output state is recorded in the table as the next state. Table (2): Example (12) Counter Analysis. Present State Present Input Next State Q C Q B Q A J C K C J B K B J A K A Q C Q B Q A 0 0 0 0 0 0 0 1 1 0 0 1 The analysis continues for all possible count states that can be generated 3 by a 3-bit counter. The next count state is determined by each present state 1 and the present inputs. The analysis of each present state and the resulting next state is shown in Table (3). The counter sequence resulting from the analysis is defined in the state transition diagram shown in Figure (17), and the waveforms resulting from this 2

circuit are shown in Figure (18). Each output changes on the positive edge of the input clock. Note that the glitches occurring with the asynchronous counter do not occur with the synchronous counter. Table (3): Example (12) Counter Analysis. Present Input-Present State-Next State Table Completed Present State Present Input Next State Q C Q B Q A J C K C J B K B J A K A Q C Q B Q A 0 0 0 0 0 0 0 1 1 0 0 1 0 0 1 0 0 1 1 1 1 0 1 0 0 1 0 0 0 0 0 1 1 0 1 1 0 1 1 1 1 1 1 1 1 1 0 0 1 0 0 0 0 0 0 1 1 1 0 1 1 0 1 0 0 1 1 1 1 1 1 0 1 1 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 The counter classification is summarized as follows: MOD 8. Divide by 8. Three-bit. Synchronous. Binary up counter. Figure (17): Example (12) State Transition Diagram. Figure (18): Example (12) Output Waveforms. 3

Synchronous counters can produce a count sequence that is not in counting order. Digital security locks might need a counter that generates a random sequence of numbers to serve as a password that must be matched by an appropriate input. Other applications that can use a non-serial count feature are ones where the counter output is decoded to enable certain circuits within a digital system. An example of such a counter is featured in Example (13). EXAMPLE (13): Synchronous Counter Analysis Problem: Determine the count sequence of the circuit shown in Figure (19). Figure (19): Example (13) Synchronous Counter Analysis. Solution: Analyze the counter by completing a present input-present state-next state table to determine the operation of the counter for all possible output states. The counter is a 3-bit counter. All 2 3 count states must be analyzed in the table. Therefore, set up the present states on the table in counting order, from 0 0 0 to 1 1 1, and determine their next state as a result of the inputs to each flip-flop. Present inputs: J A = K A = Q C. J B = K B = Q A. J C = K C = Q B. Complete the analysis by graphing the state transition diagram. The present input-present state-next state table is shown in Table (4). The state transition diagram is shown in Figure (20). From the state transition shown in Figure (20), it can be seen that this is a MOD-3 counter that has a lockout loop. A lockout loop, usually an undesirable situation for most applications, is a repetitive count sequence that is not part of the intended modulus of the counter. In this example the lockout loop can cause the counter to remain in the 1, 0, 0 state forever once it gets into that state. If this state is not desirable in a digital system, the counter should be redesigned to be self-starting so that all possible states lead to the count sequence. 4

Table (4): Example (13) Counter Analysis. Present Input-Present State-Next State Table Completed Present State Present Input Next State Q C Q B Q A J C K C J B K B J A K A Q C Q B Q A 0 0 0 0 0 0 0 1 1 0 0 1 0 0 1 0 0 1 1 1 1 0 1 0 0 1 0 1 1 0 0 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 0 0 1 0 0 0 0 0 0 0 0 1 0 0 1 0 1 0 0 1 1 0 0 1 1 1 1 1 0 1 1 0 0 0 0 0 1 0 1 1 1 1 1 1 1 0 0 0 0 1 Figure (20): Example (13) State Transition Diagram. Synchronous Counter Design Synchronous counter design follows a systematic procedure to specify the count sequence required and to determine the input logic functions to obtain the desired count sequence. The flip-flop excitation table describes the input conditions that produce the output state from each individual J-K flip-flop. The excitation table for J-K flip-flops is shown in Table (5). 5

Present State Q N Table (5): J-K Excitation Table. Next State Inputs Q N J K Condition 0 0 0 x No Change, Reset 0 1 1 x Toggle, Set 1 0 x 1 Toggle, Reset 1 1 x 0 No Change, Set With synchronous counters, the next output state from each flip-flop is determined by the present state and the present inputs applied to that stage. The J-K excitation table forms the basis of synchronous counter design. An excitation table for the counter is constructed by specifying the present state and next state for each flipflop in the order of the count sequence. For each transition, the necessary J and K inputs to produce the required sequence are listed. A logic function for each J and K input is then derived from counter excitation table. Example (14) illustrates a synchronous counter design. EXAMPLE (14): Synchronous Counter Design Problem: Design a MOD-5, 3-bit synchronous counter to count in the following sequence: 2, 3, 5, 1, 7. The counter must be self-starting with the count states of 0, 4, and 6 leading directly to 2. Solution: Follow these procedures: 1. Create a state transition diagram. 2. Create a counter excitation table by listing the present state and next state sequence. 3. Expand the table by adding the J and K input states for each flip- 4. Determine the logic functions for the J and K inputs as a function of the present states. 5. Analyze the counter to verify the design. 6. Construct and test the counter. The state transition diagram for the counter is shown in Figure (21). Figure (21): Example (14) State Transition Diagram. 6

The present state-next state table is constructed, as shown in Table (6). The present state-next state table is expanded by adding the required J and K input to obtain the desired state transitions on each clock pulse. The expanded table is the counter excitation table, as shown in Table (7). To determine the logic function required at each J and K input K-maps can be used to simplify the logic equations as functions of the present states of Q C Q B and Q A Note that the present states listed in the excitation table below. Table (6): Present State-Next State Table for Example (14). Present State Next State Q C Q B Q A Q C Q B Q A 0 0 0 0 1 0 1 0 0 0 1 0 1 1 0 0 1 0 0 1 0 0 1 1 0 1 1 1 0 1 1 0 1 0 0 1 0 0 1 1 1 1 1 1 1 0 1 0 Table (7): Counter Excitation Table for Example (14). Present State Next State Present Input Q C Q B Q A Q C Q B Q A J C K C J B K B J A K A 0 0 0 0 1 0 0 X 1 X 0 X 1 0 0 0 1 0 X 1 1 X 0 X 1 1 0 0 1 0 X 1 X 0 0 X 0 1 0 0 1 1 0 X X 0 1 X 0 1 1 1 0 1 1 X X 1 X 0 1 0 1 0 0 1 X 1 0 X X 0 0 0 1 1 1 1 1 X 1 X X 0 1 1 1 0 1 0 X 1 X 0 X 1 Table (7), do not follow counting order, so be careful when filling in the K- maps. The K-maps and resulting logic functions for the J and K inputs are shown in Figure (22). The resulting circuit to produce the required count sequence is shown in Figure (23). The counter design should be analyzed to verify if it is correct, using the steps followed in Example (13). Finally, the counter circuit should be built and tested in the laboratory. The synchronous counter design in Example (14) can be built with fewer additional logic gates required for the J and K inputs if the design requirements are slightly modified. 7

Figure (22): Example (14): (a) J C and K C Inputs; (b) J B and K B Inputs; (c) J A and K A Inputs. 8

Figure (23): Example (14) Synchronous Counter. Synchronous Counter Design Modification H.W.: Design a MOD-5, 3-bit synchronous counter to count in the following sequence: 2, 3, 5, 1, 7. To modify the design and minimize the additional gates required for the J and K inputs, route the unused states to their next natural count state. In other words, route 0 to 1, 4 to 5, and 6 to 7. Section Self-Test 1. A synchronous counter has a common clock input to all flip-flop stages. 2. A synchronous counter of n flip-flop stages always has a modulus of 2 n. 3. A synchronous counter must count binary numbers in sequence, either up or down. ANSWERS: (Not necessarily in the order of the questions). True. False. False. 9