Basic Register Typically, we store multi-bit items

Slides:



Advertisements
Similar presentations
CS1Q Computer Systems Lecture 12 Simon Gay. Lecture 12CS1Q Computer Systems - Simon Gay 2 Design of Sequential Circuits The systematic design of sequential.
Advertisements

TOPIC : Finite State Machine(FSM) and Flow Tables UNIT 1 : Modeling Module 1.4 : Modeling Sequential circuits.
1 Introduction Sequential circuit –Output depends not just on present inputs (as in combinational circuit), but on past sequence of inputs Stores bits,
Digital Design - Sequential Logic Design Chapter 3 - Sequential Logic Design.
Sequential Circuits1 DIGITAL LOGIC DESIGN by Dr. Fenghui Yao Tennessee State University Department of Computer Science Nashville, TN.
Computing Machinery Chapter 5: Sequential Circuits.
Circuits require memory to store intermediate data
Lecture 22: Sequential Circuits Today’s topic –Clocks and sequential circuits –Finite state machines 1.
Sequential Circuit Analysis & Design Dr. Aiman H. El-Maleh Computer Engineering Department King Fahd University of Petroleum & Minerals Dr. Aiman H. El-Maleh.
Chapter 3 Digital Logic Structures
CS 151 Digital Systems Design Lecture 21 Analyzing Sequential Circuits.
Digital Design Copyright © 2006 Frank Vahid 1 Digital Design Chapter 3: Sequential Logic Design -- Controllers Slides to accompany the textbook Digital.
Sequential Logic Design Process A sequential circuit that controls Boolean outputs and a specific time- ordered behavior is called a controller. StepDescription.
Homework Reading Machine Projects Labs Tokheim Chapter 9.1 – 9.6
1 Register-Transfer Level (RTL) Design Recall –Chapter 2: Combinational Logic Design First step: Capture behavior (using equation or truth table) Remaining.
Chapter 3: Sequential Logic Design -- Controllers
Basic Register A register is a sequential component that can store multiple bits.
Chapter 3: Sequential Logic Design -- Controllers
1 Synchronous Sequential Circuit Design. 2 Sequential circuit design In sequential circuit design, we turn some description into a working circuit – We.
Chapter 3: Sequential Logic Design -- Controllers
Controller Design Five step controller design process.
Midterm Wednesday Chapter 1-3: Number /character representation and conversion Number arithmetic CMOS logic elements Combinational logic elements and design.
Sequential Circuit  It is a type of logic circuit whose output depends not only on the present value of its input signals but on the past history of its.
Lecture 21 Overview Counters Sequential logic design.
1 Sequential Circuits Registers and Counters. 2 Master Slave Flip Flops.
Sequential Circuits Chapter 4 S. Dandamudi To be used with S. Dandamudi, “Fundamentals of Computer Organization and Design,” Springer,  S.
Lecture 10 Topics: Sequential circuits Basic concepts Clocks
Verilog for Digital Design
Sequential Networks Two major classes of Sequential Circuits 1.Fundamental Mode – A sequential circuit where: Only one input is allowed to change at any.
Basics of State Machine Design
1 COMP541 State Machines Montek Singh Feb 8, 2012.
Elevator Controller We’re hired to design a digital elevator controller for a four-floor building st try: Design a counter that counts up.
Chap 4. Sequential Circuits
Digital Logic Design Sequential circuits
Rabie A. Ramadan Lecture 3
Models of Computation: FSM Model Reading: L. Lavagno, A.S. Vincentelli and E. Sentovich, “Models of computation for Embedded System Design”
Sequential Logic Materials taken from: Digital Design and Computer Architecture by David and Sarah Harris & The Essentials of Computer Organization and.
EEE2243 Digital System Design Chapter 5: Simple Design Case Studies by Muhazam Mustapha, February 2011.
Introduction to Sequential Logic Design Finite State-Machine Design.
1 Lecture 22 Sequential Circuits Analysis. 2 Combinational vs. Sequential  Combinational Logic Circuit  Output is a function only of the present inputs.
EEE2243 Digital System Design Chapter 4: Verilog HDL (Sequential) by Muhazam Mustapha, January 2011.
Finite State Machines (FSMs) and RAMs and CPUs COS 116, Spring 2011 Sanjeev Arora.
Introduction to State Machine
Review of Digital Logic Design Concepts OR: What I Need to Know from Digital Logic Design (EEL3705)
Lecture 5. Sequential Logic 2 Prof. Taeweon Suh Computer Science Education Korea University 2010 R&E Computer System Education & Research.
DLD Lecture 26 Finite State Machine Design Procedure.
Digital Logic Design.
CS1Q Computer Systems Lecture 11 Simon Gay. Lecture 11CS1Q Computer Systems - Simon Gay 2 The D FlipFlop The RS flipflop stores one bit of information.
State Table Problem #1 An electronic lock is controlled by a keypad, which has three buttons labeled A, B, and R. The keypad is restricted such that, at.
Digital Design 2e Copyright © 2010 Frank Vahid 1 How To Capture Desired Behavior as FSM List states –Give meaningful names, show initial state –Optionally.
Lecture 20: Sequential Logic (5)
Digital System Design using VHDL

1 COMP541 Finite State Machines - 1 Montek Singh Sep 22, 2014.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Logic Design Dr. Oliver Faust.
Digital Design 2e Copyright © 2010 Frank Vahid 1 Digital Design Chapter 3: Sequential Logic Design -- Controllers Slides to accompany the textbook Digital.
Digital Design 2e Copyright © 2010 Frank Vahid 1 Digital Design Chapter 3: Sequential Logic Design -- Controllers Slides to accompany the textbook Digital.
Finite State Machine. Clock Clock cycle Sequential circuit Digital logic systems can be classified as combinational or sequential. – Combinational circuits.
Counters and registers Eng.Maha Alqubali. Registers Registers are groups of flip-flops, where each flip- flop is capable of storing one bit of information.
Digital Design Copyright © 2006 Frank Vahid 1 Digital Design Chapter 3: Sequential Logic Design -- Controllers Slides to accompany the textbook Digital.
1 COMP541 Sequential Logic – 2: Finite State Machines Montek Singh Feb 29, 2016.
Digital Logic Structures: Chapter 3 COMP 2610 Dr. James Money COMP
Sequential logic circuits First Class 1Dr. AMMAR ABDUL-HAMED KHADER.
Digital Design - Sequential Logic Design
Lecture 13: Sequential Circuits, FSM
Lecture 13: Sequential Circuits, FSM
Introduction to Sequential Circuits
Lecture 17 Logistics Last lecture Today HW5 due on Wednesday
Lecture 17 Logistics Last lecture Today HW5 due on Wednesday
Finite State Machine Continued
Presentation transcript:

Basic Register Typically, we store multi-bit items e.g., storing a 4-bit binary number Register: multiple flip-flops sharing clock signal From this point, we’ll use registers for bit storage No need to think of latches or flip-flops But now you know what’s inside a register

Example Using Registers: Temperature Display Temperature history display Sensor outputs temperature as 5-bit binary number Timer pulses C every hour Record temperature on each pulse, display last three recorded values a4 x4 x3 x2 x1 x0 C a3 a2 a1 a0 t empe r a tu e sensor timer Display Present b4 b3 b2 b1 b0 Temperature History Storage 1 hour ago c4 c3 c2 c1 c0 2 hours ago (In practice, we would actually avoid connecting the timer output C to a clock input, instead only connecting an oscillator output to a clock input.)

Example Using Registers: Temperature Display Use three 5-bit registers Q4 C x4 x3 x2 x1 x0 Q3 Q2 Q1 Q0 R a b I 4 3 2 1 a4 a3 a2 a1 a0 c b4 b3 b2 b1 b0 c4 c3 c2 c1 c0 Temperature History Storage 15 18 20 21 24 25 26 27 22 x4...x0 C R a b c

Finite-State Machines (FSMs) and Controllers Want sequential circuit with particular behavior over time Example: Laser timer Push button: x=1 for 3 clock cycles How? Let’s try three flip-flops b=1 gets stored in first D flip-flop Then 2nd flip-flop on next cycle, then 3rd flip-flop on next OR the three flip-flop outputs, so x should be 1 for three cycles Controller x b clk laser patient

Need a Better Way to Design Sequential Circuits Trial and error is not a good design method Combinational circuit design process had two important things A formal way to describe desired circuit behavior Boolean equation, or truth table A well-defined process to convert that behavior to a circuit We need those things for sequence circuit design

Describing Behavior of Sequential Circuit: FSM Finite-State Machine (FSM) A way to describe desired behavior of sequential circuit Akin to Boolean equations for combinational behavior List states, and transitions among states Example: Make x change toggle (0 to 1, or 1 to 0) every clock cycle Two states: “Off” (x=0), and “On” (x=1) Transition from Off to On, or On to Off, on rising clock edge Arrow with no starting state points to initial state (when circuit first starts) Outputs: x On O ff x=0 x=1 clk ^

FSM Example: 0,1,1,1,repeat Want 0, 1, 1, 1, 0, 1, 1, 1, ... Each value for one clock cycle Can describe as FSM Four states Transition on rising clock edge to next state Outputs: x On1 O ff On2 On3 clk ^ x=1 x=0 O ff On1 On2 On3 clk x State Outputs:

Extend FSM to Three-Cycles High Laser Timer On2 On1 On3 O ff clk ^ x=1 x=0 b ’*clk b*clk Inputs: b; Outputs: x Four states Wait in “Off” state while b is 0 (b’) When b is 1 (and rising clock edge), transition to On1 Sets x=1 On next two clock edges, transition to On2, then On3, which also set x=1 So x=1 for three cycles after button pressed

FSM Simplification: Rising Clock Edges Implicit ff x=1 x=0 b’ clk ^ *clk b Inputs: b; Outputs: x Showing rising clock on every transition: cluttered Make implicit -- assume every edge has rising clock, even if not shown What if we wanted a transition without a rising edge We don’t consider such asynchronous FSMs -- less common, and advanced topic Only consider synchronous FSMs -- rising edge on every transition On2 On1 On3 Off x=1 x=0 b ’ Inputs: x; Outputs: b Note: Transition with no associated condition thus transistions to next state on next clock cycle

FSM Definition FSM consists of Set of states Ex: {Off, On1, On2, On3} Set of inputs, set of outputs Ex: Inputs: {x}, Outputs: {b} Initial state Ex: “Off” Set of transitions Describes next states Ex: Has 5 transitions Set of actions Sets outputs while in states Ex: x=0, x=1, x=1, and x=1 Inputs: x; Outputs: b On2 On1 On3 Off x=1 x=0 b ’ We often draw FSM graphically, known as state diagram Can also use table (state table), or textual languages

FSM Example: Secure Car Key Many new car keys include tiny computer chip When car starts, car’s computer (under engine hood) requests identifier from key Key transmits identifier If not, computer shuts off car FSM Wait until computer requests ID (a=1) Transmit ID (in this case, 1101) K1 K2 K3 K4 r=1 r=0 Wait Inputs: a; Outputs: r a ’

FSM Example: Secure Car Key (cont.) Nice feature of FSM Can evaluate output behavior for different input sequence Timing diagrams show states and output values for different input waveforms K1 K2 K3 K4 r=1 r=0 W ait I nputs: a ; O utputs: r ’ Q: Determine states and r value for given input waveform: W ait K1 K2 K3 K4 clk I nputs O utputs S t a e r clk I nputs a W ait K1 K2 K3 K4 Output State r K1

FSM Example: Code Detector Unlock door (u=1) only when buttons pressed in sequence: start, then red, blue, green, red Input from each button: s, r, g, b Also, output a indicates that some colored button pressed FSM Wait for start (s=1) in “Wait” Once started (“Start”) If see red, go to “Red1” Then, if see blue, go to “Blue” Then, if see green, go to “Green” Then, if see red, go to “Red2” In that state, open the door (u=1) Wrong button at any step, return to “Wait”, without opening door s Start u r Door Red Code g lock Green detector b Blue a Wait Start Red1 R ed2 Green Blue s ’ a r b g ab ag ar u=0 u=1 Inputs: s,r,g,b,a; Outputs: u Q: Can you trick this FSM to open the door, without knowing the code? A: Yes, hold all buttons simultaneously

Improve FSM for Code Detector Inputs: s,r,g,b,a; Outputs: u Wait s’ ar’ ab’ ag’ ar’ u=0 s Start a ’ u=0 ar ab ag ar Red1 Blue Green Red2 a ’ a ’ a ’ u=0 u=0 u=0 u=1 New transition conditions detect if wrong button pressed, returns to “Wait” FSM provides formal, concrete means to accurately define desired behavior

Standard Controller Architecture How implement FSM as sequential circuit? Use standard architecture State register -- to store the present state Combinational logic -- to compute outputs, and next state For laser timer FSM 2-bit state register, can represent four states Input b, output x Known as controller On2 On1 On3 Off x=1 x=0 b ’ Inputs: x; Outputs: b Combinational logic State register s1 s0 n1 n0 x b clk FSM outputs inputs General version Combinational logic S m N O I clk m-bit state register FSM outputs inputs