Cascaded Counters. Page 1 BYU



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

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

Asynchronous Counters. Asynchronous Counters

Module 3: Floyd, Digital Fundamental

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

DIGITAL ELECTRONICS. Counters. By: Electrical Engineering Department

Digital Logic Design Sequential circuits

Chapter 8. Sequential Circuits for Registers and Counters

ASYNCHRONOUS COUNTERS

Counters and Decoders

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

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

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

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

Counters & Shift Registers Chapter 8 of R.P Jain

Memory Elements. Combinational logic cannot remember

A New Paradigm for Synchronous State Machine Design in Verilog

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

Registers & Counters

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

Combinational Logic Design Process

Master/Slave Flip Flops

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

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

A Lesson on Digital Clocks, One Shots and Counters

A Lesson on Digital Clocks, One Shots and Counters

NTE2053 Integrated Circuit 8 Bit MPU Compatible A/D Converter

Chapter 9 Latches, Flip-Flops, and Timers

Digital Fundamentals. Lab 8 Asynchronous Counter Applications

EC313 - VHDL State Machine Example

EXPERIMENT 8. Flip-Flops and Sequential Circuits

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

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

Flip-Flops and Sequential Circuit Design

CHAPTER 11: Flip Flops

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

Lecture-3 MEMORY: Development of Memory:

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

Counters. Present State Next State A B A B

Lecture 8: Synchronous Digital Systems

DM74LS169A Synchronous 4-Bit Up/Down Binary Counter

CHAPTER IX REGISTER BLOCKS COUNTERS, SHIFT, AND ROTATE REGISTERS

PROGETTO DI SISTEMI ELETTRONICI DIGITALI. Digital Systems Design. Digital Circuits Advanced Topics

Introduction to CMOS VLSI Design (E158) Lecture 8: Clocking of VLSI Systems

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

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

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

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

Digital Fundamentals

PROGETTO DI SISTEMI ELETTRONICI DIGITALI. Digital Systems Design. Digital Circuits Advanced Topics

Systems I: Computer Organization and Architecture

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

DM54161 DM74161 DM74163 Synchronous 4-Bit Counters

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

Operating Manual Ver.1.1

Lecture 7: Clocking of VLSI Systems

Lesson 12 Sequential Circuits: Flip-Flops

Finite State Machine Design and VHDL Coding Techniques

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

Manchester Encoder-Decoder for Xilinx CPLDs

Modeling Registers and Counters


Lab 11 Digital Dice. Figure Digital Dice Circuit on NI ELVIS II Workstation

74LS193 Synchronous 4-Bit Binary Counter with Dual Clock

Fig1-1 2-bit asynchronous counter

More Verilog. 8-bit Register with Synchronous Reset. Shift Register Example. N-bit Register with Asynchronous Reset.

Timing Methodologies (cont d) Registers. Typical timing specifications. Synchronous System Model. Short Paths. System Clock Frequency

Digital Controller for Pedestrian Crossing and Traffic Lights

Sequential Logic: Clocks, Registers, etc.

Latch Timing Parameters. Flip-flop Timing Parameters. Typical Clock System. Clocking Overhead

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

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

BINARY CODED DECIMAL: B.C.D.

CpE358/CS381. Switching Theory and Logical Design. Class 10

High-Stability Time Adjustment with Real-Time Clock Module

CS311 Lecture: Sequential Circuits

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

Sequential Logic Design Principles.Latches and Flip-Flops

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

Obsolete Product(s) - Obsolete Product(s)

COMBINATIONAL and SEQUENTIAL LOGIC CIRCUITS Hardware implementation and software design

Modeling Latches and Flip-flops

Chapter 4 Register Transfer and Microoperations. Section 4.1 Register Transfer Language

Lab 1: Study of Gates & Flip-flops

DM74LS193 Synchronous 4-Bit Binary Counter with Dual Clock

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

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

6-BIT UNIVERSAL UP/DOWN COUNTER

ECE380 Digital Logic

The components. E3: Digital electronics. Goals:

(1) /30 (2) /30 (3) /40 TOTAL /100

54191 DM54191 DM74191 Synchronous Up Down 4-Bit Binary Counter with Mode Control

Traffic Light Controller. Digital Systems Design. Dr. Ted Shaneyfelt

Design Verification & Testing Design for Testability and Scan

Engr354: Digital Logic Circuits

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

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

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

Transcription:

Cascaded Counters Page 1

Mod-N Counters Generally we are interested in counters that count up to specific count values Not just powers of 2 A mod-n counter has N states Counts from 0 to N-1 then rolls over Requires log 2 N flip flops For example A 4-bit binary counter is a mod-16 counter A counter that counts from 0-9 is a mod-10 counter Page 2

A Mod-4 Counter A.K.A. 2-bit counter CLR INC Q1 Q0 N1 N0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 1 0 1 0 0 0 1 1 1 1 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 0 1 1 0 1 1 1 0 0 1 - - - 0 0 CLR INC CLR CLR INC 11 00 CLR INC CLR INC CLR INC 01 CLR INC 10 CLR INC CLR INC Page 3

A Mod-4 Counter With Rollover Signal CLR INC Q1 Q0 N1 N0 RO 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 1 0 1 0 0 0 0 1 1 1 1 0 0 1 0 0 0 1 0 0 1 0 1 1 0 0 0 1 1 0 1 1 0 0 1 1 1 0 0 1 1 - - - 0 0 0 Mealy output CLR INC / RO CLR INC 11 CLR 00 CLR INC CLR INC CLR INC 01 The ROLL signal is used to tell other circuitry that the counter is rolling over to all 0 s. CLR INC 10 CLR INC CLR INC Page 4

Cascaded Counters Larger counters can be built by combining smaller counters together The rollover signal is used to communicate when the upper counters should roll over Two types of counters Asynchronous Synchronous Page 5

Cascaded Asynchronous Counter digit1 digit0 Sequence should be: 00-01-02-03-10-11-12- But we get: 00-01-02-13-10-11-12- roll1 1 2 Mod-4 Counter 1 roll0 2 Mod-4 Counter As a general rule. DO NOT tie the clock inputs on modules to anything but the clock! digit1 0 1 digit0 2 3 0 1 2 roll0 / 1 Page 6

Cascaded Asynchronous Counter digit1 digit0 1 2 2 roll1 Mod-4 Counter 1 roll0 Mod-4 Counter digit1 rements too early digit0 roll0 / 1 digit1 Page 7

Cascaded Asynchronous Counter The more stages we add to the counter, the bigger the discrepancy between asynchronous counters and what we expect Stage 1 Stage 2 Stage 3 Expected Async Expected Async Page 8

digit1 digit0 1 2 2 It is possible to modify the circuit to get the correct count sequence, but the roll signal must be glitch free! roll1 Mod4 Counter 1 roll0 Mod4 Counter The transition from the value 1 to 2 (01 2 to 10 2 ) makes it difficult, if not impossible to eliminate glitches. digit1 0 1 digit0 2 3 0 2 1 2 Possible hazard roll0 / 1 Page 9

Ripple Counters When you tie a rollover-like signal to a clock on the next higher digit ripple counter A ripple counter is an asynchronous counter Transitions are not all synchronized to the clock Different flip flops change at different times Similar to gated clocks (seen earlier) Asynchronous circuits are an advanced topic Page 10

Another Common Ripple Counter Counts in normal binary: Q3 Q2 Q1 Q0 0000 0001 0010 0011 0100 0101 0110 0111 1000 1 T Q Q 1 T Q Q 1 T Q Q 1 T Q Q CLK What s wrong with this design? Page 11

Timing Diagram Q0 Q1 Q2 Q0 changes in response to clock edge Only after Q0 changes does Q1 s FF get a clock Only after that does Q2 s FF get a clock Logic depending on Q3 has very little time to react before next clock edge Q3 Net effect is that all the FF s change at different times! Page 12

Asynchronous and Ripple Counters Because asynchronous and ripple counters are difficult to use correctly, they are avoided Do not use them in your designs! Violates globally synchronous design priple Always use synchronous counters Page 13

Synchronous Counters In a synchronous counter, all flip flops are clocked by the same clock signal They all change at the same time Synchronous counters can be cascaded to create larger counters that are also globally synchronous Page 14

A Mod-4 Counter CLR INCQ1 Q0 N1 N0 RO 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 1 0 1 0 0 0 0 1 1 1 1 0 0 1 0 0 0 1 0 0 1 0 1 1 0 0 0 1 1 0 1 1 0 0 1 1 1 0 0 1 1 - - - 0 0 0 IFL D Q D Q Count Value Terminal Count Roll Over Page 15

A Mod-4 Counter CLR INCQ1 Q0 N1 N0 RO 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 1 0 1 0 0 0 0 1 1 1 1 0 0 1 0 0 0 1 0 0 1 0 1 1 0 0 0 1 1 0 1 1 0 0 1 1 1 0 0 1 1 - - - 0 0 0 IFL D Q D Q Count Value Terminal Count We could make a mod-4 counter from the block shown in red. Roll Over Page 16

Cascaded Counters digit0[1:0] digit1[1:0] digit2[1:0] CV CV CV Page 17

Cascaded Counters digit0[1:0] digit1[1:0] digit2[1:0] CV CV CV Count Value Terminal Count Rollover Page 18

Cascaded Counters digit0[1:0] digit1[1:0] digit2[1:0] CV CV CV Assume that the second timer is already at the terminal count. Page 19

Cascaded Counters digit0[1:0] digit1[1:0] digit2[1:0] CV CV CV Page 20

Cascaded Counters digit0[1:0] digit1[1:0] digit2[1:0] CV CV CV Page 21

Cascaded Counters digit0[1:0] digit1[1:0] digit2[1:0] CV CV CV Page 22

Cascaded Counters digit0[1:0] digit1[1:0] digit2[1:0] CV CV CV Page 23

Cascaded Counters digit0[1:0] digit1[1:0] digit2[1:0] CV CV CV Page 24

Cascaded Counters digit0[1:0] digit1[1:0] digit2[1:0] CV CV CV It looks like the signal ripples from counter to counter. How is this different from the ripple counter examples? Page 25

Cascaded Synchronous Counter digit0 10 11 00 roll digit1 00 01 Page 26

Cascaded Synchronous Counter Notice that all signals are synchronized with the system clock roll0 roll1 Signals: digit0 digit1 digit2 Page 27

A Mod-4 Counter With consolidated rollover logic Count Value IFL D Q Terminal Count D Q A good mod-4 counter ludes the logic within the red block. Roll Over Page 28

A Mod-4 Counter dout roll Page 29

Cascading two Mod-4 Counters Count Sequence: digit1 digit0 00 01 02 03 10 11 12 13 20 21 22 23 30 31 32 33 00 roll1 roll Increment higher digit s counter when lower digit s counter is rolling over digit1 2 dout roll0 roll digit0 2 dout Page 30

Three-digit Mod-4 Counter Can combine any counters that have a rollover signal to make larger counters Combine two 16-bit counters to make a 32-bit counter Combine three mod-4 counters to make a three-digit mod-4 counter digit2 digit1 digit0 2 2 2 roll1 roll dout roll1 roll dout roll0 roll dout Page 31

BCD Counter Combine to create non-binary counters BCD counter digit2 digit1 digit0 4 4 4 roll1 dout MOD10 roll roll1 dout MOD10 roll roll0 dout MOD10 roll Page 32

Hybrid Counters Can combine different kinds of mod counters Combine an 8-bit counter with a 16-bit counter to create a 24-bit counter Combine mod-24 and mod-60 counters to create a digital H:M:S clock Hours Minutes Seconds 5 6 6 day dout MOD24 roll hour dout MOD60 roll min dout MOD60 roll sec Page 33

D Flip Flop with Asynchronous Clear and Clock Enable Clock Enable (a.k.a. Load) Clear (a.k.a. Reset) Page 34

Mod-4 Counter D0 CLK CE CE CEO D1 Page 35

Cascaded Synchronous Counter Digit0 Digit1 CEO CLK Reset Digit0 CEO Digit1 Page 36

Library Counters Component libraries often have several cascadable counters available Can be cascaded to form desired width Xilinx Library Counters Page 37

Summary Mod-N counters are counters that count from 0 to N-1 then roll over Adding rollover logic to counters allows us to cascade counters We can build large counters from smaller ones We can easily build non-binary counters BCD counter HMS clock counter Always use synchronous counters instead of asynchronous counters Page 38