CPE100: Digital Logic Design I

Similar documents
Chapter 3. Digital Design and Computer Architecture, 2 nd Edition. David Money Harris and Sarah L. Harris. Chapter 3 <1>

Chapter 3. Chapter 3 :: Topics. Introduction. Sequential Circuits

Finite State Machine (FSM)

CPE100: Digital Logic Design I

Synchronous Sequential Circuit Design. Digital Computer Design

CPE100: Digital Logic Design I

Different encodings generate different circuits

ALU, Latches and Flip-Flops

Lecture 10: Sequential Networks: Timing and Retiming

Timing Constraints in Sequential Designs. 63 Sources: TSR, Katz, Boriello & Vahid

Ch 7. Finite State Machines. VII - Finite State Machines Contemporary Logic Design 1

Synchronous Sequential Logic

CSE140: Components and Design Techniques for Digital Systems. Midterm Information. Instructor: Mohsen Imani. Sources: TSR, Katz, Boriello & Vahid

Sequential Logic. Handouts: Lecture Slides Spring /27/01. L06 Sequential Logic 1

Memory Elements I. CS31 Pascal Van Hentenryck. CS031 Lecture 6 Page 1

ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN. Week 7 Dr. Srinivas Shakkottai Dept. of Electrical and Computer Engineering

6. Finite State Machines

Sequential vs. Combinational

Synchronous Sequential Circuit Design. Dr. Ehab A. H. AL-Hialy Page 1

Jin-Fu Li Advanced Reliable Systems (ARES) Lab. Department of Electrical Engineering. Jungli, Taiwan

CSE140: Design of Sequential Logic

Lecture 10: Synchronous Sequential Circuits Design

Sequential Circuit Design

ELEC Digital Logic Circuits Fall 2014 Sequential Circuits (Chapter 6) Finite State Machines (Ch. 7-10)

Example: vending machine

Chapter 7 Sequential Logic

Sequential Logic. Road Traveled So Far

Digital Design. Sequential Logic

ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN. Week 9 Dr. Srinivas Shakkottai Dept. of Electrical and Computer Engineering

Digital Electronics Sequential Logic

Sequential Logic Worksheet

Lecture 7: Sequential Networks

King Fahd University of Petroleum and Minerals College of Computer Science and Engineering Computer Engineering Department

EGR224 F 18 Assignment #4

CprE 281: Digital Logic

Lecture 14: State Tables, Diagrams, Latches, and Flip Flop

Homework #4. CSE 140 Summer Session Instructor: Mohsen Imani. Only a subset of questions will be graded

ELCT201: DIGITAL LOGIC DESIGN

Lecture 7: Logic design. Combinational logic circuits

Topic 8: Sequential Circuits

Fundamentals of Computer Systems

Sequential logic and design

Adders, subtractors comparators, multipliers and other ALU elements

Sequential Logic Circuits

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

Sequential Circuits. Circuits with state. Silvina Hanono Wachman Computer Science & Artificial Intelligence Lab M.I.T. L06-1

Fundamentals of Digital Design

ENGG 1203 Tutorial. Solution (b) Solution (a) Simplification using K-map. Combinational Logic (II) and Sequential Logic (I) 8 Feb Learning Objectives

Integrated Circuits & Systems

Digital Logic and Design (Course Code: EE222) Lecture 19: Sequential Circuits Contd..

EECS Components and Design Techniques for Digital Systems. FSMs 9/11/2007

State & Finite State Machines

UNIVERSITY OF BOLTON SCHOOL OF ENGINEERING BENG (HONS) ELECTRICAL & ELECTRONICS ENGINEERING EXAMINATION SEMESTER /2017

State and Finite State Machines

Sequential Synchronous Circuit Analysis

Synchronous Sequential Circuit

ALU A functional unit

Combinational vs. Sequential. Summary of Combinational Logic. Combinational device/circuit: any circuit built using the basic gates Expressed as

Last lecture Counter design Finite state machine started vending machine example. Today Continue on the vending machine example Moore/Mealy machines

State & Finite State Machines

Appendix A: Digital Logic. Principles of Computer Architecture. Principles of Computer Architecture by M. Murdocca and V. Heuring

Appendix B. Review of Digital Logic. Baback Izadi Division of Engineering Programs

Lecture 3 Review on Digital Logic (Part 2)

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

Adders, subtractors comparators, multipliers and other ALU elements

Chapter 4. Sequential Logic Circuits

The Design Procedure. Output Equation Determination - Derive output equations from the state table

Chapter 14 Sequential logic, Latches and Flip-Flops

14.1. Unit 14. State Machine Design

EXPERIMENT Traffic Light Controller

CSE 140 Midterm 2 - Solutions Prof. Tajana Simunic Rosing Spring 2013

Synchronous Sequential Circuit Design

BER KELEY D AV IS IR VINE LOS AN GELES RIVERS IDE SAN D IEGO S AN FRANCISCO

Lecture 13: Sequential Circuits, FSM

Models for representing sequential circuits

Boolean Algebra and Digital Logic 2009, University of Colombo School of Computing

Finite State Machine (1A) Young Won Lim 6/9/18

Designing Sequential Logic Circuits

Generalized FSM model: Moore and Mealy

LOGIC CIRCUITS. Basic Experiment and Design of Electronics

Y. Tsiatouhas. VLSI Systems and Computer Architecture Lab

Design of Datapath Controllers

Digital Circuits and Systems

Sequential Circuits Sequential circuits combinational circuits state gate delay

5. Sequential Logic x Computation Structures Part 1 Digital Circuits. Copyright 2015 MIT EECS

I. Motivation & Examples

COEN 312 DIGITAL SYSTEMS DESIGN - LECTURE NOTES Concordia University

Digital Logic: Boolean Algebra and Gates. Textbook Chapter 3

Problem Set 9 Solutions

Fundamentals of Computer Systems

Digital Logic Design - Chapter 4

ENGG 1203 Tutorial _03 Laboratory 3 Build a ball counter. Lab 3. Lab 3 Gate Timing. Lab 3 Steps in designing a State Machine. Timing diagram of a DFF

FYSE420 DIGITAL ELECTRONICS

EE40 Lec 15. Logic Synthesis and Sequential Logic Circuits

Computers also need devices capable of Storing data and information Performing mathematical operations on such data

EEE2135 Digital Logic Design

Sequential Circuit Analysis

CSE140: Digital Logic Design Registers and Counters

Adders allow computers to add numbers 2-bit ripple-carry adder

Memory, Latches, & Registers

Transcription:

Chapter 3 Professor Brendan Morris, SEB 3216, brendan.morris@unlv.edu http://www.ee.unlv.edu/~b1morris/cpe1/ CPE1: Digital Logic Design I Section 14: Dr. Morris Sequential Logic Design Chapter 3 <1>

Chapter 3 :: Topics Introduction Latches and Flip-Flops Synchronous Logic Design Finite State Machines Timing of Sequential Logic Parallelism Chapter 3 <2>

Introduction Previously, Combinational Logic design had outputs only depend on current value of inputs Outputs of sequential logic depend on current and prior input values it has memory. Some definitions: State: all the information about a circuit necessary to explain its future behavior Latches and flip-flops: state elements that store one bit of state Synchronous sequential circuits: combinational logic followed by a bank of flip-flops Chapter 3 <3>

Sequential Circuits Give sequence to events (i.e. a notion of time) Have memory (short-term) Use feedback from output to input to store information Need to remember past output Chapter 3 <4>

State Elements The state of a circuit influences its future behavior State elements store state Bistable circuit SR Latch D Latch D Flip-flop Chapter 3 <5>

Bistable Circuit Fundamental building block of other state elements Two outputs:, (state) No inputs 1 I2 I1 1 1 I1 I2 Chapter 3 <6> Redrawn circuit to emphasize symmetry

Bistable Circuit Analysis Consider the two possible cases: = : then = 1, = (consistent) 1 I1 I2 1 Chapter 3 <7>

Bistable Circuit Analysis Consider the two possible cases: = : then = 1, = (consistent) 1 I1 I2 1 = 1: then =, = 1 (consistent) I1 1 1 I2 Stores 1 bit of state in the state variable, (or ) But there are no inputs to control the state Chapter 3 <8>

SR (Set/Reset) Latch SR Latch S set =1 R N1 R reset = S N2 Chapter 3 <9>

SR (Set/Reset) Latch SR Latch R N1 S N2 Consider the four possible cases: S = 1, R = S =, R = 1 S =, R = S = 1, R = 1 Chapter 3 <1>

SR Latch Analysis S = 1, R = : then = 1 and = R N1 1 S 1 N2 Chapter 3 <11>

SR Latch Analysis S = 1, R = : then = 1 and = R N1 1 S 1 N2 Chapter 3 <12>

SR Latch Analysis S = 1, R = : then = 1 and = R N1 1 S 1 N2 S =, R = 1: then = and = 1 R 1 1 N1 S N2 1 Chapter 3 <13>

SR Latch Analysis S = 1, R = : then = 1 and = Set the output R S 1 N1 N2 1 S =, R = 1: then = and = 1 Reset the output R S 1 1 N1 N2 1 Chapter 3 <14>

SR Latch Analysis S =, R = : prev = prev = 1 then = prev R N1 R N1 1 S N2 S N2 Chapter 3 <15>

SR Latch Analysis S =, R = : prev = prev = 1 then = prev R N1 R N1 1 S N2 S N2 Chapter 3 <16>

SR Latch Analysis S =, R = : prev = prev = 1 then = prev R N1 R N1 1 S N2 S N2 S = 1, R = 1: then =, = R S 1 1 N1 N2 Chapter 3 <17>

SR Latch Analysis S =, R = : prev = prev = 1 then = prev R N1 R N1 1 S N2 S N2 S = 1, R = 1: then =, = R S 1 1 N1 N2 Chapter 3 <18>

SR Latch Analysis S =, R = : prev = prev = 1 then = prev Memory! R N1 R N1 S N2 S N2 S = 1, R = 1: then =, = Invalid State NOT R S 1 1 N1 N2 Chapter 3 <19>

SR Latch Symbol SR stands for Set/Reset Latch Stores one bit of state () Control what value is being stored with S, R inputs Set: Make the output 1 (S = 1, R =, = 1) Reset: Make the output (S =, R = 1, = ) SR Latch Symbol R S Chapter 3 <2>

D Latch Two inputs:, D : controls when the output changes D (the data input): controls what the output changes to Function When = 1, D passes through to (transparent) When =, holds its previous value (opaque) Avoids invalid case when NOT Chapter 3 <21> D Latch Symbol D

D Latch Internal Circuit D R R D S S D D X 1 1 1 D S R Chapter 3 <22>

D Latch Internal Circuit D R R D S S D D X 1 1 1 D X 1 S R prev 1 1 1 1 prev Chapter 3 <23>

D Flip-Flop Inputs:, D Function Samples D on rising edge of When rises from to 1, D passes through to Otherwise, holds its previous value changes only on rising edge of Called edge-triggered Activated on the clock edge D D Flip-Flop Symbols Chapter 3 <24>

D Flip-Flop Internal Circuit Two back-to-back latches (L1 and L2) controlled by complementary clocks When = L1 is transparent L2 is opaque D passes through to N1 D D L1 N1 D L2 Chapter 3 <25>

D Flip-Flop Internal Circuit Two back-to-back latches (L1 and L2) controlled by complementary clocks When = L1 is transparent L2 is opaque D passes through to N1 When = 1 L2 is transparent L1 is opaque N1 passes through to D D L1 N1 D L2 Chapter 3 <26>

D Flip-Flop Internal Circuit Two back-to-back latches (L1 and L2) controlled by complementary clocks When = L1 is transparent L2 is opaque D passes through to N1 When = 1 L2 is transparent L1 is opaque N1 passes through to D D L1 N1 D L2 Thus, on the edge of the clock (when rises from 1) D passes through to Chapter 3 <27>

D Latch vs. D Flip-Flop D D D (latch) (flop) Chapter 3 <28>

D Latch vs. D Flip-Flop D D D (latch) (flop) Chapter 3 <29>

Review SR Latch Symbol SR Latch D Latch D Flip-flop R D D S S = 1, R = : = 1 S =, R= 1: = = 1: = D = : = prev = 1: = D Otherwise: = prev Chapter 3 <3>

Registers D D D 1 D 1 D 3: 4 4 3: D 2 D 2 D 3 D 3 Chapter 3 <31>

Enabled Flip-Flops Inputs:, D, EN The enable input (EN) controls when new data (D) is stored Function EN = 1: D passes through to on the clock edge EN = : the flip-flop retains its previous state EN Internal Circuit Symbol D 1 D D EN Chapter 3 <32>

Enabled Flip-Flops Inputs:, D, EN The enable input (EN) controls when new data (D) is stored Function EN = 1: D passes through to on the clock edge EN = : the flip-flop retains its previous state EN Internal Circuit Symbol D 1 D D EN Chapter 3 <33>

Resettable Flip-Flops Inputs:, D, Reset Function: Reset = 1: is forced to Reset = : flip-flop behaves as ordinary D flip-flop Symbols D Reset r Chapter 3 <34>

Resettable Flip-Flops Two types: Synchronous: resets at the clock edge only Asynchronous: resets immediately when Reset = 1 Asynchronously resettable flip-flop requires changing the internal circuitry of the flip-flop Synchronously resettable flip-flop? Chapter 3 <35>

Resettable Flip-Flops Two types: Synchronous: resets at the clock edge only Asynchronous: resets immediately when Reset = 1 Asynchronously resettable flip-flop requires changing the internal circuitry of the flip-flop Synchronously resettable flip-flop? Internal Circuit D Reset D Chapter 3 <36>

Settable Flip-Flops Inputs:, D, Set Function: Set = 1: is set to 1 Set = : the flip-flop behaves as ordinary D flipflop Symbols D Set s Chapter 3 <37>

Synchronous Sequential Logic Design Registers inserted between combinational logic Registers contain state of the system State changes at clock edge: system synchronized to the clock Chapter 3 <38>

Synchronous Sequential Logic Design Rules of synchronous sequential circuit composition: Every circuit element is either a register or a combinational circuit At least one circuit element is a register All registers receive the same clock signal Every cyclic path contains at least one register Chapter 3 <39>

Synchronous Sequential Logic Design Rules of synchronous sequential circuit composition: Every circuit element is either a register or a combinational circuit At least one circuit element is a register All registers receive the same clock signal Every cyclic path contains at least one register Two common synchronous sequential circuits Finite State Machines (FSMs) Pipelines Chapter 3 <4>

Finite State Machine (FSM) Consists of: State register Stores current state Loads next state at clock edge Combinational logic Computes the next state Computes the outputs S S Next State Current State Next State Logic Output Logic C L Next State C L Outputs Chapter 3 <41>

Finite State Machines (FSMs) Next state determined by current state and inputs Two types of finite state machines differ in output logic: Moore FSM: outputs depend only on current state Mealy FSM: outputs depend on current state and inputs Moore FSM inputs M next state logic k next state k state output logic N outputs Mealy FSM inputs M next state logic k next state k state output logic N outputs Chapter 3 <42>

FSM Design Procedure 1. Identify inputs and outputs 2. Sketch state transition diagram 3. Write state transition table 4. Select state encodings 5. Rewrite state transition table with state encodings 6. Write output table 7. Write Boolean equations for next state and output logic 8. Sketch the circuit schematic Chapter 3 <43>

Bravado Blvd. FSM Example Traffic light controller Traffic sensors: T A, T B (TRUE when there s traffic) Lights: L A, L B Dining Hall L B L A T B L A Academic T A T A Ave. Labs T B L B Dorms Fields Chapter 3 <44>

FSM Design Procedure 1. Identify inputs and outputs 2. Sketch state transition diagram 3. Write state transition table 4. Select state encodings 5. Rewrite state transition table with state encodings 6. Write output table 7. Write Boolean equations for next state and output logic 8. Sketch the circuit schematic Chapter 3 <45>

FSM Black Box Inputs:, Reset, T A, T B Outputs: L A, L B Note: multiple bits for output T A T B Traffic Light Controller L A L B Reset Chapter 3 <46>

FSM Design Procedure 1. Identify inputs and outputs 2. Sketch state transition diagram 3. Write state transition table 4. Select state encodings 5. Rewrite state transition table with state encodings 6. Write output table 7. Write Boolean equations for next state and output logic 8. Sketch the circuit schematic Chapter 3 <47>

Bravado Blvd. FSM State Transition Diagram Moore FSM: outputs labeled in each state States: Circles Transitions: Arcs Dining Hall Reset S L A : green L B : red L B L A T B L A Academic T A T A Ave. Labs T B L B Dorms Fields Chapter 3 <48>

Bravado Blvd. FSM State Transition Diagram Moore FSM: outputs labeled in each state States: Circles Transitions: Arcs Dining Hall Reset S L A : green L B : red T A TA S1 L A : yellow L B : red L B L A T B L A Academic Labs T A T B T A L B Ave. Dorms S3 L A : red L B : yellow S2 L A : red L B : green Fields T B T B Chapter 3 <49>

FSM Design Procedure 1. Identify inputs and outputs 2. Sketch state transition diagram 3. Write state transition table 4. Select state encodings 5. Rewrite state transition table with state encodings 6. Write output table 7. Write Boolean equations for next state and output logic 8. Sketch the circuit schematic Chapter 3 <5>

FSM State Transition Table Reset T A TA Current State Inputs Next State S T A T B S' S L A : green L B : red S3 L A : red L B : yellow T B T B S1 L A : yellow L B : red S2 L A : red L B : green S X S 1 X S1 X X S2 X S2 X 1 S3 X X Chapter 3 <51>

FSM State Transition Table Reset T A TA Current State Inputs Next State S T A T B S' S L A : green L B : red S3 L A : red L B : yellow T B T B S1 L A : yellow L B : red S2 L A : red L B : green S X S1 S 1 X S S1 X X S2 S2 X S3 S2 X 1 S2 S3 X X S Chapter 3 <52>

FSM Design Procedure 1. Identify inputs and outputs 2. Sketch state transition diagram 3. Write state transition table 4. Select state encodings 5. Rewrite state transition table with state encodings 6. Write output table 7. Write Boolean equations for next state and output logic 8. Sketch the circuit schematic Chapter 3 <53>

FSM Encoded State Transition Table Current State Inputs Next State S 1 S T A T B S' 1 S' X 1 X 1 X X 1 X 1 X 1 1 1 X X State Encoding S S1 1 S2 1 S3 11 Two bits required for 4 states Reset S L A : green L B : red T A TA S1 L A : yellow L B : red Chapter 3 <54> S3 L A : red L B : yellow T B T B S2 L A : red L B : green

FSM Encoded State Transition Table Current State Inputs Next State S 1 S T A T B S' 1 S' X 1 1 X 1 X X 1 1 X 1 1 1 X 1 1 1 1 X X State Encoding S S1 1 S2 1 S3 11 Two bits required for 4 states S' 1 = S 1 S Reset S L A : green L B : red T A TA S1 L A : yellow L B : red S' = S 1 S T A + S 1 S T B Chapter 3 <55> S3 L A : red L B : yellow T B T B S2 L A : red L B : green

FSM Design Procedure 1. Identify inputs and outputs 2. Sketch state transition diagram 3. Write state transition table 4. Select state encodings 5. Rewrite state transition table with state encodings 6. Write output table 7. Write Boolean equations for next state and output logic 8. Sketch the circuit schematic Chapter 3 <56>

FSM Output Table Current State Outputs S 1 S L A1 L A L B1 L B 1 1 1 1 Output Encoding green yellow 1 red 1 Two bits required for 3 outputs Reset S L A : green L B : red T A TA S1 L A : yellow L B : red Chapter 3 <57> S3 L A : red L B : yellow T B T B S2 L A : red L B : green

FSM Output Table Current State Outputs S 1 S L A1 L A L B1 L B 1 1 1 1 1 1 1 1 1 1 Output Encoding green yellow 1 red 1 Two bits required for 3 outputs L A1 = S 1 L A = S 1 S L B1 = S 1 Reset S L A : green L B : red T A TA S1 L A : yellow L B : red L B = S 1 S Chapter 3 <58> S3 L A : red L B : yellow T B T B S2 L A : red L B : green

FSM Design Procedure 1. Identify inputs and outputs 2. Sketch state transition diagram 3. Write state transition table 4. Select state encodings 5. Rewrite state transition table with state encodings 6. Write output table 7. Write Boolean equations for next state and output logic 8. Sketch the circuit schematic Chapter 3 <59>

FSM Schematic: State Register S' 1 S 1 S' r Reset S state register S' 1 = S 1 S L A1 = S 1 L B1 = S 1 S' = S 1 S T A + S 1 S T B L A = S 1 S L B = S 1 S Chapter 3 <6>

FSM Schematic: Next State Logic S' 1 S 1 T A T B S' r Reset S S 1 S inputs next state logic state register S' 1 = S 1 S S' = S 1 S T A + S 1 S T B Chapter 3 <61>

FSM Schematic: Output Logic L A1 S' 1 S 1 L A T A S' r S L B1 T B Reset S 1 S L B inputs next state logic state register output logic outputs L A1 = S 1 L B1 = S 1 L A = S 1 S L B = S 1 S Chapter 3 <62>

FSM Timing Diagram Cycle 1 Cycle 2 Cycle 3 Cycle 4 Cycle 5 Cycle 6 Cycle 7 Cycle 8 Cycle 9 Cycle 1 Reset T A T B S' 1:?? S () S1 (1) S2 (1) S3 (11) S () S1 (1) S 1:?? S () S1 (1) S2 (1) S3 (11) S () L A1:?? Green () Yellow (1) Red (1) Green () L B1:?? Red (1) Green () Yellow (1) Red (1) 5 1 15 2 25 3 35 4 45 t (sec) Reset S L A : green L B : red T A TA S1 L A : yellow L B : red S3 L A : red L B : yellow T B T B S2 L A : red L B : green Chapter 3 <63>

FSM State Encoding Binary encoding: i.e., for four states,, 1, 1, 11 One-hot encoding One state bit per state Only one state bit HIGH at once i.e., for 4 states, 1, 1, 1, 1 Requires more flip-flops Often next state and output logic is simpler Chapter 3 <64>

FSM Design Procedure 1. Identify inputs and outputs 2. Sketch state transition diagram 3. Write state transition table 4. Select state encodings 5. Rewrite state transition table with state encodings 6. Write output table 7. Write Boolean equations for next state and output logic 8. Sketch the circuit schematic Chapter 3 <65>

FSM Problems 1. Design a circuit to detect 3 or more 1 s in a row in a bit stream 2. Vending machine: Release an item after receiving 15 cents Single coin slot but tells if you put in dime or nickel No change given 1. Identify inputs and outputs 2. Sketch state transition diagram 3. Write state transition table 4. Select state encodings 5. Rewrite state transition table with state encodings 6. Write output table 7. Write Boolean equations for next state and output logic 8. Sketch the circuit schematic Chapter 3 <66>

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 Moving right before or after shutter click results in blurry photo If not, metastability can occur Chapter 3 <67>

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 t a Chapter 3 <68>

Output Timing Constraints Propagation delay: t pcq = time after clock edge that the output is guaranteed to be stable (i.e., to stop changing) Contamination delay: t ccq = time after clock edge that might be unstable (i.e., start changing) t ccq t pcq Chapter 3 <69>

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 Previously, static discipline: With logically valid inputs, every circuit element must produce logically valid outputs Chapter 3 <7>

Dynamic Discipline The delay between registers has a minimum and maximum delay, dependent on the delays of the circuit elements 1 C L D2 (a) R1 R2 T c 1 D2 (b) Chapter 3 <71>

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 clock edge 1 C L D2 T c R1 R2 T c 1 D2 t pcq t pd t setup Chapter 3 <72>

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 clock edge R1 1 C L T c D2 R2 T c t pcq + t pd + t setup t pd 1 D2 t pcq t pd t setup Chapter 3 <73>

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 clock edge R1 1 C L T c D2 R2 T c t pcq + t pd + t setup t pd T c (t pcq + t setup ) 1 D2 (t pcq + t setup ): sequencing overhead t pcq t pd t setup Chapter 3 <74>

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 R1 1 C L D2 R2 t hold < 1 D2 t ccq t cd t hold Chapter 3 <75>

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 R1 1 D2 1 C L D2 R2 t hold < t ccq + t cd t cd > t ccq t cd t hold Chapter 3 <76>

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 1 D2 R1 1 C L D2 R2 t hold < t ccq + t cd t cd > t hold - t ccq t ccq t cd t hold Chapter 3 <77>

Timing Analysis A B C X' X Timing Characteristics t ccq t pcq = 3 ps = 5 ps t setup = 6 ps t hold = 7 ps D t pd = t cd = Setup time constraint: T c f c = Y' Y per gate t pd t cd Hold time constraint: t ccq + t cd > t hold? = 35 ps = 25 ps Chapter 3 <78>

Timing Analysis A B C X' X Timing Characteristics t ccq t pcq = 3 ps = 5 ps t setup = 6 ps t hold = 7 ps D t pd = 3 x 35 ps = 15 ps t cd = 25 ps Setup time constraint: T c (5 + 15 + 6) ps = 215 ps f c = 1/T c = 4.65 GHz Y' Y per gate t pd t cd = 35 ps = 25 ps Hold time constraint: t ccq + t cd > t hold? (3 + 25) ps > 7 ps? No! Chapter 3 <79>

Timing Analysis Add buffers to the short paths: A B C X' X Timing Characteristics t ccq t pcq = 3 ps = 5 ps t setup = 6 ps t hold = 7 ps D t pd = Y' Y per gate t pd t cd = 35 ps = 25 ps t cd = Setup time constraint: Hold time constraint: T c t ccq + t cd > t hold? f c = Chapter 3 <8>

Timing Analysis Add buffers to the short paths: A B C X' X Timing Characteristics t ccq t pcq = 3 ps = 5 ps t setup = 6 ps t hold = 7 ps D t pd = 3 x 35 ps = 15 ps Y' Y per gate t pd t cd = 35 ps = 25 ps t cd = 2 x 25 ps = 5 ps Setup time constraint: Hold time constraint: T c (5 + 15 + 6) ps = 215 ps t ccq + t cd > t hold? f c = 1/T c = 4.65 GHz (3 + 5) ps > 7 ps? Yes! Chapter 3 <81>

Parallelism Two types of parallelism: Spatial parallelism duplicate hardware performs multiple tasks at once Temporal parallelism task is broken into multiple stages also called pipelining for example, an assembly line Chapter 3 <82>

Parallelism Definitions Token: Group of inputs processed to produce group of outputs Latency: Time for one token to pass from start to end Throughput: Number of tokens produced per unit time Parallelism increases throughput Chapter 3 <83>

Parallelism Example Ben Bitdiddle bakes cookies to celebrate traffic light controller installation 5 minutes to roll cookies 15 minutes to bake What is the latency and throughput without parallelism? Chapter 3 <84>

Parallelism Example Ben Bitdiddle bakes cookies to celebrate traffic light controller installation 5 minutes to roll cookies 15 minutes to bake What is the latency and throughput without parallelism? Latency = 5 + 15 = 2 minutes = 1/3 hour Throughput = 1 tray/ 1/3 hour = 3 trays/hour Chapter 3 <85>

Parallelism Example What is the latency and throughput if Ben uses parallelism? Spatial parallelism: Ben asks Allysa P. Hacker to help, using her own oven Temporal parallelism: two stages: rolling and baking He uses two trays While first batch is baking, he rolls the second batch, etc. Chapter 3 <86>

Spatial Parallelism Latency: time to first tray 5 1 15 2 25 3 35 4 45 5 Spatial Parallelism Tray 1 Tray 2 Tray 3 Tray 4 Ben 1 Ben 1 Alyssa 1 Alyssa 1 Ben 2 Ben 2 Alyssa 2 Alyssa 2 Roll Bake Legend Time Latency =? Throughput =? Chapter 3 <87>

Spatial Parallelism Latency: time to first tray 5 1 15 2 25 3 35 4 45 5 Spatial Parallelism Tray 1 Tray 2 Tray 3 Tray 4 Ben 1 Ben 1 Alyssa 1 Alyssa 1 Ben 2 Ben 2 Alyssa 2 Alyssa 2 Roll Bake Legend Time Latency = 5 + 15 = 2 minutes = 1/3 hour Throughput = 2 trays/ 1/3 hour = 6 trays/hour Chapter 3 <88>

Temporal Parallelism Latency: time to first tray 5 1 15 2 25 3 35 4 45 5 Temporal Parallelism Tray 1 Tray 2 Tray 3 Ben 1 Ben 1 Ben 2 Ben 2 Ben 3 Ben 3 Time Latency =? Throughput =? Chapter 3 <89>

Temporal Parallelism Latency: time to first tray 5 1 15 2 25 3 35 4 45 5 Temporal Parallelism Tray 1 Tray 2 Tray 3 Ben 1 Ben 1 Ben 2 Ben 2 Ben 3 Ben 3 Time Latency = 5 + 15 = 2 minutes = 1/3 hour Throughput = 1 trays/ 1/4 hour = 4 trays/hour Using both spatial and temporal techniques, the throughput would be 8 trays/hour Chapter 3 <9>