Latches and Flip-flops

Similar documents
Counters & Shift Registers Chapter 8 of R.P Jain

Module 3: Floyd, Digital Fundamental

Lesson 12 Sequential Circuits: Flip-Flops

Lecture 8: Synchronous Digital Systems

Digital Logic Design Sequential circuits

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

DIGITAL ELECTRONICS. Counters. By: Electrical Engineering Department

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

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

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

Chapter 8. Sequential Circuits for Registers and Counters

CHAPTER 11 LATCHES AND FLIP-FLOPS

Counters and Decoders

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

Asynchronous Counters. Asynchronous Counters

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

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

Flip-Flops and Sequential Circuit Design

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

Memory Elements. Combinational logic cannot remember

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

ASYNCHRONOUS COUNTERS

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

Sequential Logic Design Principles.Latches and Flip-Flops

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

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

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

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

CS311 Lecture: Sequential Circuits

Contents COUNTER. Unit III- Counters

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

Chapter 9 Latches, Flip-Flops, and Timers

Engr354: Digital Logic Circuits

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

ECE380 Digital Logic

Lecture-3 MEMORY: Development of Memory:

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

Theory of Logic Circuits. Laboratory manual. Exercise 3

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

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

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

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

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

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

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

CHAPTER IX REGISTER BLOCKS COUNTERS, SHIFT, AND ROTATE REGISTERS

Master/Slave Flip Flops

Counters. Present State Next State A B A B

Combinational Logic Design Process

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

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

Sequential Logic: Clocks, Registers, etc.

COMBINATIONAL and SEQUENTIAL LOGIC CIRCUITS Hardware implementation and software design

Cascaded Counters. Page 1 BYU

Modeling Latches and Flip-flops

Lecture 7: Clocking of VLSI Systems

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

Design: a mod-8 Counter

DM74LS169A Synchronous 4-Bit Up/Down Binary Counter

CHAPTER 3 Boolean Algebra and Digital Logic

Fig1-1 2-bit asynchronous counter

CSE140: Components and Design Techniques for Digital Systems

Digital Fundamentals

Chapter 5. Sequential Logic

7. Latches and Flip-Flops

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

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

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.

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

BINARY CODED DECIMAL: B.C.D.

The components. E3: Digital electronics. Goals:

Upon completion of unit 1.1, students will be able to

Layout of Multiple Cells

74LS193 Synchronous 4-Bit Binary Counter with Dual Clock

Sequential Circuit Design

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

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

DEPARTMENT OF INFORMATION TECHNLOGY

CHAPTER 11: Flip Flops

NTE2053 Integrated Circuit 8 Bit MPU Compatible A/D Converter

EXPERIMENT 8. Flip-Flops and Sequential Circuits

Lecture 11: Sequential Circuit Design

CS 61C: Great Ideas in Computer Architecture Finite State Machines. Machine Interpreta4on

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

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

A New Paradigm for Synchronous State Machine Design in Verilog

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

Design Verification & Testing Design for Testability and Scan

Registers & Counters

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

Lecture 10: Sequential Circuits

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

DM74LS193 Synchronous 4-Bit Binary Counter with Dual Clock

Set-Reset (SR) Latch

74AC191 Up/Down Counter with Preset and Ripple Clock

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

Systems I: Computer Organization and Architecture

DM54161 DM74161 DM74163 Synchronous 4-Bit Counters

Transcription:

Latches and Flip-flops Latches and flip-flops are circuits with memory function. They are part of the computer's memory and processor s registers. SR latch is basically the computer memory cell Q=1 Q=0

SR latch with two NOR-gates If S = 1 and R = 0 it causes the upper gate to "0". The lower gate inputs then becomes 00 and it s output Q = 1. Since the upper gate now get "1" from both inputs, it now does not matter if S = 0. Q remains locked to output "1". If R = 1 and S = 0 it causes the lower gate to "0". Output is Q = 0. The upper gate inputs becomes 00 giving "1" at it s output and "1" at the input of the lower gate. Since the lower gate now get "1" from both inputs, it now does not matter if R = 0. Q remains unlocked to "0". Q=1 Q=0

Ex 9.1 Complete the timing diagram for the output signals Q and Q. The distance between the pulses is much longer than the gate delay. (Hint, what is the locking input signal for NOR gates?)

Ex 9.1 Complete the timing diagram for the output signals Q and Q. The distance between the pulses is much longer than the gate delay. (Hint, what is the locking input signal for NOR gates?)

Ex 9.1 Complete the timing diagram for the output signals Q and Q. The distance between the pulses is much longer than the gate delay. (Hint, what is the locking input signal for NOR gates?)

Ex 9.1 Complete the timing diagram for the output signals Q and Q. The distance between the pulses is much longer than the gate delay. (Hint, what is the locking input signal for NOR gates?)

Ex 9.1 Complete the timing diagram for the output signals Q and Q. The distance between the pulses is much longer than the gate delay. (Hint, what is the locking input signal for NOR gates?)

Ex 9.1 Complete the timing diagram for the output signals Q and Q. The distance between the pulses is much longer than the gate delay. (Hint, what is the locking input signal for NOR gates?)

Ex 9.1 Complete the timing diagram for the output signals Q and Q. The distance between the pulses is much longer than the gate delay. (Hint, what is the locking input signal for NOR gates?)

Ex 9.1 Complete the timing diagram for the output signals Q and Q. The distance between the pulses is much longer than the gate delay. (Hint, what is the locking input signal for NOR gates?)

Ex 9.1 Complete the timing diagram for the output signals Q and Q. The distance between the pulses is much longer than the gate delay. (Hint, what is the locking input signal for NOR gates?) For S = 1 and R = 1 the latch does not work, the outputs will then not be each others inverses, but both will be 0.

SR-latch characteristic table same forbidden A short "pulse" S = 1 "sets" the latch circuit and a short "pulse" R = 1 "resets" it. As long as the S = 0 and R = 0, the latch retains its value In the characteristic table the input combination S = 1 and R = 1 is forbidden!. For this combination would both gates outputs become "0" at the same time. For the other input combinations it applies that the outputs are each other's inverses. If you want to guarantee that the "other" output is always inverted, you have to "ban" the forbidden input signal combination.

Edge triggered Flip-flop In digital technology there is a distinction between simple latches and clocked flip-flops.? The limitation of the simple latch is that one can not enter a new value to the input while reading the output. The high speed of electronic circuits has made it necessary to develop more sophisticated circuits. Edge-triggered D flip-flop. D input is the data input, C input is the clock pulse input, hence the designation CP. The control input C has an edge trigger sign, a triangle. When the C input is reached by a positive edge, ie. the short period of time when C goes from "0" to "1", the D-input value is copied to the output Q. The output value is then locked until a new edge of the clock pulse is received.

Synchronization with D flip-flops D flip-flop used to synchronize the signal flow between the different parts of the computer. D flip-flops are used to stop the race between signals for the value to become stable. (Compare with the tollbooth that stops the cars).

Synchronization with D flip-flops D flip-flop used to synchronize the signal flow between the different parts of the computer. D flip-flops are used to stop the race between signals for the value to become stable. (Compare with the tollbooth that stops the cars).?

Synchronization with D flip-flops D flip-flop used to synchronize the signal flow between the different parts of the computer. D flip-flops are used to stop the race between signals for the value to become stable. (Compare with the tollbooth that stops the cars).?!

(9.4) Draw output Q in this timing diagram

(9.4) Draw output Q in this timing diagram

T-function Q T=0 Same T=1 Change, Toggle Q Sometimes this symbol of T-function is used. The T-flip-flop. Q Q

Ex 9.3 Draw the timing diagram for the output Q of the D flip-flop.

Ex 9.3 Draw the timing diagram for the output Q of the D flip-flop.

Ex 9.3 Draw the timing diagram for the output Q of the D flip-flop.

Ex 9.3 Draw the timing diagram for the output Q of the D flip-flop.

Ex 9.3 Draw the timing diagram for the output Q of the D flip-flop.

Ex 9.3 Draw the timing diagram for the output Q of the D flip-flop.

Ex 9.3 Draw the timing diagram for the output Q of the D flip-flop.

Ex 9.5 JK flip-flop was an older type of "universal flip-flop". Show how it can be used as the T-flip-flop and as D-flip-flop. Characteristic table same toggle

Ex 9.5 JK flip-flop can be used as the T flip-flop or D flip-flop. (When flip-flops are connected to each other there are usually the inverted outputs available, you will then not require the inverter to make the JK flip flop to D flip-flop.)

Ex 9.6 What is the maximum clock frequency that can be used to the circuit in the figure without the risk of failure? Suppose that t s = 20 ns t h = 5 ns t pd = 30 ns If the output is connected directly to input then must t < else one risking to - cut off the branch one is sitting on h t pd

t s = 20 ns t h = 5 ns t pd = 30 ns Ex 9.6

Ex 9.6 t s = 20 ns t h = 5 ns t pd = 30 ns T = t pd + t s f = 1 T = t pd 1 + t s = 1 (20 + 30) [ ns] = 20 MHz

Asynchronous binary counter The figure above shows a binary counter with three flip-flops, the counting cycle has eight states so it is a modulo-8 counter. The counter is built of T-flip-flops, as they all have T = 1 they "toggles" at each clock pulse. The first flip-flop Q 0 "toggles" every clock pulse. The flip-flop Q 1 is clocked by the first flip-flop. It will therefore only "toggle" for every other clock pulse. The third flip-flop Q 2 will "toggle" for every other every other clock pulse. According to the binary table, the counter is counting in binary code. ( Q 2 Q 1 Q 0 : 000 001 010 011 100 101 110 111 000... ).

Asynchronous counter weakness Asynchronous counter has the simplest possible structure. Since the clock pulses are routed through the flip-flops so they can not change state on exactly the same time. If you read the binary code on the outputs of flip-flops during the transition, then any code can appear for a short time! The flip-flops changes output one after another and you could say that the clock pulse "ripples" through the flip-flops (asynchronous counters are therefore sometimes called ripple counters). This problem has been solved with the synchronous counters.

BV 7.5 Given a 100-MHz clock signal, derive a circuit using T flip-flops to generate 50-MHz and 25-MHz clock signals. Draw a timing diagram for all three clock signals, assuming resonable delays.

BV 7.5 Given a 100-MHz clock signal, derive a circuit using T flip-flops to generate 50-MHz and 25-MHz clock signals. Draw a timing diagram for all three clock signals, assuming resonable delays.

BV 7.5 Given a 100-MHz clock signal, derive a circuit using T flip-flops to generate 50-MHz and 25-MHz clock signals. Draw a timing diagram for all three clock signals, assuming resonable delays. Output signals are delayed, after each stage!

Synchronous binary-counter The clock pulses go directly to all the flip-flops and therefore they change state at the same time. What flip-flop to turn on or not is controlled by T-inputs. The first flip-flop has T = 1, and it will toggle on every clock pulse. From the binary table, one can see that a certain flipflop should toggle is when all previous flip-flops outputs "1". toggle when all previous are 1 You get this condition from the AND gates in the so-called Carry-chain and they control the T-inputs. If you want to expand the counter it is done with one flip-flop and one AND gate per stage (bit). Up: Toggle if all previous are 1

Synchronous down-counter Carrychain toggle when all previous are 0 Down: Toggle if all previous are 0

BV 7.16 Design a three-bit up/down counter using T flip-flops. It should include a control input called UP/Down. If UP/Down = 0, then the circuit should behave as an up-counter. If UP/Down = 1, then the circuit should behave as a down counter.

BV 7.16 Up: Toggle if all previous are 1 Q 0 Q 1 Q 2 Down: Toggle if all previous are 0

BV 7.16 There is no requirement that the counter will be expanded with more bits. There is no requirement that the counter can be enabled. The circuit can be simplified : Q 0 Q 1 Q 2

BV 7.17 Repeat problem 7.16 using D flip-flops. T: Q0 Q 1 Q 2

BV 7.17 Repeat problem 7.16 using D flip-flops. T: Q0 Q 1 Q 2 Q Q

BV 7.17 Q Toggle T: Hold/Toggle Q D: Q0 Q1 Q2

In D Q Q 1 Q 2 Q 3 Q 4 D Q D Q D Q Out Clock Q Q Q Q A shift-register with a typical sequence. t 0 In 1 0 (a) Circuit Q 1 Q 2 Q 3 Q 4 = Out 0 0 0 t 1 0 1 0 0 0 t 2 1 0 1 0 0 t 3 1 1 0 1 0 t 4 1 1 1 0 1 t 5 0 1 1 1 0 t 6 0 0 1 1 1 t 7 0 0 0 1 1 (b) A sample sequence Figure 7.18. A simple shift register.

BV 7.13 A universal shift register can shift in both the left-to-right and right-to-left directions, and it has parallell-load capability. Draw a circuit for such a shift register. Mode Universal shift register Right _ in Left _ in Parallell _ in Clock > Parallell _ out Right _ out Left _ out

BV 7.13 A universal shift register can shift in both the left-to-right and right-to-left directions, and it has parallell-load capability. Draw a circuit for such a shift register. This is a normal right shift shiftregister:

Mode = 2 Right shift

Mode = 1 Left Shift

Mode = 0 Parallell Load

Mode = 3 Hold

Multifunction shiftregister Mode 0 Parallell Load Mode 2 Right Shift Mode 1 Left Shift Mode 3 Hold

t su t h Clk D Q Figure 7.9. Setup and hold times.

BV 7.24 For the flip-flops in the counter in Figure 7.25, assume that t su = 3 ns, t h = 1ns and the propagation delay t pd is 1ns, and the gates and the 2-to-1 multiplexer has the propagation delay t pd equal to 1ns. What is the maximum clock frequency for which the circuit will operate correctly?

BV 7.24 Signal starts from flip-flop 0 after t pd and passes trough 3 ANDgates, 1 XOR-gate and 1 MUX on the way to flip-flop 3. There is also a demand on flip-flops that the D- signal shall have been stable t su before clock pulse. Check longest path! T min + 3 t = 1+ 3 + 1+ 1+ 3 = 9 ns f = t 1 = T pd min = 9 1 AND [ ns] + t XOR + t = 111 MHz MUX + t SU =

BV 7.24 D-signal must also continnue to be stable during t h. t + h < t pd + t XOR tmux Check! Check shortest path!

( Ex. 9.7 ) The figure shows three different state machines. Specify the state machine (A, B or C) that can operate at the highest clock speed. Highlight the critical path (the path that limits clock frequency) in this figure and calculate the period time for the clock signal Clk.

( Ex. 9.7 )

Heuristic methods of construction? This time, we have constructed counters and shift registers by being "clever". (Heuristic methods of construction - based on experience) It's not every day one is so slick, so the next exercise is about the systematic design methods that are general and therefore can be used on any sequence circuit problem, and at all days. The Moore machine and the Mealy machine.