Lecture 13: Sequential Circuits, FSM

Slides:



Advertisements
Similar presentations
Finite State Machine Continued
Advertisements

Lecture 13: Sequential Circuits
Control path Recall that the control path is the physical entity in a processor which: fetches instructions, fetches operands, decodes instructions, schedules.
Lecture 22: Sequential Circuits Today’s topic –Clocks and sequential circuits –Finite state machines 1.
1  1998 Morgan Kaufmann Publishers Chapter Five The Processor: Datapath and Control.
Lec 17 Nov 2 Chapter 4 – CPU design data path design control logic design single-cycle CPU performance limitations of single cycle CPU multi-cycle CPU.
Give qualifications of instructors: DAP
Chapter Five The Processor: Datapath and Control.
Lecture 16: Basic CPU Design
1 Lecture 14: FSM and Basic CPU Design Today’s topics:  Finite state machines  Single-cycle CPU Reminder: midterm on Tue 10/24  will cover Chapters.
Processor I CPSC 321 Andreas Klappenecker. Midterm 1 Thursday, October 7, during the regular class time Covers all material up to that point History MIPS.
Fall 2007 L16: Memory Elements LECTURE 16: Clocks Sequential circuit design The basic memory element: a latch Flip Flops.
The Processor Andreas Klappenecker CPSC321 Computer Architecture.
Lecture 24: CPU Design Today’s topic –Multi-Cycle ALU –Introduction to Pipelining 1.
Lecture 10 Topics: Sequential circuits Basic concepts Clocks
1 COMP541 State Machines Montek Singh Feb 8, 2012.
Lecture 9. MIPS Processor Design – Instruction Fetch Prof. Taeweon Suh Computer Science Education Korea University 2010 R&E Computer System Education &
Processor: Datapath and Control
Lec 15Systems Architecture1 Systems Architecture Lecture 15: A Simple Implementation of MIPS Jeremy R. Johnson Anatole D. Ruslanov William M. Mongan Some.
ECE 445 – Computer Organization
DLD Lecture 26 Finite State Machine Design Procedure.
1  2004 Morgan Kaufmann Publishers Chapter Five.
1 Lecture 12: Adders, Sequential Circuits Today’s topics:  Carry-lookahead adder  Clocks, latches, sequential circuits.
Digital System Design using VHDL
Finite State Machine. Clock Clock cycle Sequential circuit Digital logic systems can be classified as combinational or sequential. – Combinational circuits.
1 CS/COE0447 Computer Organization & Assembly Language Chapter 5 Part 3.
May 22, 2000Systems Architecture I1 Systems Architecture I (CS ) Lecture 14: A Simple Implementation of MIPS * Jeremy R. Johnson Mon. May 17, 2000.
Exam-like questions.
1 Lecture 13: Sequential Circuits, FSM Today’s topics:  Sequential circuits  Finite state machines  Single-cycle CPU Reminder: midterm on Tue 10/20.
Digital Design - Sequential Logic Design
Combinational circuits
Computer Architecture & Operations I
CS161 – Design and Architecture of Computer Systems
Lecture 4. Sequential Logic #2
Computer Organization and Architecture + Networks
Clocks A clock is a free-running signal with a cycle time.
Computer Architecture & Operations I
Lecture 15: Basic CPU Design
Motivation Combinational logic functions can be represented, and defined, by truth tables. Sequential logic function cannot, because their behavior depends.
COMP541 Sequential Logic – 2: Finite State Machines
Morgan Kaufmann Publishers
Processor (I).
CS/COE0447 Computer Organization & Assembly Language
Chapter Five.
Latches and Flip-flops
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
Jeremy R. Johnson Mon. Apr. 3, 2000
Lecture 15: Basic CPU Design
Lecture 12: Adders, Sequential Circuits
Lecture 12: Adders, Sequential Circuits
Lecture 13: Sequential Circuits, FSM
Introduction to Computer Engineering
CSE 370 – Winter Sequential Logic-2 - 1
Lecture 17 Logistics Last lecture Today HW5 due on Wednesday
The Processor Lecture 3.1: Introduction & Logic Design Conventions
Systems Architecture I
COMS 361 Computer Organization
Latches The second part of CS231 focuses on sequential circuits, where we add memory to the hardware that we’ve already seen. Our schedule will be very.
Pipelining: Basic Concepts
Chapter Four The Processor: Datapath and Control
Flip-Flops.
Systems Architecture I
Lecture 17 Logistics Last lecture Today HW5 due on Wednesday
Lecture 14: State Tables, Diagrams, Latches, and Flip Flop
EGR 2131 Unit 12 Synchronous Sequential Circuits
Finite State Machine Continued
Lecture 4 Sequential units. Registers
Instructor: Michael Greenbaum
Clocks A clock is a free-running signal with a cycle time.
Presentation transcript:

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

Clocks A microprocessor is composed of many different circuits that are operating simultaneously – if each circuit X takes in inputs at time TIX, takes time TEX to execute the logic, and produces outputs at time TOX, 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

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

Sequential Circuits Until now, circuits were combinational – when inputs change, the outputs change after a while (time = logic delay thru circuit) Combinational Circuit Combinational Circuit Inputs Outputs 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 Combinational Circuit Combinational Circuit Outputs Inputs Latch Latch

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 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) Inputs State Clock Outputs Inputs Combinational Cct

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

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

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

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 Next state Next-state Function Current State Clock Output Function Outputs Inputs

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 This is a state diagram for ___? D = 1 1 1 D = 0

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?

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

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?

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

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

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)

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

Note: we haven’t bothered 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

Clocking Methodology Which of the above units need a clock? 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

Title Bullet