Lecture 13: Sequential Circuits, FSM

Similar documents
Lecture 13: Sequential Circuits, FSM

Lecture 13: Sequential Circuits

Lecture 12: Adders, Sequential Circuits

Lecture 12: Adders, Sequential Circuits

Latches. October 13, 2003 Latches 1

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

CS/COE0447: Computer Organization

CS/COE0447: Computer Organization

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

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

Chapter 3 Digital Logic Structures

TEST 1 REVIEW. Lectures 1-5

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

Logic Design II (17.342) Spring Lecture Outline

Topic 8: Sequential Circuits

CPU DESIGN The Single-Cycle Implementation

Sequential Logic Circuits

CprE 281: Digital Logic

Processor Design & ALU Design

Lecture: Pipelining Basics

UNIVERSITY OF WISCONSIN MADISON

Chapter 4. Sequential Logic Circuits

CS61C : Machine Structures

CS61C : Machine Structures

Finite State Machine (FSM)

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

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

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

State Machines ELCTEC-131

Lecture 10: Synchronous Sequential Circuits Design

COE 328 Final Exam 2008

Lecture 17: Designing Sequential Systems Using Flip Flops

CprE 281: Digital Logic

Sequential Circuit Analysis

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

CSCI 2150 Intro to State Machines

CPE100: Digital Logic Design I

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

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

ALU A functional unit

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

Introduction to CMOS VLSI Design Lecture 1: Introduction

Sequential Circuits Sequential circuits combinational circuits state gate delay

Different encodings generate different circuits

CSE370: Introduction to Digital Design

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

CPE100: Digital Logic Design I

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

CMPE12 - Notes chapter 2. Digital Logic. (Textbook Chapters and 2.1)"

A Second Datapath Example YH16

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

ECE 341. Lecture # 3

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

Figure 4.9 MARIE s Datapath

Synchronous Sequential Circuit Design. Digital Computer Design

ECE290 Fall 2012 Lecture 22. Dr. Zbigniew Kalbarczyk

Digital Design. Sequential Logic

Chapter 7. Sequential Circuits Registers, Counters, RAM

State and Finite State Machines

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

Unit 7 Sequential Circuits (Flip Flop, Registers)

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

CSE140: Digital Logic Design Registers and Counters

14.1. Unit 14. State Machine Design

Models for representing sequential circuits

EET 310 Flip-Flops 11/17/2011 1

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

Chapter 5 Synchronous Sequential Logic

Sequential Synchronous Circuit Analysis

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

ELCT201: DIGITAL LOGIC DESIGN

Philadelphia University Student Name: Student Number:

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

ALU, Latches and Flip-Flops

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

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

EXPERIMENT Traffic Light Controller

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

CPE100: Digital Logic Design I

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

Finite State Machine. By : Ali Mustafa

CMPE12 - Notes chapter 1. Digital Logic. (Textbook Chapter 3)

CE1911 LECTURE FSM DESIGN PRACTICE DAY 1

INF2270 Spring Philipp Häfliger. Lecture 8: Superscalar CPUs, Course Summary/Repetition (1/2)

Lecture 7: Logic design. Combinational logic circuits

State & Finite State Machines

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

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

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

Clocked Synchronous State-machine Analysis

Enrico Nardelli Logic Circuits and Computer Architecture

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

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

Generalized FSM model: Moore and Mealy

CSE140: Design of Sequential Logic

COVER SHEET: Problem#: Points

Lecture 10: Sequential Networks: Timing and Retiming

EC 413 Computer Organization

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

Transcription:

Lecture 13: Sequential Circuits, FSM Today s topics: Sequential circuits Finite state machines 1

Clocks A microprocessor is composed of many different circuits that are operating simultaneously if each circuit X takes in inputs at time TI X, takes time TE X to execute the logic, and produces outputs at time TO X, imagine the complications in co-ordinating the tasks of every circuit A major school of thought (used in most processors built today): all circuits on the chip share a clock signal (a square wave) that tells every circuit when to accept inputs, how much time they have to execute the logic, and when they must produce outputs 2

Clock Terminology Cycle time Rising clock edge Falling clock edge 4 GHz = clock speed = 1 = 1. cycle time 250 ps 3

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 4

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

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 6

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 7

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 8

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 9

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? 10

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? 11

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 12

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? 13

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 14

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 15

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

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 17

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 18

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 19

Title Bullet 20