Instructor: Michael Greenbaum

Slides:



Advertisements
Similar presentations
Datorteknik DigitalCircuits bild 1 Combinational circuits Changes at inputs propagate at logic speed to outputs Not clocked No internal state (memoryless)
Advertisements

ECE 15B Computer Organization Spring 2010 Dmitri Strukov Lecture 2: Overview of Computer Organization Partially adapted from Computer Organization and.
CS 61C L29 Combinational Logic Blocks (1) Garcia, Spring 2004 © UCB Lecturer PSOE Dan Garcia inst.eecs.berkeley.edu/~cs61c.
CS 61C L14 State (1) A Carle, Summer 2005 © UCB inst.eecs.berkeley.edu/~cs61c/su05 CS61C : Machine Structures Lecture #14: State and FSMs Andy.
CS 61C L14 Combinational Logic (1) A Carle, Summer 2006 © UCB inst.eecs.berkeley.edu/~cs61c/su06 CS61C : Machine Structures Lecture #14: Combinational.
CS 300 – Lecture 3 Intro to Computer Architecture / Assembly Language Sequential Circuits.
CS61C L21 State Elements : Circuits that Remember (1) Spring 2007 © UCB 161 Exabytes In 2006  In 2006 we created, captured, and replicated 161 exabytes.
CS61C L22 Representations of Combinatorial Logic Circuits (1) Garcia, Spring 2008 © UCB 100 MPG Car contest!  The X Prize Foundation has put up two prizes;
CS61C L21 State Elements : Circuits that Remember (1) Garcia, Fall 2006 © UCB One Laptop per Child  The OLPC project has been making news recently with.
CS61C L17 Combinatorial Logic Blocks (1) Beamer, Summer 2007 © UCB Scott Beamer, Instructor inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture.
CS61C L14 Introduction to Synchronous Digital Systems (1) Beamer, Summer 2007 © UCB Scott Beamer, Instructor inst.eecs.berkeley.edu/~cs61c CS61C : Machine.
CS61C L22 Representations of Combinatorial Logic Circuits (1) Eric, Spring 2010 © UCB Cal Alumni Wins 2009 Turing Award! Charles P. Thacker was named.
Give qualifications of instructors: DAP
CS61C L18 Combinational Logic Blocks, Latches (1) Chae, Summer 2008 © UCB Albert Chae, Instructor inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures.
CS 61C L15 Blocks (1) A Carle, Summer 2005 © UCB inst.eecs.berkeley.edu/~cs61c/su05 CS61C : Machine Structures Lecture #15: Combinational Logic Blocks.
CS 61C L21 State Elements: CircuitsThat Remember (1) Garcia, Fall 2004 © UCB Lecturer PSOE Dan Garcia inst.eecs.berkeley.edu/~cs61c.
CS61C L17 Combinational Logic (1) Chae, Summer 2008 © UCB Albert Chae, Instructor inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture #17.
CS 61C: Great Ideas in Computer Architecture Finite State Machines
CS61C L15 Synchronous Digital Systems (1) Beamer, Summer 2007 © UCB Scott Beamer, Instructor inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture.
CS 61C L15 State & Blocks (1) A Carle, Summer 2006 © UCB inst.eecs.berkeley.edu/~cs61c/su06 CS61C : Machine Structures Lecture #15: State 2 and Blocks.
Instructor: Justin Hsia
CS3350B Computer Architecture Winter 2015 Lecture 5.2: State Circuits: Circuits that Remember Marc Moreno Maza [Adapted.
CS 61C: Great Ideas in Computer Architecture Lecture 10: Finite State Machines, Functional Units Instructor: Sagar Karandikar
Rabie A. Ramadan Lecture 3
CS3350B Computer Architecture Winter 2015 Lecture 5.4: Combinational Logic Blocks Marc Moreno Maza [Adapted from lectures.
CDA 3101 Fall 2013 Introduction to Computer Organization The Arithmetic Logic Unit (ALU) and MIPS ALU Support 20 September 2013.
DLD Lecture 26 Finite State Machine Design Procedure.
CS 61C: Great Ideas in Computer Architecture Finite State Machines, Functional Units 1 Instructors: John Wawrzynek & Vladimir Stojanovic
MicroComputer Engineering DigitalCircuits slide 1 Combinational circuits Changes at inputs propagate at logic speed to outputs Not clocked No internal.
CS 61C L4.1.2 State (1) K. Meinz, Summer 2004 © UCB CS61C : Machine Structures Lecture State and FSMs Kurt Meinz inst.eecs.berkeley.edu/~cs61c.
Logic Design / Processor and Control Units Tony Diep.
Instructor: Justin Hsia 7/24/2013Summer Lecture #181 CS 61C: Great Ideas in Computer Architecture Combinational and Sequential Logic, Boolean Algebra.
CS61C L24 State Elements : Circuits that Remember (1) Garcia, Fall 2014 © UCB Senior Lecturer SOE Dan Garcia inst.eecs.berkeley.edu/~cs61c.
CS 61C: Great Ideas in Computer Architecture Sequential Elements, Synchronous Digital Systems 1 Instructors: Vladimir Stojanovic & Nicholas Weaver
CS 61C: Great Ideas in Computer Architecture Finite State Machines, Functional Units 1 Instructors: Vladimir Stojanovic and Nicholas Weaver
CS 110 Computer Architecture Lecture 9: Finite State Machines, Functional Units Instructor: Sören Schwertfeger School of.
Revisão de Circuitos Lógicos PARTE I. What are “Machine Structures”? Coordination of many levels of abstraction I/O systemProcesso r Compiler Operating.
Appendix C Basics of Logic Design. Appendix C — Logic Basic — 2 Logic Design Basics §4.2 Logic Design Conventions Objective: To understand how to build.
Revisão de Circuitos Lógicos PARTE III. Review Use this table and techniques we learned to transform from 1 to another.
1 Lecture 13: Sequential Circuits, FSM Today’s topics:  Sequential circuits  Finite state machines  Single-cycle CPU Reminder: midterm on Tue 10/20.
Flip Flops Lecture 10 CAP
Combinational circuits
Clocks A clock is a free-running signal with a cycle time.
Stateless Combinational Logic and State Circuits
6. Sequential circuits Rocky K. C. Chang 17 October 2017.
6. Sequential circuits (v2)
State Circuits : Circuits that Remember
Instructor: Alexander Stoytchev
There is one handout today at the front and back of the room!
Inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture #21 State Elements: Circuits that Remember Hello to James Muerle in the.
Basics Combinational Circuits Sequential Circuits Ahmad Jawdat
Instructors: Randy H. Katz David A. Patterson
Instructor: Justin Hsia
Lecture 13: Sequential Circuits, FSM
Guerilla Section #4 10/05 SDS & MIPS Datapath
5. Combinational circuits
minecraft.gamepedia.com/Tutorials/Basic_Logic_Gates
Lecture 13: Sequential Circuits, FSM
Instructor Paul Pearce
Lecture 15 Logistics Last lecture Today HW4 is due today
CSE 370 – Winter Sequential Logic-2 - 1
Hello to Casey Holgado listening from Oklahoma State!
robosavvy.com/forum/viewtopic.php?p=32542
Lecture 17 Logistics Last lecture Today HW5 due on Wednesday
The Processor Lecture 3.1: Introduction & Logic Design Conventions
Guest Lecturer TA: Shreyas Chand
Inst.eecs.berkeley.edu/~cs61c CS61CL : Machine Structures Lecture #8 – State Elements, Combinational Logic Greet class James Tu, TA.
Instructor Paul Pearce
TA David “The Punner” Eitan Poll
Lecture 17 Logistics Last lecture Today HW5 due on Wednesday
Presentation transcript:

Instructor: Michael Greenbaum CS 61C: Great Ideas in Computer Architecture (Machine Structures) Functional Units, FSMs Instructor: Michael Greenbaum 9/15/2019 Summer 2011 -- Lecture #19

Levels of Representation/Interpretation temp = v[k]; v[k] = v[k+1]; v[k+1] = temp; High Level Language Program (e.g., C) Compiler lw $t0, 0($2) lw $t1, 4($2) sw $t1, 0($2) sw $t0, 4($2) Anything can be represented as a number, i.e., data or instructions Assembly Language Program (e.g., MIPS) Assembler 0000 1001 1100 0110 1010 1111 0101 1000 1010 1111 0101 1000 0000 1001 1100 0110 1100 0110 1010 1111 0101 1000 0000 1001 0101 1000 0000 1001 1100 0110 1010 1111 Machine Language Program (MIPS) Machine Interpretation Hardware Architecture Description (e.g., block diagrams) Architecture Implementation Logic Circuit Description (Circuit Schematic Diagrams) 9/15/2019 Summer 2011 -- Lecture #19

Review Synchronous Digital Systems Synchronous - Pulse of a Clock controls flow of information Digital - All signals are seen as either 0 (below a certain voltage) or 1. SDS constructed from two types of elements: Combinational Logic - Stateless, output only a function of immediate inputs State Elements (Registers) Truth table can be mapped to gates for combinational logic design Boolean algebra allows minimization of gates State registers implemented from Flip-flops 9/15/2019 Summer 2011 -- Lecture #19

Accumulator Revisited ...Again reset signal shown In practice X might not arrive to the adder at the same time as Si-1 Si temporarily is wrong, but register always captures correct value In good circuits, instability never happens around rising edge of clk 9/15/2019 Fall 2010 -- Lecture #23

Agenda State Elements Finite State Machines Administrivia / Break Multiplexers ALU Design Adder/Subtracter 9/15/2019 Summer 2011 -- Lecture #23

Model for Synchronous Systems Collection of Combinational Logic blocks separated by registers Feedback is optional Clock signal(s) connects only to clock input of registers Clock (CLK): steady square wave that synchronizes the system Register: several bits of state that samples on rising edge of CLK (positive edge-triggered) 9/15/2019 Summer 2011 -- Lecture #23

Timing Terms Setup Time: when the input must be stable before the rising edge of the CLK Hold Time: when the input must be stable after the rising edge of the CLK “CLK-to-Q” Delay: how long it takes the output to change, measured from the rising edge of the CLK 9/15/2019 Summer 2011 -- Lecture #23

Maximum Clock Frequency What is the maximum frequency of this circuit? Hint: Frequency = 1/Period Max Delay = Setup Time + CLK-to-Q Delay + CL Delay 9/15/2019 Summer 2011 -- Lecture #23

The Critical Path The Critical Path is the longest delay between any two registers in a circuit. The clock period must be longer than this critical path, or the signal will not propagate to that next register 9/15/2019 Summer 2011 -- Lecture #19

Pipelining to Improve Performance (1/2) An extra register can be added to speed up the clock rate Timing… Note: delay of 1 clock cycle from input to output. Clock period limited by propagation delay of adder/shifter 9/15/2019 Summer 2011 -- Lecture #23

Pipelining to Improve Performance (2/2) Insertion of register allows higher clock frequency More outputs per second However, 2 (shorter) clock cycles to produce first output. Higher latency! 9/15/2019 Summer 2011 -- Lecture #23

Another Great Idea: Finite State Machines (FSM) You may have seen FSMs in other classes (have you?) Function can be represented with a “state transition diagram” With combinational logic and registers, any FSM can be implemented in hardware 9/15/2019 Summer 2011 -- Lecture #23

FSM Overview An FSM (in this class) is defined by: A set of states S A starting state s0 A transition function that maps from Current Input and Current State to Current Output and Next State. (The arrows in the diagram) 9/15/2019 Summer 2011 -- Lecture #19

Example: 3 Ones FSM Draw the FSM … FSM to detect the occurrence of 3 consecutive 1’s in the Input Draw the FSM … Assume state transitions are controlled by the clock: On each clock cycle the machine checks the inputs and moves to a new state and produces a new output … 9/15/2019 Summer 2011 -- Lecture #23

Hardware Implementation of FSM Register needed to hold a representation of the machine’s state. Unique bit pattern for each state. + Combinational logic circuit is used to implement a function maps from present state and input to next state and output. = The register is used to break the feedback path between NS and PS, controlled by the clock 9/15/2019 Summer 2011 -- Lecture #23

Hardware for FSM: Combinational Logic Can look at its functional specification, truth table form Truth table … 1 00 10 01 Output NS Input PS 9/15/2019 Summer 2011 -- Lecture #23

Administrivia Midterm rubric is posted Regrade deadline extended to next Thursday since I was late in getting this up. “We will regrade the entire test” HW3, Project 2 Part 2 will be posted today. 9/15/2019 Summer 2011 -- Lecture #19

Agenda State Elements Finite State Machines Administrivia / Break Multiplexers ALU Design Adder/Subtracter 9/15/2019 Summer 2011 -- Lecture #23

Data Multiplexer (e.g., 2-to-1 x n-bit-wide) “mux” Go to Logisim and do design from mux 9/15/2019 Summer 2011 -- Lecture #24

N Instances of 1-bit-Wide Mux How many rows in TT? 9/15/2019 Summer 2011 -- Lecture #24

How Do We Build a 1-bit-Wide Mux? Draw on Board, Build in Logisim, create as subcircuit my mux Make s north facing 9/15/2019 Summer 2011 -- Lecture #24

4-to-1 Multiplexer How many rows in TT? 9/15/2019 Summer 2011 -- Lecture #24

Alternative Hierarchical Approach 9/15/2019 Summer 2011 -- Lecture #24

In Logisim 2 to 1, 1 bit mux 4 to 1, 1 bit mux 4 to 1, 4 bit mux 9/15/2019 Summer 2011 -- Lecture #19

Common Mistakes in Logisim Connecting wires together Losing track of which input is which Connecting to edge without connecting to actual input Unexpected direction of input 1. XOR Logic with Bug.circ Works for 00, 10, 11, breaks for 01 (xor connected to input of gate – 2 wires with different values) 2. AndBug.circ Works for 00, 10, 01, fails for 11 (its not unconnected inputs to And gate – change inputs to see) (its using west facing input as an output) 3. counter without bug.circ FSM not working as change input! (facing wrong way) 9/15/2019 Summer 2011 -- Lecture #19

Agenda State Elements Finite State Machines Administrivia / Break Multiplexers ALU Design Adder/Subtracter 9/15/2019 Summer 2011 -- Lecture #23

Arithmetic and Logic Unit Most processors contain a special logic block called “Arithmetic and Logic Unit” (ALU) We’ll show you an easy one that does ADD, SUB, bitwise AND, bitwise OR 9/15/2019 Summer 2011 -- Lecture #24

Simple ALU 9/15/2019 Summer 2011 -- Lecture #24

Agenda State Elements Finite State Machines Administrivia / Break Multiplexers ALU Design Adder/Subtracter 9/15/2019 Summer 2011 -- Lecture #23

Adder/Subtractor: One-bit adder for Least Significant Bit 9/15/2019 Summer 2011 -- Lecture #24

Adder/Subtractor: One-bit adder (1/2) … 9/15/2019 Summer 2011 -- Lecture #24

Adder/Subtractor: One-bit Adder (2/2) … 9/15/2019 Summer 2011 -- Lecture #24

N x 1-bit Adders  1 N-bit Adder Connect Carry Out i-1 to Carry in i: b0 + 9/15/2019 Summer 2011 -- Lecture #24

Twos Complement Adder/Subtractor 9/15/2019 Summer 2011 -- Lecture #24

Summary D-flip-flops update at rising edge of clock Setup and Hold times important Critical path constrains clock rate Finite State Machines extremely useful Use muxes to select among input S input bits selects 2S inputs Each input can be n-bits wide, indep of S Build n-bit adder out of chained 1-bit adders. 9/15/2019 Summer 2011 -- Lecture #24