More on Flip-Flops Digital Design and Computer Architecture: ARM Edition 2015 Chapter 3 <98> 98

Similar documents
EET2411 DIGITAL ELECTRONICS

Chapter 5 Flip-Flops and Related Devices

Introduction. NAND Gate Latch. Digital Logic Design 1 FLIP-FLOP. Digital Logic Design 1

The NOR latch is similar to the NAND latch

Flip-Flops and Related Devices. Wen-Hung Liao, Ph.D. 4/11/2001

Chapter 6. Flip-Flops and Simple Flip-Flop Applications

Asynchronous (Ripple) Counters

Logic Design. Flip Flops, Registers and Counters

Unit 11. Latches and Flip-Flops

Introduction to Sequential Circuits

FLIP-FLOPS AND RELATED DEVICES

LATCHES & FLIP-FLOP. Chapter 7

Lecture 8: Sequential Logic

ECEN454 Digital Integrated Circuit Design. Sequential Circuits. Sequencing. Output depends on current inputs

Sequential Logic. E&CE 223 Digital Circuits and Systems (A. Kennings) Page 1

11. Sequential Elements

Sequencing. Lan-Da Van ( 范倫達 ), Ph. D. Department of Computer Science National Chiao Tung University Taiwan, R.O.C. Fall,

YEDITEPE UNIVERSITY DEPARTMENT OF COMPUTER ENGINEERING. EXPERIMENT VIII: FLIP-FLOPS, COUNTERS 2014 Fall

Experiment 8 Introduction to Latches and Flip-Flops and registers

Digital Design, Kyung Hee Univ. Chapter 5. Synchronous Sequential Logic

Counter dan Register

Flip-Flops. Because of this the state of the latch may keep changing in circuits with feedback as long as the clock pulse remains active.

COE 202: Digital Logic Design Sequential Circuits Part 1. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

Chapter 5: Synchronous Sequential Logic

The outputs are formed by a combinational logic function of the inputs to the circuit or the values stored in the flip-flops (or both).

Chapter 2. Digital Circuits

Lecture 11: Sequential Circuit Design

A clock is a free-running signal with a cycle time. A clock may be either high or low, and alternates between the two states.

Combinational vs Sequential

Chapter. Synchronous Sequential Circuits

Chapter 7 Counters and Registers

Digital Logic & Computer Design CS Professor Dan Moldovan Spring Chapter 3 :: Sequential Logic Design

ELCT201: DIGITAL LOGIC DESIGN

EMT 125 Digital Electronic Principles I CHAPTER 6 : FLIP-FLOP

D Latch (Transparent Latch)

CPE/EE 427, CPE 527 VLSI Design I Sequential Circuits. Sequencing

Synchronous Sequential Logic

INTRODUCTION TO SEQUENTIAL CIRCUITS

Review of digital electronics. Storage units Sequential circuits Counters Shifters

Unit 9 Latches and Flip-Flops. Dept. of Electrical and Computer Eng., NCTU 1

Digital Logic Design Sequential Circuits. Dr. Basem ElHalawany

CHAPTER 1 LATCHES & FLIP-FLOPS

Name Of The Experiment: Sequential circuit design Latch, Flip-flop and Registers

Digital Fundamentals: A Systems Approach

PRE J. Figure 25.1a J-K flip-flop with Asynchronous Preset and Clear inputs

Chapter 5 Synchronous Sequential Logic

CHAPTER 4: Logic Circuits

Chapter 11 Latches and Flip-Flops

Chapter 4. Logic Design

cascading flip-flops for proper operation clock skew Hardware description languages and sequential logic

CHAPTER 4: Logic Circuits

RS flip-flop using NOR gate

Digital Circuits ECS 371

NH 67, Karur Trichy Highways, Puliyur C.F, Karur District UNIT-III SEQUENTIAL CIRCUITS

Registers and Counters

Rangkaian Sekuensial. Flip-flop

Registers and Counters

RS flip-flop using NOR gate

DIGITAL SYSTEM FUNDAMENTALS (ECE421) DIGITAL ELECTRONICS FUNDAMENTAL (ECE422) LATCHES and FLIP-FLOPS

Digital Fundamentals

Counters

CHAPTER 6 COUNTERS & REGISTERS

Digital Logic Design ENEE x. Lecture 19

Logic and Computer Design Fundamentals. Chapter 7. Registers and Counters

MC9211 Computer Organization

(CSC-3501) Lecture 7 (07 Feb 2008) Seung-Jong Park (Jay) CSC S.J. Park. Announcement

Multiplexor (aka MUX) An example, yet VERY useful circuit!

Sequential Logic and Clocked Circuits

Sequential logic. Circuits with feedback. How to control feedback? Sequential circuits. Timing methodologies. Basic registers

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

Sequential Digital Design. Laboratory Manual. Experiment #7. Counters

6. Sequential Logic Flip-Flops

Sequential Circuits. Output depends only and immediately on the inputs Have no memory (dependence on past values of the inputs)

Clocks. Sequential Logic. A clock is a free-running signal with a cycle time.

DEPARTMENT OF ELECTRICAL &ELECTRONICS ENGINEERING DIGITAL DESIGN

DIGITAL ELECTRONICS MCQs

Other Flip-Flops. Lecture 27 1

EE141-Fall 2010 Digital Integrated Circuits. Announcements. Homework #8 due next Tuesday. Project Phase 3 plan due this Sat.

Switching Circuits & Logic Design

ELE2120 Digital Circuits and Systems. Tutorial Note 7

give sequence to events have memory (short-term) use feedback from output to input to store information

Vignana Bharathi Institute of Technology UNIT 4 DLD

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: Sequential Circuits

CHAPTER1: Digital Logic Circuits

Flip-Flops and Sequential Circuit Design

Objectives. Combinational logics Sequential logics Finite state machine Arithmetic circuits Datapath

EE 447/547 VLSI Design. Lecture 9: Sequential Circuits. VLSI Design EE 447/547 Sequential circuits 1

CPS311 Lecture: Sequential Circuits

Introduction to Microprocessor & Digital Logic

ELCT201: DIGITAL LOGIC DESIGN

Digital Fundamentals: A Systems Approach

Digital System Design


ASYNCHRONOUS COUNTER CIRCUITS

3 Flip-Flops. The latch is a logic block that has 2 stable states (0) or (1). The RS latch can be forced to hold a 1 when the Set line is asserted.

Lecture 10: Sequential Circuits

Sequential Digital Design. Laboratory Manual. Experiment #3. Flip Flop Storage Elements

EEC 118 Lecture #9: Sequential Logic. Rajeevan Amirtharajah University of California, Davis Jeff Parkhurst Intel Corporation

Final Exam review: chapter 4 and 5. Supplement 3 and 4

Digital Circuits and Systems

Transcription:

More on Flip-Flops Digital Design and Computer Architecture: ARM Edition 2015 Chapter 3 <98> 98

Review: Bit Storage SR latch S (set) Q R (reset) Level-sensitive SR latch S S1 C R R1 Q D C S R D latch Q D Clk D latch D m Q m C m first D flip-flop D latch D s C s Q s Q s second Q Q Feature: S=1 sets Q to 1, R=1 resets Q to 0. S=R=0, Q=Q prev Problem: SR=11, Q=Q =0 Feature: S and R only have effect when C=1. We can design outside circuit so SR=11 never happens when C=1. Problem: avoiding SR=11 can be a burden. Feature: SR can t be 11 if D is stable before and while C=1, and will be 11 for only a brief glitch even if D changes while C=1. Feature: Only loads D value present at rising clock edge, so values can t propagate to other flip-flops during same clock cycle. Tradeoff: uses more gates internally than D latch, and requires more external gates than SR but gate count is less of an issue today. 99

More FF implementations We can implement a J-K FF by using a D FF (see homework problem) We can implement a D FF by using two D Latches and an inverter. D C S R D latch Q D Clk D latch D m Q m C m first D flip-flop D latch D s Q s C s Q s second Q Q 100

Recall: Flip-Flop vs. Latches: Edge-triggered An edge-triggered flip-flop changes values at the clock edge (transition): responds to its input at a well-defined moment (at the clock-transition) ignores the pulse while it is at a constant level Negative edge-triggered Positive edge-triggered Clock ignored In 101

How to detect an edge? Edge detector circuits used in edge-triggered flip-flops (a) PGT (positive going transition); (b) NGT. The duration of the * pulses is typically 2 5 ns.

Using edge-detector to implement J-K Flip-Flop Recall: When J and K are both HIGH, output is toggled to the opposite state. May be positive going or negative going clock trigger.

Positive edge triggered JK FF

Negative edge triggered JK FF

Example Wave Form: A J-K FF that responds to a NGT on its clock input and has active-low asynchronous inputs. Also look at the PRE and CLR of SN74HC74 D-FF, http://eng.umb.edu/~hzhang/e241/datasheets/dff%20-%20sn74hc74.pdf

Recall: SR Latch NOR and NAND implementations S (set) SR latch Q R (reset) Q S=0, R=0, then Q=Q prev S_bar=1, R_bar=1, then Q=Q prev Active low v.s. active high. They can be used for both implementations. Reset can also be called CLEAR. 107

J-K Flip-Flop by edge detector Internal Circuitry Recall: S_bar=1, R_bar=1, then Q=Q prev E.g., when J=1, K=0. Case 1: Q=1 Case 2: Q=0

More on D Flip-Flop - Implementation An edge-triggered D flip-flop can be implemented by adding a single INVERTER to the edge-triggered J-K flipflop.

More Flip-Flop Applications Examples of applications: Storing binary data Counting Transferring binary data between locations Many FF applications are categorized sequential. Output follows a predetermined sequence of states.

Flip-Flop Synchronization Most systems are primarily synchronous in operation in that changes depend on the clock. Asynchronous and synchronous operations are often combined frequently through human input. The random nature of asynchronous inputs can result in unpredictable results. The asynchronous signal A can produce partial pulses at X. Suppose we turn on switch to let clock signal to pass through AND gate

An edge-triggered D flip-flop synchronizes the enabling of the AND gate to the NGTs of the clock. Flip-Flop Synchronization

Detecting an Input Sequence FFs provide features pure combinational logic gates do not in many situations, output activates only when inputs activate in a certain sequence This requires the storage characteristic of FFs. D flip-flop responds to a particular sequence of inputs. E.g., we want to make sure A should be high first before B signal passes through. To work properly, A must go HIGH, prior to B, by at least an amount of time equal to FF setup time.

Data Storage and Transfer FFs are commonly used for storage and transfer of binary data. Groups used for storage are registers. Data transfers take place when data is moved between registers or FFs. Synchronous transfers take place at clock PGT/NGT. Asynchronous transfers are controlled by PRE (or PRE_bar) & CLR (or CLR_bar).

Data Storage and Transfer Synchronous inputs are used to perform the transfer.

Data Storage and Transfer Asynchronous Asynchronous data transfer operation. PRE_bar and CLR_bar inputs are used to perform the transfer. If transfer enable is low, PRE_bar and CLR_bar are high, output of the second JK FF responds to its JK inputs normally. If transfer enable is high, either PRE_bar or CLR_bar is low (the other is high) depending on A and A. Assume A=1, then B is immediately set to 1, which means we asynchronously transfer bit A to bit B.

Data Storage and Transfer Parallel Transferring the bits of a register simultaneously is a parallel transfer.

Serial Data Transfer Shift Register A shift register is a group of FFs arranged so the binary numbers stored in the FFs are shifted from one FF to the next, for every clock pulse. J-K flip-flops operated as a four-bit shift register. Transfer the bits of a register a bit at a time is a serial transfer.

Serial Data Transfer Shift Register Input data are shifted left to right from FF to FF as shift pulses are applied. J-K flip-flops operated as a fourbit shift register. 101 are shifted

Serial Data Transfer Shift Register Two connected three-bit shift registers. The contents of the X register will be serially transferred (shifted) into register Y. The D flip-flops in each shift register require fewer connections than J-K flip-flops.

Serial Data Transfer Shift Register Two connected three-bit shift registers. The complete transfer of the three bits of data requires three shift pulses.

Serial Data Transfer Shift Register Two connected three-bit shift registers. On each pulse NGT, each FF takes on the value stored in the FF on its left prior to the pulse.

Serial Data Transfer Shift Register Two connected three-bit shift registers. On each pulse NGT, each FF takes on the value stored in the FF on its left prior to the pulse.

Serial Data Transfer Shift Register Two connected three-bit shift registers. On each pulse NGT, each FF takes on the value stored in the FF on its left prior to the pulse.

Serial Data Transfer Shift Register Two connected three-bit shift registers. After three pulses: The 1 initially in X2 is in Y2. The 0 initially in X1 is in Y1. The 1 initially in X0 is in Y0. The 101 stored in the X register has now been shifted into the Y register. The X register has lost its original data, and is at 000.

Serial Data Transfer vs. Parallel FFs can easily be connected so that information shifts from right to left. No general advantage of one direction over another. Often dictated by the nature of the application. Parallel transfer requires more interconnections between sending & receiving registers than serial. More critical when a greater number of bits of are being transferred. Often, a combination of types is used Taking advantage of parallel transfer speed and serial transfer the economy and simplicity of serial transfer.

Timing Flip-flop samples D at clock edge D must be stable when sampled Similar to a photograph, D must be stable around clock edge Digital Design and Computer Architecture: ARM Edition 2015 Chapter 3 <127> 127

Output Timing Constraints Propagation delay: t pcq = longest time delay (after clock edge) that the output Q will become stable (i.e., to stop changing) Contamination delay: t ccq = time delay (after clock edge) that Q might start to change Q t ccq t pcq They represent the fastest and slowest delays through the circuit. Digital Design and Computer Architecture: ARM Edition 2015 Chapter 3 <128> 128

Input Timing Constraints Setup time: t setup = time before clock edge data must be stable (i.e. not changing) Hold time: t hold = time after clock edge data must be stable Aperture time: t a = time around clock edge data must be stable (t a = t setup + t hold ) D t setup t hold in Digital order Design for the and circuit Computer to Architecture: sample its ARM input Edition at a clock 2015edge correctly. Chapter 3 <129> t a Aperture time is the total time interval during which the circuit has to be stable 129

Dynamic Discipline Synchronous sequential circuit inputs must be stable during aperture (setup and hold) time around clock edge Specifically, inputs must be stable at least t setup before the clock edge at least until t hold after the clock edge We are only concerned about the final values of the inputs at the time they are sampled, so we can treat signals as discrete in time. Digital Design and Computer Architecture: ARM Edition 2015 Chapter 3 <130> 130

Dynamic Discipline The delay between registers has a minimum and maximum delay, dependent on the delays of the circuit elements (a) Q1 D2 (b) R1 Q1 C L T c D2 R2 Here we focus on the generic path in the figure. T C is clock period or cycle time. We try to find the timing constraints for R2, in terms of setup time and hold time, the timing characteristics of registers and the combinational logic. Digital Design and Computer Architecture: ARM Edition 2015 Chapter 3 <131> 131

Setup Time Constraint Depends on the maximum delay from register R1 through combinational logic to R2, in terms of change of the output of R1 which becomes of the input of R2. The input to register R2 must be stable at least t setup before next clock edge Q1 C L D2 T c R1 R2 T c Q1 D2 t pcq t pd t setup Digital Design and Computer Architecture: ARM Edition 2015 Chapter 3 <132> 132

Setup Time Constraint Depends on the maximum delay from register R1 through combinational logic to R2, in terms of change of the output of R1 which becomes of the input of R2. The input to register R2 must be stable at least t setup before next clock edge Q1 C L D2 T c t pcq + t pd + t setup R1 R2 T c Q1 D2 t pcq t pd t setup Digital Design and Computer Architecture: ARM Edition 2015 Chapter 3 <133> 133

Setup Time Constraint Depends on the maximum delay from register R1 through combinational logic to R2 The input to register R2 must be stable at least t setup before next clock edge R1 Q1 C L D2 R2 T c t pcq + t pd + t setup t pd T c (t pcq + t setup ) T c Setup time or max-delay constraint Q1 D2 t pcq t pd t setup Digital Design and Computer Architecture: ARM Edition 2015 (t pcq + t setup ): sequencing overhead, it reduces the time interval t pd for Chapter 3 <134> useful computation. 134

Hold Time Constraint Depends on the minimum delay from register R1 through the combinational logic to R2 The input to register R2 must be stable for at least t hold after the clock edge Q1 D2 R1 Q1 C L D2 R2 t hold < t ccq t cd t hold Digital Design and Computer Architecture: ARM Edition 2015 Chapter 3 <135> 135

Hold Time Constraint Depends on the minimum delay from register R1 through the combinational logic to R2 The input to register R2 must be stable for at least t hold after the clock edge Q1 C L D2 R1 Q1 D2 R2 t hold < t ccq + t cd t ccq t cd t hold Digital Design and Computer Architecture: ARM Edition 2015 Chapter 3 <136> 136

Hold Time Constraint Depends on the minimum delay from register R1 through the combinational logic to R2 The input to register R2 must be stable for at least t hold after the clock edge Q1 C L D2 Q1 R1 R2 t hold < t ccq + t cd t cd > t hold - t ccq D2 t ccq t cd hold time or min-delay constraint t hold Digital Design and Computer Architecture: ARM Edition 2015 Chapter 3 <137> 137

Consider an extreme case t hold < t ccq A reliable flip-flop must have a hold time shorter than its contamination delay. Usually t hold is zero, so we ignore it usually. Digital Design and Computer Architecture: ARM Edition 2015 Chapter 3 <138> 138

T c t pcq + t pd + t setup t pd T c (t pcq + t setup ) t hold < t ccq + t cd t cd > t hold - t ccq Sequential circuits setup time and hold time constraints specifies the max (t pd ) and min (t cd ) delays of the combinational logic between flipflops. Digital Design and Computer Architecture: ARM Edition 2015 Chapter 3 <139> 139

Timing Analysis Example 1ps= 10^(-12)s A B Timing Characteristics t ccq = 30 ps t pcq = 50 ps t setup = 60 ps t hold = 70 ps C D X' Y' X Y per gate t pd t cd = 35 ps = 25 ps t pd = 3 x 35 ps = 105 ps t cd = 25 ps Setup time constraint: T c? Hold time constraint: t ccq + t cd > t hold? Digital Design and Computer Architecture: ARM Edition 2015 Chapter 3 <140> 140

Timing Analysis Example 1ps= 10^(-12)s A B Timing Characteristics t ccq = 30 ps t pcq = 50 ps t setup = 60 ps t hold = 70 ps C D X' Y' X Y per gate t pd t cd = 35 ps = 25 ps t pd = 3 x 35 ps = 105 ps t cd = 25 ps Setup time constraint: T c (50 + 105 + 60) ps = 215 ps f c = 1/T c = 4.65 GHz Hold time constraint: t ccq + t cd > t hold? (30 + 25) ps > 70 ps? No! Digital Design and Computer Architecture: ARM Edition 2015 Chapter 3 <141> 141

Timing Analysis Example Add buffers to the short paths: A B Timing Characteristics t ccq = 30 ps t pcq = 50 ps t setup = 60 ps t hold = 70 ps C D X' Y' X Y per gate t pd t cd = 35 ps = 25 ps t pd = 3 x 35 ps = 105 ps t cd = 2 x 25 ps = 50 ps Setup time constraint: T c? Hold time constraint: t ccq + t cd > t hold? Digital Design and Computer Architecture: ARM Edition 2015 Chapter 3 <142> 142

Timing Analysis Example Add buffers to the short paths: A B Timing Characteristics t ccq = 30 ps t pcq = 50 ps t setup = 60 ps t hold = 70 ps C D X' Y' X Y per gate t pd t cd = 35 ps = 25 ps t pd = 3 x 35 ps = 105 ps t cd = 2 x 25 ps = 50 ps Setup time constraint: T c (50 + 105 + 60) ps = 215 ps f c = 1/T c = 4.65 GHz Hold time constraint: t ccq + t cd > t hold? (30 + 50) ps > 70 ps? Yes! Digital Design and Computer Architecture: ARM Edition 2015 Chapter 3 <143> 143

Clock Skew The clock doesn t arrive at all registers at same time Skew: difference between two clock edges Perform worst case analysis to guarantee dynamic discipline is not violated for any register many registers in a system! delay Skew reasons: Wires of different lengths. Noise in wires. Clock gating. 1 2 1 R1 t skew Digital Design and Computer Architecture: ARM Edition 2015 Q1 C L D2 R2 2 Chapter 3 <144> 144

Setup Time Constraint with Skew In the worst case, 2 is earlier than 1 1 R1 Q1 C L T c D2 2 R2 1 2 T c? Q1 D2 t pcq t pd t setup t skew R1 receives the latest skewed clock and R2 receives the earliest Digital skewed Design and clock. Computer Architecture: ARM Edition 2015 Chapter 3 <145> 145

Setup Time Constraint with Skew In the worst case, 2 is earlier than 1 1 R1 Q1 C L T c D2 2 R2 1 2 T c t pcq + t pd + t setup + t skew Q1 D2 t pcq t pd t setup t skew Digital Design and Computer Architecture: ARM Edition 2015 Chapter 3 <146> 146

Setup Time Constraint with Skew In the worst case, 2 is earlier than 1 1 R1 Q1 C L T c D2 2 R2 1 2 Q1 T c t pcq + t pd + t setup + t skew t pd T c (t pcq + t setup + t skew ) D2 t pcq t pd t setup t skew Digital Design and Computer Architecture: ARM Edition 2015 Chapter 3 <147> 147

Hold Time Constraint with Skew In the worst case, 2 is later than 1 1 2 Q1 C D2 L R1 R2 1 2 Q1 D2 t ccq t cd t skew t hold R1 receives the earliest skewed clock and R2 receives the latest Digital skewed Design and clock. Computer Architecture: ARM Edition 2015 Chapter 3 <148> 148

Hold Time Constraint with Skew In the worst case, 2 is later than 1 1 2 Q1 C D2 L R1 R2 1 2 Q1 t ccq + t cd > t hold + t skew D2 t ccq t cd t skew t hold Digital Design and Computer Architecture: ARM Edition 2015 Chapter 3 <149> 149

Hold Time Constraint with Skew In the worst case, 2 is later than 1 1 2 Q1 C D2 L R1 R2 1 2 Q1 D2 t ccq + t cd > t hold + t skew t cd > t hold + t skew t ccq t ccq t cd t skew t hold In summary, clock skew effectively increases both the setup time and hold time, It adds to the sequencing overhead. and reduces useful time of comb. Logic. It increases required minimum delay thru comb logic. Even if t hold =0, two back-toback flip-flops Digital Design will and have Computer hold time Architecture: failure ARM if t ccq Edition <t skew 2015 Chapter 3 <150> 150

Example problem Timing Characteristics t ccq = 50 ps t pcq = 70 ps t setup = 60 ps t hold = 20 ps Each XOR gate t pd = 100 ps = 55 ps t cd If no clock skew, what is the max operating frequency of the circuit? How much clock skew can the circuit tolerate if it must operate at 2 GHz? How much clock skew can the circuit tolerate before it might experience a hold time violation? 151