Learning Outcomes. Unit 13. Sequential Logic BISTABLES, LATCHES, AND FLIP- FLOPS. I understand the difference between levelsensitive

Similar documents
Outcomes. Spiral 1 / Unit 6. Flip-Flops FLIP FLOPS AND REGISTERS. Flip-flops and Registers. Outputs only change once per clock period

Review of digital electronics. Storage units Sequential circuits Counters Shifters

ECE 545 Digital System Design with VHDL Lecture 2. Digital Logic Refresher Part B Sequential Logic Building Blocks

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

ECE 545 Digital System Design with VHDL Lecture 1B. Digital Logic Refresher Part B Sequential Logic Building Blocks

ECE 545 Digital System Design with VHDL Lecture 1. Digital Logic Refresher Part B Sequential Logic Building Blocks

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

EET2411 DIGITAL ELECTRONICS

Rangkaian Sekuensial. Flip-flop

LATCHES & FLIP-FLOP. Chapter 7

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

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

CSE140: Components and Design Techniques for Digital Systems. More D-Flip-Flops. Tajana Simunic Rosing. Sources: TSR, Katz, Boriello & Vahid

Logic Design. Flip Flops, Registers and Counters

Engr354: Digital Logic Circuits

Sequential Logic Counters and Registers

Logic Design ( Part 3) Sequential Logic- Finite State Machines (Chapter 3)

Problems with D-Latch

Latches, Flip-Flops, and Registers. Dr. Ouiem Bchir

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

Registers & Counters. Logic and Digital System Design - CS 303 Erkay Savaş Sabanci University

Digital Logic Design Sequential Circuits. Dr. Basem ElHalawany

Digital Circuits ECS 371

Chapter 5 Sequential Circuits

ASYNCHRONOUS SEQUENTIAL CIRCUIT CONCEPTS

Sequential circuits. Same input can produce different output. Logic circuit. William Sandqvist

`COEN 312 DIGITAL SYSTEMS DESIGN - LECTURE NOTES Concordia University

Sequential Circuits: Latches & Flip-Flops

6. Sequential Logic Flip-Flops

Registers & Counters. BME208 Logic Circuits Yalçın İŞLER

ESE 570 STATIC SEQUENTIAL CMOS LOGIC CELLS. Kenneth R. Laker, University of Pennsylvania, updated 25Mar15

EKT 121/4 ELEKTRONIK DIGIT 1

Fundamentals of Computer Systems

ECE 3401 Lecture 11. Sequential Circuits

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

ECE 25 Introduction to Digital Design. Chapter 5 Sequential Circuits ( ) Part 1 Storage Elements and Sequential Circuit Analysis

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

Chapter 5 Sequential Circuits

Chapter 11 Latches and Flip-Flops

Part 4: Introduction to Sequential Logic. Basic Sequential structure. Positive-edge-triggered D flip-flop. Flip-flops classified by inputs

Combinational vs Sequential

Sequential Circuit Design: Part 1

DIGITAL CIRCUIT LOGIC UNIT 11: SEQUENTIAL CIRCUITS (LATCHES AND FLIP-FLOPS)

Agenda. EE 260: Introduction to Digital Design Counters and Registers. Asynchronous (Ripple) Counters. Asynchronous (Ripple) Counters

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

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

Lecture 8: Sequential Logic

Digital Fundamentals: A Systems Approach

ELCT201: DIGITAL LOGIC DESIGN

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

Fundamentals of Computer Systems

Registers and Counters

Registers and Counters

Sequential Circuit Design: Part 1

Chapter 5 Sequential Systems. Introduction

Other Flip-Flops. Lecture 27 1

Synchronous Sequential Logic

CSC Computer Architecture and Organization

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

RS flip-flop using NOR gate

COMP sequential logic 1 Jan. 25, 2016

Registers, Register Transfers and Counters Dr. Fethullah Karabiber

Fundamentals of Computer Systems

MUX AND FLIPFLOPS/LATCHES

ELCT201: DIGITAL LOGIC DESIGN

Sequential Logic and Clocked Circuits

Topic 8. Sequential Circuits 1

The NOR latch is similar to the NAND latch

CHAPTER 1 LATCHES & FLIP-FLOPS

Chapter 6. sequential logic design. This is the beginning of the second part of this course, sequential logic.

Module 4:FLIP-FLOP. Quote of the day. Never think you are nothing, never think you are everything, but think you are something and achieve anything.

Chapter 3 Unit Combinational

UNIT III. Combinational Circuit- Block Diagram. Sequential Circuit- Block Diagram

CPS311 Lecture: Sequential Circuits

Logic Design ( Part 3) Sequential Logic (Chapter 3)

Spring 2017 EE 3613: Computer Organization Chapter 5: The Processor: Datapath & Control - 1

D Latch (Transparent Latch)

EECS150 - Digital Design Lecture 3 Synchronous Digital Systems Review. Announcements

SEQUENTIAL LOGIC. Satish Chandra Assistant Professor Department of Physics P P N College, Kanpur

UNIT-3: SEQUENTIAL LOGIC CIRCUITS

Sequential Design Basics

Advanced Devices. Registers Counters Multiplexers Decoders Adders. CSC258 Lecture Slides Steve Engels, 2006 Slide 1 of 20

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).

MC9211 Computer Organization

CHAPTER 4: Logic Circuits

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.

Principles of Computer Architecture. Appendix A: Digital Logic

FLIP-FLOPS AND RELATED DEVICES

CHAPTER 4: Logic Circuits

Flip-Flops and Sequential Circuit Design

Digital Circuit And Logic Design I. Lecture 8

Digital Circuit And Logic Design I

Unit 11. Latches and Flip-Flops

Last time, we saw how latches can be used as memory in a circuit

Experiment 8 Introduction to Latches and Flip-Flops and registers

Chapter 5 Synchronous Sequential Logic

(Refer Slide Time: 2:05)

Digital Fundamentals

Digital Design Lab EEN 315 Section H. Project #2 Add & Shift Multiplier. Group #6 Sam Drazin (Partner: Brian Grahn) Lucas Blanck, TA

Sequential Logic Circuit

Transcription:

1.1 1. Learning Outcomes Unit 1 I understand the difference between levelsensitive and edge-sensitive I understand how to create an edge-triggered FF from latches Sequential Logic onstructs 1. 1.4 Sequential Logic Suppose we have a sequence of input numbers on X[:] that are entered over that we want to sum up Possible solution: Route the outputs so we can add the current sum to the input X How sequential building blocks work BISTABLES, LATHES, AN FLIP- FLOPS X[:] 9,, A A B B S S 14,5, [:]

Sequential Logic 1.5 Sequential Logic 1.6 Suppose we have a sequence of input numbers on X[:] that are entered over that we want to sum up Possible solution: Route the outputs back to the inputs so we can add the current sum to the input X Problem 1: No way to Problem : Outputs can to inputs and be added more than once per input number 9,, Outputs can feedback to inputs and update them sum more than once per input X X Possible Solution A A B B S S Add logic at outputs to just capture and remember the new sum until we re ready to input the next number in the sequence This logic should remember (i.e. sequential logic) the sum and only update it when the next number arrives 9,, X X A A B B S S The data can still loop around and add up again (+=4) but if we just hold our output = then the feedback loop will be broken We remember initial sum of until input arrives at which point we d capture & remember the sum 5. Sequence 1.7 Sequence 1. If X changes then should also change once per cycle That is why we will use a to ensure the outputs can only update once per cycle X X A A B B 4 S S 1 lock lear The on lear will cause to be initialized to, but then can t change until the next positive edge That means we will just keep adding + = X X A A B B 4 S S 1 lock lear lock lear X 9

1.9 1.1 Sequence Sequence At the edge the flip-flops will sample the inputs and then remember until the next positive edge That means we will just keep adding + = 5 Finally, at the positive edge the flip-flops will sample the inputs and then remember 14 X X A A B B S S 4 1 5 lock lear X 9 X X A A B B S S 4 1 14 lock lear X 9 lock lear 5 lock lear 5 14 5 14 1.11 1.1 Sequential Logic -Latches But how do flip-flops work? Our first goal will be to design a circuit that can remember one bit of information Easiest approach The primary building block of sequential logic is a -Latch -Latches (ata latches) store/remember/hold data when the clock is and data when the clock is (LK= ) -Latch losed when LK=1 But how do you change the input? A signal should only have one driver LK losed when LK= These "switches" which can be closed or open are really transistors that can be on or off

1.1 1.14 Transparent & Hold Mode of -Latches -Latches Hold Mode The -Latch operates in either or mode based on the clock value x 1 1 1 1 1 Latch x 1 1 1 1 1 Hold Mode Transparent Mode Function Table escription of -Latch When lock = 1 When lock = LK LK Transparent Mode (= when LK=1) Hold Mode (= when LK=) When =1, outputs change based on inputs When =, outputs don t change no matter what the inputs do LK Latch -Latches Hold Mode x 1 1 1 1 1 Hold Mode Transparent Mode 1.15 Notation To show that remembers its value we can put it in the past tense: = (urrent Value of = Old Value of ) OR put it in the future tense * = (Next Value of = urrent Value of ) Indicates next-value of x 1 1 1 1 1 urrent Value = Old Value * * x 1 1 1 1 1 Next Value = urrent Value 1.16

1.17 1.1 What if we put -Latches at the outputs We ll change X on every clock period X X A A B B S S 1 lock X X A A B B S S 1 lock X lock When = => * = When =1 => * = 1.19 1. Since the clock starts off low, the outputs of the latches can t change and just hold at When the clock goes high the goes through to and is free to loop back around X X A A B B S S 1 lock X X X A A B B S S 1 lock X lock lock When = => * = When =1 => * = When = => * = When =1 => * =

1.1 1. Once it loops back around it will be added again, change the value and go through to and loop back around again This feedback loop continues until the clock goes low again 4 X X A A B B S S 4 1 4 lock X 4 6 X X A A B B S S 1 6 lock X 4 6 lock 4 lock 4 6 When = => * = When =1 => * = When = => * = When =1 => * = 1. 1.4 When the clock goes low again, the outputs will hold at their current value until the clock goes high When the clock goes high, the outputs will be free to change and we will get the feedback problem X X A A B B S S 11 1 lock X 4 6 11 X X A A B B S S 11 1 lock X 4 6 11 14 17 lock 4 6 lock 4 6 11 14 17 When = => * = When =1 => * = When = => * = When =1 => * =

1.5 1.6 Latches clearly don t work The goal should be to get one changeof the outputs per clock period X X A A B B S S 11 1 lock X 4 6 11 14 17 FLIP-FLOPS lock 4 6 11 14 17 When = => * = When =1 => * = 1.7 1. Flip-Flops vs. Latches Flip-Flops Latches Asynchronous lock/enable input Level Sensitive Outputs can change any lock = 1 Flip-Flops Synchronous lock Input Edge-Sensitive Outputs change only on the positive (negative) edges hange Latches to Flip-Flops -Latch -FF LK Triangle at clock input indicates edgesensitive FF -Latch -FF LK LK

1.9 1. Flip-Flops Positive-Edge Triggered -FF To indicate negative-edge triggered use a bubble in front of the clock input Positive-Edge Triggered -FF Negative-Edge Triggered -FF looks at only at the positive-edge LK * * x 1 x 1 1 1 -FF LK -FF LK LK No bubble indicates positive-edge triggered Bubble indicates negative-edge triggered only samples at the positive edges and then holds that value until the next edge 1.1 1. Negative-Edge Triggered -FF FF Example looks at only at the negative-edge LK * * x 1 x 1 1 1 Assume positive edge-triggered FF LK only samples at the negative edges and then holds that value until the next edge

1. 1.4 Shift Register Shift Register A shift register is a device that acts as a queue or FIFO (First-in, First-Out). It can store n bits and each bit moves one step forward each clock cycle One bit comes in the overall input per clock One bit falls out the output per clock 1.5 1.6 Shift Register BUILING A FLIP FLOP When we want to ensure an output updates only ONE per clock, we need to use flip-flops (not latches or bistables)!

1.7 1. Building an Edge-Triggered evice Master-Slave -FF We generally build FFs from latches To build a device that can only change at 1 instant (clock edge) we can: Try to only enable 1 latch for a small in Use two latches running on clock phases To build an edge-triggered-ff we can use two -Latches Master Slave lock Input ueue oor opening and closing almost instantly Two door system (when 1 is open the other is closed) These latches form a flip-flop 1.9 1.4 omplete the Waveform Master-Slave -FF lock Master Slave To implement a positive edge-triggered -FF change the clock inversion lock Master Slave Negative-Edge Triggered Positive-Edge Triggered

1.41 Initializing Outputs 1.4 Need to be able to initialize to a value ( or 1) FF inputs are often connected to logic that will produce values after initialization Two are often included: (PRE)SET and LEAR INITIALIING OUTPUTS Logic SET LK LR When LEAR = active *= When SET = active *= When NEITHER = active FF operation Note: LR and SET have over normal FF inputs 1.4 1.44 Initializing Outputs Initializing Outputs To help us initialize our FF s use a signal Generally produced for us and given along with LK It starts at Active (1)when power and then goes to Inactive ()for the When it s active use it to initialize the FF s and then it will go inactive for the rest of and the FF s will work based on their inputs Active (1) at = Inactive () for the rest of Need to be able to initialize to a known value ( or 1) Logic SET LK LR 1 * = When = 1, LR is active and is forced to regardless of Logic SET LK LR * = When =, LR is inactive and looks at at each clock edge

1.45 1.46 Implementing an Initial State Synchronous vs. Asynchronous When is activated s initialize to and then when it goes back to 1 the s look at the inputs Forces s to because it s connected to the LR inputs The new preset and clear inputs can be built to be synchronous or asynchronous These terms refer to when the initialization takes place Asynchronous initialize when signal is activated Synchronous initialize at clock edge... Once goes to, the FF s look at the inputs lock LR Synchronous lock LR Asynchronous 1... s s Synchronous SET or LR means the signal must be active at a clock edge before will initialize Asynchronous SET or LR means will initialize as soon as the SET or LR signal is activated 1.47 1.4 Set / lear Example Exercise omplete the waveform for a -FF with asynchronous SET and LR X 1 SET LR SET 1 F LK 1 5 7 1 LR LK LR SET LK X 1 1 F

1.49 1.5 Register Resets/lears Using muxes to control when register save data REGISTER WITH ENABLES When the power turns on the bit stored in a flip-flop will initialize to a random value Better to initialize it to a known value (usually 's) Use a special signal called "reset" to force the flip-flops to 's LK i i * 1 LR LR LR 1 1, X X i LR 1 X LK 1 1 4-bit Register 1.51 1.5 Register Problem Solution Whatever the value is at the clock edge is sampled and passed to the output until the next clock edge Problem: Register will save data on EVER edge LK Often we want the ability to save on one edge and then keep that value for many more cycles Registers (-FF s) will sample the bit every clock edge and pass it to Somes we may want to hold the value of and ignore even at a clock edge We can add an enable input and some logic in front of the -FF to accomplish this LK EN i i * EN LK 1 S FF with ata Enable (Always clocks, but selectively chooses old value,, or new value ) LR [:] 1 [:]? 11 1 11 11 111 1 11 11 11 1 11 11 111 1 11,1 X X X i 1 X X X i 4-bit Register On clock edge, is passed to 1 1 1 1

1.5 1.54 Registers w/ Enables 4-bit Register w/ ata (Load) Enable When EN=, value is passed back to the input and thus will maintain its value at the next clock edge When EN=1, value is passed to the input and thus will change at the edge based on EN LK 1 EN LK When EN=, is recycled back to the input 1 S 1 S LR When EN=1, input is passed to FF input LR Registers (-FF s) will sample the bit every clock edge and pass it to Somes we may want to hold the value of and ignore even at a clock edge We can add an enable input and some logic in front of the -FF to accomplish this LK EN i i *,1 X X X i 1 X X X i 1 1 1 1 1 EN LK 1 S 1 S 1 S 1 S 4-bit register with 4-bit wide -to-1 mux in front of the inputs LR LR LR LR 1 Registers w/ Enables 1.55 1.56 The value is sampled at the clock edge only if the enable is active Otherwise the current value is maintained LK EN OUNTERS [:] 1 11 1 11 11 111 1 11 11 [:] 11 111 1

1.57 1.5 ounters ount (Add 1 to ) at each clock edge Up ounter: * = + 1 an also build a down counter as well (* = 1) Standard counter components include other features Resets: Reset count to Enables: Will not count at edge if EN= Parallel Load Inputs: an initialize count to a value P (i.e. * = P rather than +1) LK 1 (+) Register Sample 4-bit ounter 4-bit Up ounter : a synchronous reset input PE and P i inputs: loads with P when PE is active E: ount Enable Must be active for the counter to count up T (Terminal ount) output Active when =1111 AN counter is enabled T = EN 1 Mealy output Indicates that on the next edge it will roll over to E P P1 P P PE LK 4-bit NTR 1 T LK PE E *,1 X X X 1 X X 1 X P 1 +1 1.59 1.6 ounters ounter Exercise LK LK E PE PE P-P 111 E - 1 1 11 111 1111 1 P[:] 11 111 11 T [:] SR=active at clock edge, thus = *=+1 Enable = off, thus holds *=+1 *=+1 PE = active, thus *=+1 *=+1 =P Mealy T output: EN 1

ounter esign 1.61 Sketch the design of the 4-bit counter presented on the previous slides E + 1 P[:] PE 1 [:] [:] Reg [:] LR LK LK T