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



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

Module 3: Floyd, Digital Fundamental

Counters & Shift Registers Chapter 8 of R.P Jain

Digital Logic Design Sequential circuits

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

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

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

Counters and Decoders

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

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

Chapter 8. Sequential Circuits for Registers and Counters

CHAPTER IX REGISTER BLOCKS COUNTERS, SHIFT, AND ROTATE REGISTERS

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

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

ECE380 Digital Logic

Engr354: Digital Logic Circuits

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

Lesson 12 Sequential Circuits: Flip-Flops

Systems I: Computer Organization and Architecture

Memory Elements. Combinational logic cannot remember

CHAPTER 11 LATCHES AND FLIP-FLOPS

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

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

DIGITAL ELECTRONICS. Counters. By: Electrical Engineering Department

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

Flip-Flops and Sequential Circuit Design

BINARY CODED DECIMAL: B.C.D.

Asynchronous Counters. Asynchronous Counters

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

CSE140: Components and Design Techniques for Digital Systems

ASYNCHRONOUS COUNTERS

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

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

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

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

Sequential Logic Design Principles.Latches and Flip-Flops

Lecture 8: Synchronous Digital Systems

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

Master/Slave Flip Flops

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

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

DEPARTMENT OF INFORMATION TECHNLOGY

Counters. Present State Next State A B A B

Sequential Logic: Clocks, Registers, etc.

Set-Reset (SR) Latch

Registers & Counters

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

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

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

Lecture-3 MEMORY: Development of Memory:

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

DM74LS169A Synchronous 4-Bit Up/Down Binary Counter

Chapter 9 Latches, Flip-Flops, and Timers

Cascaded Counters. Page 1 BYU

Operating Manual Ver.1.1

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.

COMBINATIONAL and SEQUENTIAL LOGIC CIRCUITS Hardware implementation and software design

Theory of Logic Circuits. Laboratory manual. Exercise 3

NTE2053 Integrated Circuit 8 Bit MPU Compatible A/D Converter

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

7. Latches and Flip-Flops

Combinational Logic Design Process

CHAPTER 11: Flip Flops

DM54161 DM74161 DM74163 Synchronous 4-Bit Counters

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

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

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

Fig1-1 2-bit asynchronous counter

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

Lecture 10: Sequential Circuits

CS311 Lecture: Sequential Circuits


Lecture 11: Sequential Circuit Design

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

Design Verification & Testing Design for Testability and Scan

Digital Fundamentals. Lab 8 Asynchronous Counter Applications

Sequential Circuit Design

Layout of Multiple Cells

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

Digital Fundamentals

(Refer Slide Time: 00:01:16 min)

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

A New Paradigm for Synchronous State Machine Design in Verilog

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

Chapter 5. Sequential Logic

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

EXPERIMENT 8. Flip-Flops and Sequential Circuits

ECE124 Digital Circuits and Systems Page 1

The components. E3: Digital electronics. Goals:

Design: a mod-8 Counter

Clocking. Figure by MIT OCW Spring /18/05 L06 Clocks 1

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

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

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

Lab 1: Study of Gates & Flip-flops

Sequential Circuits. Combinational Circuits Outputs depend on the current inputs

Modeling Latches and Flip-flops

74AC191 Up/Down Counter with Preset and Ripple Clock

Transcription:

WEEK 8.1 egisters and Counters ECE124 igital Circuits and Systems Page 1

Additional schematic FF symbols Active low set and reset signals. S Active high set and reset signals. S ECE124 igital Circuits and Systems Page 2

Characteristic tables and equations for FFs We can describe the behavior of a flip-flop via a characteristic table. The characteristic table shows what the next flip-flop output value will be given the current flip-flop input value after the clock makes its active edge transition. We can also write this as a characteristic equation: ECE124 igital Circuits and Systems Page 3

Toggle flip-flops (TFF) Another type of flip-flop that has a different behavior when compared to a FF. Symbol for a positive edge-triggered TFF: T Symbol for a negative edge-triggered TFF: T ECE124 igital Circuits and Systems Page 4

Characteristic tables and equations for TFFs The characteristic table for the TFF: The characteristic equation for the TFF: So with a TFF, the output toggles (or flips) its value if the input is T=1, otherwise it remains the same. ECE124 igital Circuits and Systems Page 5

Making a TFF from a FF We can actually build a TFF using a FF and a 2-input XO gate. T T CLOCK ECE124 igital Circuits and Systems Page 6

JK flip-flops (JKFF) Another type of flip-flop that has different behavior compared to a FF or to a TFF. Positive edge-triggered JKFF: J K Negative edge-triggered JKFF: ECE124 igital Circuits and Systems Page 7

Characteristic tables and equations for JKFFs The characteristic table for the JKFF: We can derive the characteristic equation for the JKFF (I find it easy to explain via a K- Map): JK (t) 00 01 11 10 0 0 0 1 1 1 1 0 0 1 ECE124 igital Circuits and Systems Page 8

Making a JKFF from a FF We can actually build a JKFF using a FF and some other gates. J J K CLOCK K ECE124 igital Circuits and Systems Page 9

Timing analysis with flip-flops There are some important things to understand when we go to actually make and implement a circuit with flip-flops. In reality, it takes time for gates to change their output values according to the input values i.e., there are propagation delays due to resistance, capacitance, etc. Changes in flip-flop outputs occur at the active clock edge. There are three timing parameters that are especially important: Setup Time (TSU). Hold Time (TH). Clock-To-Output Time (TCO). ECE124 igital Circuits and Systems Page 10

efinitions for timing analysis of flip-flops Setup Time (TSU): The setup time of a flip-flop is the amount of time that the data inputs need to be held stable (not changing) PIO to the arrival of the active clock edge. Hold Time (TH): The hold time of a flip-flop is the amount of time that the data inputs need to be held stable (not changing) AFTE the arrival of the active clock edge. Clock-To-Output (TCO): The clock-to-output time of a flip-flop is the amount of time it takes for the output to become stable (at its new value) AFTE the arrival of the active clock edge. ECE124 igital Circuits and Systems Page 11

Comments If these timing specifications are not met, then it is possible that the flip-flop will not behave as expected. That is, if we don t observe setup and hold times at the data inputs, then our output might not change as expected. That is, if we don t wait long enough (clock-to-output time) for the output to change, then we might use an incorrect value. If we violate any of these timing parameters, then we have a timing violation. These timing parameters (as we will see later) have an influence on how fast we can clock a circuit. ECE124 igital Circuits and Systems Page 12

Illustration of timing parameters (for a FF) TSU TH TCO CLOCK should not change in this interval not stable (trustworthy) until this interval ends ECE124 igital Circuits and Systems Page 13

egisters A single FF stores one bit A group of n FFs stores n-bits and is called an n-bit register. I0 A0 Illustration: When clear=0, all flip-flop outputs are forced to zero (active low reset). I1 A1 When clear=1, the rising edge of the clock (the active clock edge), results in the 4-bit input transferred to register output. I2 A2 I3 A3 clock clear ECE124 igital Circuits and Systems Page 14

Parallel loads (1) We might want to prevent the transfer of data from input to output even though the active clock edge arrives we want the register to HOL ITS CUENT VALUE. We can do this by feeding the register outputs back to the inputs and adding some additional logic to control the register operation. ECE124 igital Circuits and Systems Page 15

Parallel loads (2) When load=1, the data inputs reach the -input of the flip-flop. When the active clock edge arrives, the data gets transferred, or loaded, to the register output. When load=0, the data output of each flip-flop is fed back to its -input. I0 I1 A0 A1 When the active clock edge arrives, the data input gets transferred to the register output, but since the values are the same for all flip-flops, the register holds its current value. I2 I3 A2 A3 load clock clear ECE124 igital Circuits and Systems Page 16

Shift registers Might want a register that can shift data serially in a direction This type of register is called a shift register. Illustration of a 4-bit shift register. serial in serial out clock clear As active clock edges arrive, the data present at the serial input gets transferred towards the serial output so, data gets shifted to the right one bit at a time as clock edges arrive. ECE124 igital Circuits and Systems Page 17

Comment Whenever we would like to add an operation to our register, we are simply placing a MUX in from of each FF in order to direct the correct information to the FF inputs in order to obtain the correct operation. ECE124 igital Circuits and Systems Page 18

Universal shift registers (1) Perhaps we want a more general circuit e.g., we want to be able to clear the register, load the register, and perform both a shift right and a shift left operation. ECE124 igital Circuits and Systems Page 19

Universal shift registers (2) 4-bit register capable of multiple operations (use multiplexers instead of AN/O gates at FF inputs): data in (rshift) I0 00 01 10 11 A0 I1 00 01 10 11 A1 I2 00 01 10 11 A2 I3 00 01 10 11 A3 data in (lshift) c1 c0 clock clear ECE124 igital Circuits and Systems Page 20

Universal shift registers (3) Has an asynchronous clear signal Has a clock signal Has data inputs for parallel load Has data inputs for both left and right shifts Has two control inputs that determine behavior: ECE124 igital Circuits and Systems Page 21

Counters A counter is a register whose outputs go through a prescribed sequence of states upon the arrival of the active edge of some triggering signal (e.g., like a clock). The prescribed sequence of states, or register outputs, can be anything. Counters can come in two varieties asynchronous or synchronous. ECE124 igital Circuits and Systems Page 22

ipple counters ipple counters consist of a series of flip-flops where the output of one flip-flop is used (somehow) as the clock for the next flip-flop. It is the lack of a common clock signal for each flip-flop that makes the counter asynchronous. ECE124 igital Circuits and Systems Page 23

Binary ripple counter (1) A type of ripple counter that has n-bits, and can count in binary from 0 to 2 n -1 and repeat. E.g., count sequence for 4-bits: ECE124 igital Circuits and Systems Page 24

Binary ripple counter (2) We can make a binary ripple counter easily via observation 1 count T A0 A 0 always flips A 1 flips with A 0 goes 1 -> 0 T A1 A 2 flips with A 1 goes 1 -> 0 Etc So, the i-th bit complements the (i+1)-th bit when it goes 1 -> 0. T A2 Binary ripple counter easily done with TFFs. T A3 clear ECE124 igital Circuits and Systems Page 25

Up and down binary ripple counters Up counters count in the sequence 0, 1, 2,, 2 n -1 and repeats. own counters count in the sequence 2 n -1,, 2, 1, 0 and repeats. Should be able to take our previous example and construct a binary ripple down counter ECE124 igital Circuits and Systems Page 26

ipple counter delays ecall: Flip-flops have clock-to-output times (it takes time for the output to change once the clock signal arrives on the flip-flop). Because of this, it can take a lot of time for the higher order bits of a ripple counter to change (remember that the i-th bit output is used as the clock for the (i+1)-th bit). count A0 A1 A2 A3 transition time due to clock-to-output times So, the FF outputs do not change at the same time due to the ripple effect in the clock inputs. We would like FF outputs to change simultaneously. This is why we prefer to design synchronous counters. ECE124 igital Circuits and Systems Page 27

Synchronous counters ifferent from ripple counters in that (the same) clock pulses are applied to the clock inputs of all flip-flops simultaneously. Flip-flop outputs then change simultaneously. ECE124 igital Circuits and Systems Page 28

Example: Synchronous Binary Up Counter Can design a 4-bit synchronous binary up counter with enable: If enable=0 circuit should not count; If enable=1 the circuit should count. Observation: A 0 is always toggling, A 1 toggles if A 0 is 1, A 2 toggles if A 0, A 1 are 1, A 3 toggles if A 0, A 1, A 2 are 1 Observations motivate the use of TFF ECE124 igital Circuits and Systems Page 29

Example: Synchronous Binary Up Counter Synchronous 4-bit binary up counter with enable using TFF: enable T A0 T A1 T A2 T A3 clock clear next stage ECE124 igital Circuits and Systems Page 30

Example: Synchronous Binary own Counter Can design a 4-bit synchronous binary up counter with enable: If enable=0 circuit should not count; If enable=1 the circuit should count. Observation: A 0 is always toggling, A 1 toggles if A 0 is 0 A 2 toggles if A 0, A 1 are 0, A 3 toggles if A 0, A 1, A 2 are 0 Observations motivate the use of TFF ECE124 igital Circuits and Systems Page 31

Example: Synchronous Binary own Counter Synchronous 4-bit binary down counter with enable using TFF: down T A0 T A1 T A2 T A3 clock clear next stage ECE124 igital Circuits and Systems Page 32

Example: Synchronous Binary Up/own Counter Can combine the up and down counter to get an up/down counter (re-use previously built circuits!) Trick is getting correct input to the FF in order to perform correct operation. Consider the following control inputs which determine circuit behaviour: ECE124 igital Circuits and Systems Page 33

Example: Synchronous Binary Up/own Counter Have both logic for up count and down count; up has priority (it disables down). ECE124 igital Circuits and Systems Page 34

Example: Synchronous Binary Up/own Counter With Parallel Load Often useful to have a counter that we can load with a starting count. This requires adding another control line (load) and data inputs: ECE124 igital Circuits and Systems Page 35

Example: Synchronous Binary Up/own Counter With Parallel Load load up down L U I0 T A0 I1 T A1 I2 T A2 I3 T A3 clock clear ECE124 igital Circuits and Systems Page 36

Comments All of the previous counters could have been built using FF or JKFF. esigning counters that perform multiple operations involves: Making sure that the correct inputs get to the FF inputs in order to perform the specific function; and The logic feeding the FF input will cause the FF output to change appropriately. If the control signals and operations have priority, we need to make sure that the control signal priority disables the operation due to other control lines (e.g., parallel load turns off up/down count signals. ECE124 igital Circuits and Systems Page 37

Symbols We might have different symbols to represent counters: E.g., I0 I1 I2 I3 CL UP A0 A1 A2 A3 ECE124 igital Circuits and Systems Page 38

Modulo counters Sometimes we don t want to count through the entire sequence of binary numbers. E.g., we might want to count 0, 1,,2,, 10 and repeat. (This is effectively a modulo- 10 counter). We could design such a counter using synchronous circuit design principles, but we could also attempt something a bit trickier We can use additional circuitry to detect our maximum count number and use a parallel load to restart the counting. ECE124 igital Circuits and Systems Page 39

Modulo counter build from a binary counter building block E.g., design a counter that counts 0, 1,,2,, 10 and repeats. CLK 0 0 0 0 1 1 I0 A0 I1 A1 I2 A2 I3 A3 CL UP LOA ECE124 igital Circuits and Systems Page 40

Some Other Types of Counters: ing counters An n-bit counter in which only one output is high at any given time. E.g., Can illustrate with a timing diagram for 4-bits: CLK A0 A1 A2 A3 Outputs like this useful to generate timing signals that indicate an order of operation in another circuit block. ECE124 igital Circuits and Systems Page 41

Some Other Types of Counters: ing counters Can make an n-bit ring counter with a shift register. E.g., 4-bit ring counter: A0 A1 A2 A3 S clear clk To generate n non-overlapping timing signals, we need a shift register with n flip-flops. ECE124 igital Circuits and Systems Page 42

Some Other Types of Counters: ing counters Can also use a combination of a counter and a decoder. E.g., 4-bit ring counter with 2-bit counter and decoder. 1 CL A0 A1 x y 0 1 A0 A1 CLK 1 COUNT 2 3 A2 A3 2-bit counter 2-to-4 decoder ECE124 igital Circuits and Systems Page 43

Some Other Types of Counters: Switch-tail ring counters Consider the following 4-bit circuit: A0 A1 A2 A3 clear clk esembles a 4-bit ring counter, but complement of MSB fed back to LSB. ECE124 igital Circuits and Systems Page 44

Some Other Types of Counters: Switch-tail ring counters Count pattern can be determined: So, with n bits we get a count pattern of 2 n output states. ECE124 igital Circuits and Systems Page 45

Some Other Types of Counters: Johnson counters We can add additional detection circuitry in order to generate the disjoint timing signals like a ring counter. This results in a Johnson Counter. With a Johnson Counter, we can get 2 n non-overlapping timing signals using n flip-flops and some extra 2-input AN gates. ECE124 igital Circuits and Systems Page 46

Closing emarks Synchronous counters are nice because the counter outputs all change at the same time (according to the clock). We have only talked about some types of counters; e.g., Binary up/down counters; modulo counters. In general, counters are simply an example of a clocked sequential circuit. We can design any type of counter (e.g., any sequence of values we want) once we learn about clocked sequential circuit design (coming up in the course). E.g., we will see how to design a counter that counts 0, 3, 5, 4, 1, and repeats (if we wanted to). ECE124 igital Circuits and Systems Page 47