Outline. EECS Components and Design Techniques for Digital Systems. Lec 11 Putting it all together Where are we now?

Similar documents
Abstraction of State Elements. Sequential Logic Implementation. Forms of Sequential Logic. Finite State Machine Representations

EECS Components and Design Techniques for Digital Systems. Lec 07 PLAs and FSMs 9/ Big Idea: boolean functions <> gates.

Outline. EECS Components and Design Techniques for Digital Systems. Lec 9 Putting it all together Digital design - as we ve seen it

Review. EECS Components and Design Techniques for Digital Systems. Lec 05 Boolean Logic 9/4-04. Seq. Circuit Behavior. Outline.

Outline. EECS150 - Digital Design Lecture 6 - Field Programmable Gate Arrays (FPGAs) FPGA Overview. Why FPGAs?

EECS150 - Digital Design Lecture 6 - Field Programmable Gate Arrays (FPGAs)

ECE 2300 Digital Logic & Computer Organization. More Sequential Logic Verilog

EECS150 - Digital Design Lecture 20 - Finite State Machines Revisited

EECS150, Fall 2004, Midterm 1, Prof. Culler. Problem 1 (15 points) 1.a. Circle the gate-level circuits that DO NOT implement a Boolean AND function.

Verilog Sequential Logic. Verilog for Synthesis Rev C (module 3 and 4)

Topics. Midterm Finish Chapter 7

ECE 551: Digital System *

Sequential Logic Design

Synthesizable Verilog

EECS150 - Digital Design Lecture 5 - Verilog Logic Synthesis

Review. EECS Components and Design Techniques for Digital Systems. Lec 03 Field Programmable Gate Arrays

Digital Design with FPGAs. By Neeraj Kulkarni

Homework deadline extended to next friday

FPGA Design Challenge :Techkriti 14 Digital Design using Verilog Part 1

ECE 2300 Digital Logic & Computer Organization. More Finite State Machines

EE178 Lecture Verilog FSM Examples. Eric Crabill SJSU / Xilinx Fall 2007

Synthesis of Combinational and Sequential Circuits with Verilog

Field Programmable Gate Array

(ii) Simplify and implement the following SOP function using NOR gates:

I 3 I 2. ! Language of logic design " Logic optimization, state, timing, CAD tools

EECS150 - Digital Design Lecture 4 - Verilog Introduction. Outline

ECE 2300 Digital Logic & Computer Organization. More Verilog Finite State Machines

Chapter 10. case studies in sequential logic design

HDLs and SystemVerilog. Digital Computer Design

Sequential Circuits. inputs Comb FFs. Outputs. Comb CLK. Sequential logic examples. ! Another way to understand setup/hold/propagation time

RTL Design (Using ASM/SM Chart)

Verilog Fundamentals. Shubham Singh. Junior Undergrad. Electrical Engineering

General FSM design procedure

FPGA. Logic Block. Plessey FPGA: basic building block here is 2-input NAND gate which is connected to each other to implement desired function.

Verilog for Synthesis Ing. Pullini Antonio

Quick Introduction to SystemVerilog: Sequental Logic

Verilog for High Performance

ECE 4514 Digital Design II. Spring Lecture 15: FSM-based Control

The Verilog Language COMS W Prof. Stephen A. Edwards Fall 2002 Columbia University Department of Computer Science

CSE140L: Components and Design Techniques for Digital Systems Lab

HANSABA COLLEGE OF ENGINEERING & TECHNOLOGY (098) SUBJECT: DIGITAL ELECTRONICS ( ) Assignment

Lecture 32: SystemVerilog

University of California at Berkeley College of Engineering Department of Electrical Engineering and Computer Sciences. Spring 2010 May 10, 2010

SUBJECT CODE: IT T35 DIGITAL SYSTEM DESIGN YEAR / SEM : 2 / 3

ECE 2300 Digital Logic & Computer Organization. More Verilog Finite State Machines

VALLIAMMAI ENGINEERING COLLEGE. SRM Nagar, Kattankulathur DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING EC6302 DIGITAL ELECTRONICS

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

Blocking(=) vs Nonblocking (<=) Assignment. Lecture 3: Modeling Sequential Logic in Verilog HDL. Procedural assignments

Verilog introduction. Embedded and Ambient Systems Lab

General FSM design procedure

Lecture #1: Introduction

Topics. Midterm Finish Chapter 7

Sequential Logic Implementation. Mealy vs. Moore Machines. Specifying Outputs for a Mealy Machine. Specifying Outputs for a Moore Machine

COE 561 Digital System Design & Synthesis Introduction

Hardware Design Environments. Dr. Mahdi Abbasi Computer Engineering Department Bu-Ali Sina University

KING FAHD UNIVERSITY OF PETROLEUM & MINERALS COMPUTER ENGINEERING DEPARTMENT

problem maximum score 1 10pts 2 8pts 3 10pts 4 12pts 5 7pts 6 7pts 7 7pts 8 17pts 9 22pts total 100pts

CSE140L: Components and Design

This Lecture. Some components (useful for the homework) Verilog HDL (will continue next lecture)

Graduate Institute of Electronics Engineering, NTU. Lecturer: Chihhao Chao Date:

EPC6055 Digital Integrated Circuits EXAM 1 Fall Semester 2013

Lecture 3. Behavioral Modeling Sequential Circuits. Registers Counters Finite State Machines

Field Programmable Gate Array (FPGA)

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

Digital Design Using Digilent FPGA Boards -- Verilog / Active-HDL Edition

Register Transfer Level in Verilog: Part I

Injntu.com Injntu.com Injntu.com R16

EECS150 - Digital Design Lecture 6 - Logic Simulation

In the previous lecture, we examined how to analyse a FSM using state table, state diagram and waveforms. In this lecture we will learn how to design

In the previous lecture, we examined how to analyse a FSM using state table, state diagram and waveforms. In this lecture we will learn how to design

Finite State Machines

Verilog Hardware Description Language ROOM: B405

EEL 4783: HDL in Digital System Design

EECS Components and Design Techniques for Digital Systems. Lec 20 RTL Design Optimization 11/6/2007

Verilog. What is Verilog? VHDL vs. Verilog. Hardware description language: Two major languages. Many EDA tools support HDL-based design

Lecture #2: Verilog HDL

Finite State Machines

Logic Synthesis. EECS150 - Digital Design Lecture 6 - Synthesis

EECS150 - Digital Design Lecture 10 Logic Synthesis

Federal Urdu University of Arts, Science and Technology, Islamabad VLSI SYSTEM DESIGN. Prepared By: Engr. Yousaf Hameed.

General FSM design procedure

Announcements. Midterm 2 next Thursday, 6-7:30pm, 277 Cory Review session on Tuesday, 6-7:30pm, 277 Cory Homework 8 due next Tuesday Labs: project

Graduate Institute of Electronics Engineering, NTU Design of Datapath Controllers

One and a half hours. Section A is COMPULSORY

EECS150 - Digital Design Lecture 7 - Computer Aided Design (CAD) - Part II (Logic Simulation) Finite State Machine Review

FSM-based Digital Design using Veriiog HDL

R a) Simplify the logic functions from binary to seven segment display code converter (8M) b) Simplify the following using Tabular method

Synthesis vs. Compilation Descriptions mapped to hardware Verilog design patterns for best synthesis. Spring 2007 Lec #8 -- HW Synthesis 1

Digital Circuit Design and Language. Datapath Design. Chang, Ik Joon Kyunghee University

Laboratory Exercise 3 Davide Rossi DEI University of Bologna AA

PROGRAMMABLE MODULES SPECIFICATION OF PROGRAMMABLE COMBINATIONAL AND SEQUENTIAL MODULES

PART B. 3. Minimize the following function using K-map and also verify through tabulation method. F (A, B, C, D) = +d (0, 3, 6, 10).

Digital Integrated Circuits

Written exam for IE1204/5 Digital Design Thursday 29/

Overview. CSE372 Digital Systems Organization and Design Lab. Hardware CAD. Two Types of Chips

Evolution of Implementation Technologies. ECE 4211/5211 Rapid Prototyping with FPGAs. Gate Array Technology (IBM s) Programmable Logic

Chap 6 Introduction to HDL (d)

INTRODUCTION TO FPGA ARCHITECTURE

CS8803: Advanced Digital Design for Embedded Hardware

Digital System Design with SystemVerilog

Transcription:

Outline EECS 5 - Components and Design Techniques for Digital Systems Lec Putting it all together -5-4 David Culler Electrical Engineering and Computer Sciences University of California Berkeley Top-to-bottom What have we covered so far? Combo Lock example Hw 4 FSM to logic Mapping to FPGAs Counters revisited Announcements Another example Ant Brain Presented by: Kaushik Ravindran http:wwweecsberkeleyedu~culler http:www-insteecsberkeleyedu~cs5 Digital design - as we ve seen it System specification in words ART ART Datapath specification Controller specification Lec 5 6: Logic min Lec 8 9: Modeling FSMs Comb logic operations FSM generation Lec 4: HDLs Labs Lec 7 8: FSM impl Verilog dataflow STT STD Encoding Lec 2 3: CMOS FPGA Lec 5 6: Logic min Gates LUTs Logic: nextstateoutputs Lec 4: HDL Labs Verilog behavior Lec 2 3: CMOS FPGA Gates LUTs Where are we now? Synchronous Sequential systems Given datapath and control specifications Generate comb logic for datapath» Minimize logic for efficient implementation Generate FSM for controller» Choose implementation encoding» Generate logic for nextstate and output Describe datapath and controller in Verilog» structure dataflow and behavior» Map onto gates or LUTs Seems like a good point to test your understanding! Sequential Logic Implementation Models for representing sequential circuits Finite-state machines Moore and Mealy Representation of memory states Changes in state transitions Design procedure State diagrams Implementation choice: counters shift registers FSM State transition table State encoding Combinational logic» Next state functions» Output functions Abstraction of State Elements Divide circuit into combinational logic and state Localize feedback loops and make it easy to break cycles Implementation of storage elements leads to various forms of sequential logic

Forms of Sequential Logic Asynchronous sequential logic state changes occur whenever state inputs change elements may be simple wires or delay elements Synchronous sequential logic state changes occur in lock step across all storage elements using a periodic waveform - the clock FSM Representations States: determined by possible values in sequential storage elements Transitions: change of state Clock: controls when state can change by controlling storage elements Sequential Logic Sequences through a series of states Based on sequence of values on input signals Clock period defines elements of sequence Example: FSM Design Combo lock Combination lock from first lecture new equal reset value C C2 C3 multiplexer mux controller control clock comparator equal datapath openclosed Combo lock - controller implementation Implementation of the controller!!" $ Controller Combo Lock - State Encoding Symbolic states and outputs One possible encoding +!!-!!! *!! % % % % && % % && % % && % * % % % * * % % % && && % Concrete encoding FSM implementation Steps for the hardware designer: Word specification FSM design Encoding Verification! At this point hand over to synthesis tools: Describe FSM behavior in Verilog Synthesize controller Good encoding Better performance Fewer state bits Possibility of state minimization Tools also try to figure this out For this example go through the logic synthesis steps ideally tools take care of all this

- Example: Combo Lock Hw 43 - - - - - - - - - -! - 234 25 $ $ Logic Implementation on PLA - - - -! - Alternate logic implementations What if you had a NAND-NAND PLA Translate AND-OR logic to NAND-NAND Laws of Boolean algebra DeMorgan Other options Multi-level circuits» Library of gates for implementation technology LUTs on FPGA Alternate Logic Implementations * Theorem: Any Boolean function that can be expressed as a truth table can be written as an expression in Boolean Algebra using AND OR NOT unique? Truth Table not unique Boolean Expression [convenient for manipulation]? gate representation schematic [close to implementaton] How do we convert from one to the other? not unique Choosing different realizations of a function 6 7 8 9 : - * 5 9 : - " < &- Which realization is best? Reduce number of inputs literal: input variable complemented or not» approximate cost of logic gate is 2 transistors per literal Fewer literals means less transistors - smaller circuits Fewer inputs implies faster gates Fan-ins of gate inputs are limited in some technologies Reduce number of gates Fewer gates and the packages they come in means smaller circuits Reduce number of levels of gates Fewer level of gates implies reduced signal propagation delays How do we explore tradeoffs between increased circuit delay and size? Automated tools to generate different solutions Logic minimization: reduce number of gates and complexity Logic optimization: reduction while trading off against delay

Alternate Implementation: Controller based on Shift Register Previous implementation Comb logic as gates PLA State bits in es Alternative Shift reg to manipulate state Simplify comb logic in D n- D *** n-bit shift register clk load shft out - Controller on Shift Register Hw 44 - - - - - - " +!!-!!! *!! Combo lock controller on shift reg =" >?!?!?!? @ >!!!@ "& " -2-2 2 How does the combo lock look on an FPGA? Latches implement shift register chain of 4 es LUTs Combinational logic for out and mux control Routing fabric Connect logical nets between CLBs in 4-bit shift register out + - clk load shft - 2 2 2 Easier implementation: no need to compute any logic! Inside the FPGA Network of Combinational logic blocks memory and IO rich interconnect network special units multipliers carry-logic CLBs 3 or 4-input look up table LUT implements combinational logic functions Register optionally stores output of LUT Logic on FPGA Configure LUTs table of entries Configure es in CLB Program interconnect INPUTS Logic Block 4-LUT 4-input "look up table" set by configuration bit-stream OUTPUT LUT as general logic gate An n-lut as a direct implementation of a function truth-table Each location holds the value of the function corresponding to one input combination Example: 2-lut INPUTS AND OR Implements any function of 2 inputs How many of these are there? How many functions of n inputs? Example: 4-lut INPUTS F F F F store in st store in 2nd

User Programmability 4-LUT Implementation Latch-based Xilinx Altera + reconfigurable volatile relatively large Latches are used to: make or break cross-point connections in the interconnect 2 define the function of the logic blocks 3 set user options:» within the logic blocks» in the inputoutput blocks» global resetclock Configuration bit stream can be loaded under user control: All es are strung together in a shift chain: 6 INPUTS 6 x mux OUTPUT n-bit LUT is implemented as a 2 n x memory: inputs choose one of 2 n memory locations memory locations es are normally loaded with values from user s configuration bit stream Inputs to mux control are the CLB inputs Result is a general purpose logic gate n-lut can implement any function of n inputs! Latches programmed as part of configuration bit-stream Configuring CLBs Configuring Routes Logic Block set by configuration bit-stream INPUTS 3-LUT OUTPUT inputs A A A 2 NAND gate in FPGA CLB A 2 A A out 3-input "look up table" inputs A A A 2 Nextstate bit in FPGA CLB A 2 A A out A A A 2 A 2 A A in A A A 2 A 2 A A out = ~A A2 A3 nextstate = A2 xor A out = ~A A2 A3 nextstate = A2 xor A Sequential Systems more examples Beat the combo lock example to death Direct FSM implementation Shift register» Multiple logic representations» gates to LUTs Up next A few quick counter examples Another design problem Ant Brain AnnouncementsReminders First mid term Thursday 7 No notes Review materials are on line Feel free to approach us with questions Homework 5 optional Highly recommend doing it Lab 5 Where s the music

Can Any Sequential System be Represented with a State Diagram? Shift Register Input value shown on transition arcs Output values shown within state node! Counter Example Shift Register Input determines next state " " "! Counters are Simple Finite State Machines Counters Proceed thru well-defined state sequence in response to enable Many types of counters: binary BCD Gray-code 3-bit up-counter: 3-bit down-counter: $% module binary_upcntr q clk inputs clk outputs [2:] q reg [2:] q p always @q Next state case q 3 b: p = 3 b 3 b: p = 3 b 3 b: p = 3 b endcase always @posedge clk Update state q <= p endmodule More Complex Counter Example Complex Counter Repeats five states in sequence Not a binary number representation Step : Derive the state transition diagram Count sequence: Step 2: Derive the state transition table from the state transition diagram & * * * + + + + + + + + + -%%% More Complex Counter Example cont d Step 3: K-maps for Next State Functions Self-Starting Counters cont d Re-deriving state transition table from dont care assignment * * * * * * *" *"-*-- *"- & * * *

Self-Starting Counters Start-up States At power-up counter may be in an unused or invalid state Designer must guarantee it eventually enters a valid state Self-starting Solution Design counter so that invalid states eventually transition to a valid state May limit exploitation of dont cares Final Example: Ant Brain Ward MIT Sensors: touching wall Actuators: Goal: Strategy: L and R antennae if in F - forward step TLTR - turn leftright slightly find way out of maze keep the wall on the right % % %% Ant Behavior Designing an Ant Brain "%23%2 43%2 %25 " %23%2 43%2%2 %25 State Diagram * < "6% 43%2 %2%25 8"9% %: "7%2% 6 ":3 => < < * 8?4 = > < < =3> < < < = 3> =3> < "% %2 4"%: Synthesizing the Ant Brain Circuit Transition Truth Table Encode States Using a Set of State Variables Arbitrary choice - may affect cost speed Use Transition Truth Table Define next state function for each state variable Define output function for each output Implement next state and output functions using combinational logic 2-level logic ROMPLAPAL Multi-level logic Next state and output functions can be optimized together Using symbolic states and outputs => < < + 8?4 + 8?4 3 3 + 8?4 3 + 3 + 3 : : : : : * 8?4 = > =3> * < = 3> < < < < =3> < <

Synthesis 5 states : at least 3 state variables required X Y Z State assignment in this case arbitrarily chosen 8?4 % 3@3A -3@-3A- : :: : : : :: : : % % 5%B C% Synthesis of Next State and Output Functions 3@3A * 3@ * 3A * :2: *@A * < *@A< < Circuit Implementation Outputs are a function of the current state only - Moore machine 2% 2% * @ * A * @ A Verilog Sketch module ant_brain F TR TL L R inputs L R outputs F TR TL reg X Y Z assign F = functionx Y Z L R assign TR = functionx Y Z L R assign TL = functionx Y Z L R always @posedge clk begin X <= function X Y Z L R Y <= function X Y Z L R Z <= function X Y Z L R end endmodule Don t Cares in FSM Synthesis What happens to the "unused" states? Exploited as dont cares to minimize the logic If states cant happen then dont care what the functions do if states do happen we may be in trouble => %%$ %%2%% < < * = > =3> * < = 3> < < < < =3> < < State Minimization Fewer states may mean fewer state variables High-level synthesis may generate many redundant states Two state are equivalent if they are impossible to distinguish from the outputs of the FSM i e for any input sequence the outputs are the same Two conditions for two states to be equivalent: Output must be the same in both states 2 Must transition to equivalent states for all input combinations

Ant Brain Revisited Any equivalent states? => < < * 8?4 = > =3> * < = 3> < < < < =3> < < New Improved Brain Merge equivalent B and C states Behavior is exactly the same as the 5-state brain We now need only 2 state variables rather than 3 => < < * < < < 8?4 = >? =3> * < < = 3> < New Brain Implementation Sequential Logic Implementation Summary % 3@ -3@- @ * @ @ @* @ @ Models for representing sequential circuits Abstraction of sequential elements Finite state machines and their state diagrams Inputsoutputs Mealy Moore and synchronous Mealy machines Finite state machine design procedure Deriving state diagram Deriving state transition table Determining next state and output functions Implementing combinational logic Design hierarchy $ Good luck on the Midterm

Final Word: Blocking Vs Non-Blocking A Simple Shift Register Two types of procedural assignments Blocking Non-Blocking Why do we need them Express parallelism not straight line C Synchronous system All flip-flops clock data simultaneously How do we express parallelism in this operation? reg a b c begin a = b = a c = b end Probably not what you want! reg a b c begin a <= b <= a c <= b end This works reg a b c a = b = a c = b What order does this run? reg a b c a <= b <= a c <= b This works too The Circuit a b c reg a b c begin a = b = a c = b end a b c reg a b c begin a <= b <= a c <= b end Non-Blocking: RHS computed at beginning of execution instance LHS updated after all events in current instance computed