Lecture 13: Sequential Circuits, FSM

Similar documents
Lecture 13: Sequential Circuits, FSM

Lecture 13: Sequential Circuits

Lecture 12: Adders, Sequential Circuits

Latches. October 13, 2003 Latches 1

Lecture 12: Adders, Sequential Circuits

CS/COE1541: Introduction to Computer Architecture. Logic Design Review. Sangyeun Cho. Computer Science Department University of Pittsburgh

Chapter 3 Digital Logic Structures

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

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

Logic design? Transistor as a switch. Layered design approach. CS/COE1541: Introduction to Computer Architecture. Logic Design Review.

CS/COE0447: Computer Organization

UNIVERSITY OF WISCONSIN MADISON

Topic 8: Sequential Circuits

Sequential Logic Circuits

TEST 1 REVIEW. Lectures 1-5

Logic Design II (17.342) Spring Lecture Outline

CS/COE0447: Computer Organization

Lecture 17: Designing Sequential Systems Using Flip Flops

State Machines ELCTEC-131

Chapter 4. Sequential Logic Circuits

Finite State Machine (FSM)

Processor Design & ALU Design

Lecture: Pipelining Basics

CPE100: Digital Logic Design I

Lecture 10: Synchronous Sequential Circuits Design

Combinatorial Logic Design Multiplexers and ALUs CS 64: Computer Organization and Design Logic Lecture #13

CprE 281: Digital Logic

Generalized FSM model: Moore and Mealy

Sequential Circuit Analysis

CPU DESIGN The Single-Cycle Implementation

Synchronous Sequential Circuit Design. Digital Computer Design

Topic 8: Sequential Circuits. Bistable Devices. S-R Latches. Consider the following element. Readings : Patterson & Hennesy, Appendix B.4 - B.

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

CSE140: Digital Logic Design Registers and Counters

Sequential Logic. Rab Nawaz Khan Jadoon DCS. Lecturer COMSATS Lahore Pakistan. Department of Computer Science

UNIT 8A Computer Circuitry: Layers of Abstraction. Boolean Logic & Truth Tables

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

Different encodings generate different circuits

Sequential Circuits Sequential circuits combinational circuits state gate delay

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

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

ELCT201: DIGITAL LOGIC DESIGN

CS61C : Machine Structures

COE 328 Final Exam 2008

ECE 341. Lecture # 3

CS61C : Machine Structures

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

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

Unit 7 Sequential Circuits (Flip Flop, Registers)

14.1. Unit 14. State Machine Design

State and Finite State Machines

COVER SHEET: Problem#: Points

Models for representing sequential circuits

Counters. We ll look at different kinds of counters and discuss how to build them

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

Chapter 5 Synchronous Sequential Logic

Sequential Synchronous Circuit Analysis

Philadelphia University Student Name: Student Number:

Computer Engineering Department. CC 311- Computer Architecture. Chapter 4. The Processor: Datapath and Control. Single Cycle

CSCI 2150 Intro to State Machines

or 0101 Machine

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

CprE 281: Digital Logic

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

EECS150 - Digital Design Lecture 11 - Shifters & Counters. Register Summary

Review: Designing with FSM. EECS Components and Design Techniques for Digital Systems. Lec09 Counters Outline.

Digital Design. Sequential Logic

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

EXPERIMENT Traffic Light Controller

Finite State Machine. By : Ali Mustafa

State & Finite State Machines

Clocked Synchronous State-machine Analysis

ALU A functional unit

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

ALU, Latches and Flip-Flops

Chapter 4 Part 2 Sequential Circuits

Review: Designing with FSM. EECS Components and Design Techniques for Digital Systems. Lec 09 Counters Outline.

10/12/2016. An FSM with No Inputs Moves from State to State. ECE 120: Introduction to Computing. Eventually, the States Form a Loop

EE40 Lec 15. Logic Synthesis and Sequential Logic Circuits

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

CPE100: Digital Logic Design I

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

EET 310 Flip-Flops 11/17/2011 1

Figure 4.9 MARIE s Datapath

Introduction to CMOS VLSI Design Lecture 1: Introduction

Clocked Sequential Circuits UNIT 13 ANALYSIS OF CLOCKED SEQUENTIAL CIRCUITS. Analysis of Clocked Sequential Circuits. Signal Tracing and Timing Charts

CPS 104 Computer Organization and Programming Lecture 11: Gates, Buses, Latches. Robert Wagner

A Second Datapath Example YH16

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

ECE290 Fall 2012 Lecture 22. Dr. Zbigniew Kalbarczyk

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

University of Guelph School of Engineering ENG 2410 Digital Design Fall There are 7 questions, answer all questions.

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

Table of Content. Chapter 11 Dedicated Microprocessors Page 1 of 25

University of Toronto Faculty of Applied Science and Engineering Edward S. Rogers Sr. Department of Electrical and Computer Engineering

Menu. Excitation Tables (Bonus Slide) EEL3701 EEL3701. Registers, RALU, Asynch, Synch

Sequential logic and design

EGR224 F 18 Assignment #4

Digital Logic: Boolean Algebra and Gates. Textbook Chapter 3

Chapter 7. Sequential Circuits Registers, Counters, RAM

Transcription:

Lecture 13: Sequential Circuits, FSM Today s topics: Sequential circuits Finite state machines Reminder: midterm on Tue 2/28 will cover Chapters 1-3, App A, B if you understand all slides, assignments, you will ace 90% of the test 1

Sequential Circuits Until now, circuits were combinational when inputs change, the outputs change after a while (time = logic delay thru circuit) Inputs Combinational Circuit Outputs Combinational Circuit We want the clock to act like a start and stop signal a latch is a storage device that separates these circuits it ensures that the inputs to the circuit do not change during a clock cycle Clock Clock Inputs Combinational Circuit Outputs Combinational Circuit Latch Latch 2

Sequential Circuits Sequential circuit: consists of combinational circuit and a storage element At the start of the clock cycle, the rising edge causes the state storage to store some input values Inputs Clock Inputs State Combinational Cct Outputs This state will not change for an entire cycle (until next rising edge) The combinational circuit has some time to accept the value of state and inputs and produce outputs Some of the outputs (for example, the value of next state ) may feed back (but through the latch so they re only seen in the next cycle) 3

Designing a Latch An S-R latch: set-reset latch When Set is high, a 1 is stored When Reset is high, a 0 is stored When both are low, the previous state is preserved (hence, known as a storage or memory element) Both are high this set of inputs is not allowed Verify the above behavior! Source: H&P textbook 4

D Latch Incorporates a clock The value of the input D signal (data) is stored only when the clock is high the previous state is preserved when the clock is low Source: H&P textbook 5

D Flip Flop Terminology: Latch: outputs can change any time the clock is high (asserted) Flip flop: outputs can change only on a clock edge Two D latches in series ensures that a value is stored only on the falling edge of the clock Source: H&P textbook 6

Finite State Machine A sequential circuit is described by a variation of a truth table a finite state diagram (hence, the circuit is also called a finite state machine) Note that state is updated only on a clock edge Clock Current State Next-state Function Next state Inputs Output Function Outputs 7

State Diagrams Each state is shown with a circle, labeled with the state value the contents of the circle are the outputs An arc represents a transition to a different state, with the inputs indicated on the label D = 0 D = 1 D = 1 0 1 0 1 D = 0 This is a state diagram for? 8

3-Bit Counter Consider a circuit that stores a number and increments the value on every clock edge on reaching the largest value, it starts again from 0 Draw the state diagram: How many states? How many inputs? 9

3-Bit Counter Consider a circuit that stores a number and increments the value on every clock edge on reaching the largest value, it starts again from 0 Draw the state diagram: How many states? How many inputs? 000 001 010 011 100 101 110 111 000 001 010 011 100 101 110 111 10

Traffic Light Controller Problem description: A traffic light with only green and red; either the North-South road has green or the East-West road has green (both can t be red); there are detectors on the roads to indicate if a car is on the road; the lights are updated every 30 seconds; a light need change only if a car is waiting on the other road State Transition Table: How many states? How many inputs? How many outputs? 11

State Transition Table Problem description: A traffic light with only green and red; either the North-South road has green or the East-West road has green (both can t be red); there are detectors on the roads to indicate if a car is on the road; the lights are updated every 30 seconds; a light must change only if a car is waiting on the other road State Transition Table: CurrState InputEW InputNS NextState=Output N 0 0 N N 0 1 N N 1 0 E N 1 1 E E 0 0 E E 0 1 N E 1 0 E E 1 1 N 12

State Diagram State Transition Table: CurrState InputEW InputNS NextState=Output N 0 0 N N 0 1 N N 1 0 E N 1 1 E E 0 0 E E 0 1 N E 1 0 E E 1 1 N Source: H&P textbook 13

Basic MIPS Architecture Now that we understand clocks and storage of states, we ll design a simple CPU that executes: basic math (add, sub, and, or, slt) memory access (lw and sw) branch and jump instructions (beq and j) 14

Implementation Overview We need memory to store instructions to store data for now, let s make them separate units We need registers, ALU, and a whole lot of control logic CPU operations common to all instructions: use the program counter (PC) to pull instruction out of instruction memory read register values 15

View from 30,000 Feet Note: we haven t bothered showing multiplexors What is the role of the Add units? Explain the inputs to the data memory unit Explain the inputs to the ALU Explain the inputs to the register unit Source: H&P textbook 16

Clocking Methodology Source: H&P textbook Which of the above units need a clock? What is being saved (latched) on the rising edge of the clock? Keep in mind that the latched value remains there for an entire cycle 17

Title Bullet 18