Counters. Present State Next State A B A B 0 0 0 1 0 1 1 0 1 0 1 1 1 1 0 0



Similar documents
Module 3: Floyd, Digital Fundamental

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

Contents COUNTER. Unit III- Counters

Counters & Shift Registers Chapter 8 of R.P Jain

Chapter 9 Latches, Flip-Flops, and Timers

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

Counters and Decoders

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

Fig1-1 2-bit asynchronous counter

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

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

DIGITAL ELECTRONICS. Counters. By: Electrical Engineering Department

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

Digital Fundamentals

Sequential Logic Design Principles.Latches and Flip-Flops

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

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

Systems I: Computer Organization and Architecture

Theory of Logic Circuits. Laboratory manual. Exercise 3

ASYNCHRONOUS COUNTERS

Digital Logic Design Sequential circuits

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

BINARY CODED DECIMAL: B.C.D.

Lecture 8: Synchronous Digital Systems

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

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

Asynchronous Counters. Asynchronous Counters

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

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

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

Flip-Flops and Sequential Circuit Design

Chapter 8. Sequential Circuits for Registers and Counters

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

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

Lesson 12 Sequential Circuits: Flip-Flops

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.

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

DM74LS169A Synchronous 4-Bit Up/Down Binary Counter

Counters. Resources and methods for learning about these subjects (list a few here, in preparation for your research):

74LS193 Synchronous 4-Bit Binary Counter with Dual Clock

A Digital Timer Implementation using 7 Segment Displays

Digital Electronics Detailed Outline

ECE380 Digital Logic

Engr354: Digital Logic Circuits

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

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

DM74LS193 Synchronous 4-Bit Binary Counter with Dual Clock

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

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

A Lesson on Digital Clocks, One Shots and Counters

CHAPTER 11 LATCHES AND FLIP-FLOPS

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

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

CHAPTER 11: Flip Flops

DATA SHEETS DE COMPONENTES DA FAMÍLIA LÓGICA TTL GATES AND INVERTERS POSITIVES NAND GATES AND INVERTERS DESCRIÇÃO

Memory Elements. Combinational logic cannot remember

CHAPTER IX REGISTER BLOCKS COUNTERS, SHIFT, AND ROTATE REGISTERS

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

3-Digit Counter and Display

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


A Lesson on Digital Clocks, One Shots and Counters

7. Latches and Flip-Flops

COMBINATIONAL and SEQUENTIAL LOGIC CIRCUITS Hardware implementation and software design

Master/Slave Flip Flops

Registers & Counters

DM54161 DM74161 DM74163 Synchronous 4-Bit Counters

Digital Fundamentals. Lab 8 Asynchronous Counter Applications

Operating Manual Ver.1.1

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

Sequential Logic: Clocks, Registers, etc.

Chapter 5. Sequential Logic

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

Upon completion of unit 1.1, students will be able to

The string of digits in the binary number system represents the quantity

Cascaded Counters. Page 1 BYU

CDA 3200 Digital Systems. Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012

CHAPTER 3 Boolean Algebra and Digital Logic

Lecture-3 MEMORY: Development of Memory:

DEPARTMENT OF INFORMATION TECHNLOGY

Microprocessor & Assembly Language

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

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

54LS193 DM54LS193 DM74LS193 Synchronous 4-Bit Up Down Binary Counters with Dual Clock

74AC191 Up/Down Counter with Preset and Ripple Clock

The components. E3: Digital electronics. Goals:

DATA SHEET. HEF4017B MSI 5-stage Johnson counter. For a complete data sheet, please also download: INTEGRATED CIRCUITS

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

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

Lecture 10 Sequential Circuit Design Zhuo Feng. Z. Feng MTU EE4800 CMOS Digital IC Design & Analysis 2010

Modeling Latches and Flip-flops

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

74F168*, 74F169 4-bit up/down binary synchronous counter

CS311 Lecture: Sequential Circuits

Lecture 11: Sequential Circuit Design

Obsolete Product(s) - Obsolete Product(s)

Copyright Peter R. Rony All rights reserved.

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

NTE2053 Integrated Circuit 8 Bit MPU Compatible A/D Converter

Transcription:

ounter

ounters ounters are a specific type of sequential circuit. Like registers, the state, or the flip-flop values themselves, serves as the output. The output value increases by one on each clock cycle. After the largest value, the output wraps around back to. Using two bits, we d get something like this: Present State Next State A B A B

Benefits of counters ounters can act as simple clocks to keep track of time. You may need to record how many times something has happened. How many bits have been sent or received? How many steps have been performed in some computation? All processors contain a program counter, or P. Programs consist of a list of instructions that are to be executed one after another (for the most part). The P keeps track of the instruction currently being executed. The P increments once on each clock cycle, and the next program instruction is then executed. In digital logic and computing, a counter is a device which stores (and sometimes displays) the number of times a particular event or process has occurred, often in relationship to a clock signal.

lassifications of ounters Asynchronous ounters Only the first flip-flop is clocked by an external clock. All subsequent flip-flops are clocked by the output of the preceding flip-flop.means output of previous flip-flop is connected to clock input of next flip flop. Asynchronous counters are slower than synchronous counters because of the delay in the transmission of the pulses from flip-flop to flip-flop. Asynchronous counters are also called ripple-counters because of the way the clock pulse ripples it way through the flip-flops.

Synchronous ounters All flip-flops are clocked simultaneously by an external clock. Means clock input of all flip flops are connected to same external clock. Synchronous counters are faster than asynchronous counters because of the simultaneous clocking. Synchronous counters are an example of state machine design because they have a set of states and a set of transition rules for moving between those states after each clocked event.

States / Modulus / Flip-Flops The number of flip-flops determines the count limit or number of states. (STATES = 2 # of flip flops ) The number of states used is called the MODULUS. For example, a Modulus-2 counter would count from () to () and requires four flip-flops (6 states - 2 used).

Electronic counters -- Examples. Up/down counter counts both up and down, under command of a control input 2. Ring counter formed by a shift register with feedback connection in a ring 3. ohnson counter a twisted ring counter 4. ascaded counter 5. Decade ounter

Asynchronous ounters.5 Asynchronous ounter/ripple counters can be constructed using several flip flops consider the following arrangement with = = each flip flop toggles on the falling edge of its clock input

Each stage toggles at half the frequency of the previous stage acts as a frequency divider divides frequency by 2 n (n is the number of stages)

Application of a frequency divider lock generator for a digital watch 5-stage counter divides signal from a crystal oscillator by 32,768 to produce a Hz signal to drive stepper motor or digital display

onsider the pattern on the outputs of the counter as shown displayed on the right the outputs count in binary from to 2 n - and then repeat the circuit acts as a modulo-2 n counter since the counting process propagates from one bistable to the next this is called a ripple counter circuit shown is a 4-bit or modulo-6 (or mod-6) ripple counter

Modulo-N counters by using an appropriate number of stages the earlier counter can count modulo any power of 2 to count to any other base we add reset circuitry e.g. the modulo- or decade counter shown here

Down and up/down ounters a slight modification to the earlier circuit will produce a counter that counts from 2 n - to and then restarts this is a down counter a further modification can produce an up/down counter which counts up or down depending on the state of a control line (usually labelled up/down ) when this is the counter counts up when this is the counter counts down

Drawbacks/Limitation of Ripple ounter Propagation delay in counters while ripple counters are very simple they suffer from problems at high speed since the output of one flip-flop is triggered by the change of the previous device, delays produced by each flip-flop are summed along the chain the time for a single device to respond is termed its propagation delay time t PD an n-bit counter will take n t PD to respond if read before this time the result will be garbled

Asynchronous (Ripple) ounters Example: 2-bit ripple binary counter. Output of one flip-flop is connected to the clock input of the next more-significant flip-flop. HIGH L FF FF L 2 3 4 Timing diagram...

Asynchronous (Ripple) ounters Example: 3-bit ripple binary counter. HIGH 2 L FF FF FF2 L 2 3 4 5 6 7 8 2 Recycles back to

Asynchronous (Ripple) ounters Propagation delays in an asynchronous (rippleclocked) binary counter. If the accumulated delay is greater than the clock pulse, some counter states may be misrepresented! L 2 3 4 2 t PLH (L to ) t PHL (L to ) t PLH ( to ) t PHL (L to ) t PHL ( to ) t PLH ( to 2 )

Asynchronous (Ripple) ounters Example: 4-bit ripple binary counter (negativeedge triggered). HIGH 2 3 L FF FF FF2 FF3 L 2 3 4 5 6 7 8 9 2 3 4 5 6 2 3

Asyn. ounters with MOD no. < 2 n States may be skipped resulting in a truncated sequence. Technique: force counter to recycle before going through all of the states in the binary sequence. Example: Given the following circuit, determine the counting sequence (and hence the modulus no.) B A All, inputs are (HIGH). L LR B L LR L LR

Asyn. ounters with MOD no. < 2 n Example (cont d): B A All, inputs are (HIGH). lock A B NAND Output 2 L LR B L LR 3 4 5 6 7 8 9 2 L LR MOD-6 counter produced by clearing (a MOD-8 binary counter) when count of six () occurs.

Asyn. ounters with MOD no. < 2 n Example (cont d): ounting sequence of circuit (in BA order). NAND Output lock A B 2 3 4 5 6 7 8 9 2 Temporary state ounter is a MOD-6 counter.

Asyn. ounters with MOD no. < 2 n Exercise: How to construct an asynchronous MOD-5 counter? MOD-7 counter? MOD-2 counter? uestion: The following is a MOD-? counter? F E D B A LR LR LR LR LR LR D E All = =. F S4-3 Asynchronous ounters with 22

Asyn. ounters with MOD no. < 2 n Decade counters (or BD counters) are counters with states (modulus-) in their sequence. They are commonly used in daily life (e.g.: utility meters, odometers, etc.). Design an asynchronous decade counter. (A.)' HIGH D B A L LR LR LR LR S4-3 Asynchronous ounters with 23

Asyn. ounters with MOD no. < 2 n Asynchronous decade/bd counter (cont d). HIGH D B A (A.)' L LR LR LR LR lock D B A NAND output 2 3 4 5 6 7 8 9

Asynchronous Down ounters So far we are dealing with up counters. Down counters, on the other hand, count downward from a maximum value to zero, and repeat. Example: A 3-bit binary (MOD-2 3 ) down counter. L ' ' ' 2 3-bit binary up counter L ' ' ' 2 3-bit binary down counter

Asynchronous Down ounters Example: A 3-bit binary (MOD-8) down counter. L L ' 2 ' 3 4 ' 5 2 6 7 8 2

ascading Asynchronous ounters Larger asynchronous (ripple) counter can be constructed by cascading smaller ripple counters. onnect last-stage output of one counter to the clock input of next counter so as to achieve higher-modulus operation. Example: A modulus-32 ripple counter constructed from a modulus-4 counter and a modulus-8 counter. 2 3 4 L ' ' ' ' ' Modulus-4 counter Modulus-8 counter

Monostables or one-shots Monostables are another form of multivibrator while bistables have two stable output states monostables have one stable & one metastable states when in its stable state = when an appropriate signal is applied to the trigger input (T ) the circuit enters its metastable state with = after a set period of time (determined by circuit components) it reverts to its stable state it is therefore a pulse generator ircuit symbol

Monostables can be retriggerable or non-retriggerable

Astables.7 The last member of the multivibrator family is the astable this has two metastable states has the function of a digital oscillator circuit spends a fixed period in each state (determined by circuit components) if the period in each state is set to be equal, this will produce a square waveform

Timers The integrated circuit timer can produce a range of functions including those of a monostable or astable various devices one of the most popular is the 555 timer can be configured using just a couple of external passive components internal construction largely unimportant all required information on using the device is in its data sheet

ey Points Sequential logic circuits have the characteristic of memory Among the most important groups of sequential components are the various forms of multivibrator bistables monostables astables The most widely used form is the bistable which includes latches, edge-triggered flip-flops and master/slave devices Registers form the basis of various memories ounters are widely used in a range of applications Monostables and astables perform a range of functions

BD In computing and electronic systems, binary-coded decimal (BD) (sometimes called natural binary-coded decimal, NBD) or, in its most common modern implementation, packed decimal, is an encoding for decimal numbers in which each digit is represented by its own binary sequence. Its main virtue is that it allows easy conversion to decimal digits for printing or display, and allows faster decimal calculations. Its drawbacks are a small increase in the complexity of circuits needed to implement mathematical operations. Uncompressed BD is also a relatively inefficient encoding it occupies more space than a purely binary representation. In BD, a digit is usually represented by four bits which, in general, represent the decimal digits through 9. Other bit combinations are sometimes used for a sign or for other indications (e.g., error or overflow). Although uncompressed BD is not as widely used as it once was, decimal fixed-point and floating-point are still important and continue to be used in financial, commercial, and industrial computing.

Basics for BD To encode a decimal number using the common BD encoding, each decimal digit is stored in a 4-bit nibble: Decimal: 2 3 4 5 6 7 8 9 BD: Thus, the BD encoding for the number 27 would be: Whereas the pure binary number would be:

Binary-coded-decimal(BD) counters

onsists of two modulo- counters, one for each BD digit. It is necessary to reset the four flip-flops after the count of 9 has been obtained. Thus the Load input to each stage is equal to when 3==, which causes s to be loaded into the flip-flops at the next positive edge of the clock signal. eeping the Enable signal for BD low at all times except when BD = 9

IBM and BD IBM used the terms binary-coded decimal and BD for 6-bit alphamerics codes that represented numbers, upper-case letters and special characters. Some variation of BD alphamerics was used in most early IBM computers, including the IBM 62, IBM 4 series, and non-decimal Architecture members of the IBM 7/7 series. Today, BD data is still heavily used in IBM processors and databases, such as IBM DB2, mainframes, and Power6. In these products, the BD is usually zoned BD (as in EBDI or ASII), Packed BD (two decimal digits per byte), or "pure" BD encoding (one decimal digit stored as BD in the low four bits of each byte). All of these are used within hardware registers and processing units, and in software.