ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU 99-1 Under-Graduate Project Design of Datapath Controllers Speaker: Shao-Wei Feng Adviser:

Slides:



Advertisements
Similar presentations
Verilog. 2 Behavioral Description initial:  is executed once at the beginning. always:  is repeated until the end of simulation.
Advertisements

Finite State Machine (FSM)  When the sequence of actions in your design depend on the state of sequential elements, a finite state machine (FSM) can be.
Introduction to Sequential Logic Design Latches. 2 Terminology A bistable memory device is the generic term for the elements we are studying. Latches.
Multiplexors Sequential Circuits and Finite State Machines Prof. Sin-Min Lee Department of Computer Science.
Module 12.  In Module 9, 10, 11, you have been introduced to examples of combinational logic circuits whereby the outputs are entirely dependent on the.
Circuits require memory to store intermediate data
Sequential Circuit Analysis & Design Dr. Aiman H. El-Maleh Computer Engineering Department King Fahd University of Petroleum & Minerals Dr. Aiman H. El-Maleh.
Lecture 12 Latches Section , Block Diagram of Sequential Circuit gates New output is dependent on the inputs and the preceding values.
FSM examples.
Spring 20067W. Rhett Davis with minor modifications by Dean Brock ECE 406 at UNASlide 1 ECE 406 Design of Complex Digital Systems Lecture 10: 9: State.
Dr. Turki F. Al-Somani VHDL synthesis and simulation – Part 3 Microcomputer Systems Design (Embedded Systems)
Give qualifications of instructors: DAP
Logic and Computer Design Fundamentals Registers and Counters
Sequential Circuits. 2 Sequential vs. Combinational Combinational Logic:  Output depends only on current input −TV channel selector (0-9) Sequential.
ENEE 408C Lab Capstone Project: Digital System Design Fall 2005 Sequential Circuit Design.
ELEN 468 Advanced Logic Design
ECE 301 – Digital Electronics Introduction to Sequential Logic Circuits (aka. Finite State Machines) and FSM Analysis (Lecture #17)
ECE 331 – Digital Systems Design Introduction to Sequential Logic Circuits (aka. Finite State Machines) and FSM Analysis (Lecture #19)
A.Abhari CPS2131 Registers A register is a group of n flip-flops each of them capable of storing one bit of information There are two types of registers:
A State Element “Zoo”.
Test #2 Combinational Circuits – MUX Sequential Circuits – Latches – Flip-flops – Clocked Sequential Circuits – Registers/Shift Register – Counters – Memory.
Lecture 10 Topics: Sequential circuits Basic concepts Clocks
Overview Logistics Last lecture Today HW5 due today
Sequential Logic in Verilog
Digital Computer Design Fundamental
1 Chapter 5 Synchronous Sequential Logic 5-1 Sequential Circuits Every digital system is likely to have combinational circuits, most systems encountered.
EE2174: Digital Logic and Lab Professor Shiyan Hu Department of Electrical and Computer Engineering Michigan Technological University CHAPTER 9 Sequential.
Chapter 11: System Design Methodology Digital System Designs and Practices Using Verilog HDL and 2008, John Wiley11-1 Ders 8: FSM Gerçekleme ve.
ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU 99-1 Under-Graduate Project: RTL Coding Style Speaker: 蔡朝陽 Date: 2010/10/26.
Introduction to Sequential Logic Design Flip-flops FSM Analysis.
ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU Under-Graduate Project: RTL Coding Style Speaker: MingChun-Hsiao Date: 2012/11/27.
Introduction to Sequential Logic Design Finite State-Machine Design.
1 CSE370, Lecture 17 Lecture 17 u Logistics n Lab 7 this week n HW6 is due Friday n Office Hours íMine: Friday 10:00-11:00 as usual íSara: Thursday 2:30-3:20.
Slide 1 6. VHDL/Verilog Behavioral Description. Slide 2 Verilog for Synthesis: Behavioral description Instead of instantiating components, describe them.
Topic: Sequential Circuit Course: Logic Design Slide no. 1 Chapter #6: Sequential Logic Design.
1 COMP541 Sequential Circuits Montek Singh Feb 1, 2012.
DLD Lecture 26 Finite State Machine Design Procedure.
ANALYSIS OF SEQUENTIAL CIRCUITS by Dr. Amin Danial Asham.
Finite State Machine (FSM) Nattha Jindapetch December 2008.
VHDL Discussion Finite State Machines
Analysis and Synthesis of Synchronous Sequential Circuits A “synchronizing” pulse/edge signal (clock) controls the operation of the memory portion of the.
VHDL Discussion Finite State Machines IAY 0600 Digital Systems Design Alexander Sudnitson Tallinn University of Technology 1.
1 COMP541 State Machines – 2 Registers and Counters Montek Singh Feb 11, 2010.
1 COMP541 Finite State Machines - 1 Montek Singh Sep 22, 2014.
Synchronous Sequential Circuits by Dr. Amin Danial Asham.
Chapter 11: System Design Methodology Digital System Designs and Practices Using Verilog HDL and 2008, John Wiley11-1 Chapter 11: System Design.
Synchronous Sequential Circuits by Dr. Amin Danial Asham.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 9: State Machines & Reset Behavior Spring.
1 Registers A register is a group of n flip-flops each of them capable of storing one bit of information There are two types of registers: parallel and.
1 Modeling Synchronous Logic Circuits Debdeep Mukhopadhyay Associate Professor Dept of Computer Science and Engineering NYU Shanghai and IIT Kharagpur.
1 Modeling of Finite State Machines Debdeep Mukhopadhyay Associate Professor Dept of Computer Science and Engineering NYU Shanghai and IIT Kharagpur.
EMT 351/4 DIGITAL IC DESIGN Verilog Behavioral Modeling  Finite State Machine -Moore & Mealy Machine -State Encoding Techniques.
Pusat Pengajian Kejuruteraan Mikroelektronik EMT 351/4 DIGITAL IC DESIGN Verilog Behavioural Modeling (Part 4) Week #
1 COMP541 Sequential Logic – 2: Finite State Machines Montek Singh Feb 29, 2016.
1 Lecture 3: Modeling Sequential Logic in Verilog HDL.
Figure 8.1. The general form of a sequential circuit.
Chapter #6: Sequential Logic Design
Last Lecture Talked about combinational logic always statements. e.g.,
EMT 351/4 DIGITAL IC DESIGN Week # Synthesis of Sequential Logic 10.
Introduction Introduction to VHDL Entities Signals Data & Scalar Types
Verilog Coding Guideline
CPE/EE 422/522 Advanced Logic Design L02
CS Fall 2005 – Lec. #5 – Sequential Logic - 1
SYNTHESIS OF SEQUENTIAL LOGIC
FSM MODELING MOORE FSM MELAY FSM. Introduction to DIGITAL CIRCUITS MODELING & VERIFICATION using VERILOG [Part-2]
COE 202 Introduction to Verilog
Sequential Circuit Analysis & Design
Dr. Tassadaq Hussain Introduction to Verilog – Part-3 Expressing Sequential Circuits and FSM.
The Verilog Hardware Description Language
Presentation transcript:

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU 99-1 Under-Graduate Project Design of Datapath Controllers Speaker: Shao-Wei Feng Adviser: Prof. An-Yeu Wu Date: 2010/10/14

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU P. 2 Outline  Sequential Circuit Model  Finite State Machines  Useful Modeling Techniques

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU P. 3 Model of Sequential Circuits  System outputs depend not only on current input  Depend on inputs  Depend on current state  Fundamental components  Combinational circuits  Memory elements Combinational Logic Memory Elements Inputs Outputs Next State Current State clock

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU P. 4 Types of Memory Elements  Flip-Flop  Latch  Registers  Others  Register Files  Cache  Flash memory  ROM  RAM

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU P. 5 D-FF vs. D-Latch  FF is edge sensitive (can be either positive or negative edge)  At trigger edge of clock, input transferred to output  Latch is level sensitive(can be either active-high or active-low)  When clock is active, input passes to output (transparent)  When clock is not active, output stays unchanged D Q FF clk in out D Q E clk inout clk in out Latch clk in out

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU P. 6 FF Based, Edge Trigger Clocking  T d = delay of combinational logic  T cycle = cycle time of clock  Duty cycle does not matter  Timing requirements for T d  T dmax < T cycle –T setup – T cq  no setup time violation  T dmin > T hold – T cq  no hold time violation FF clk T cycle Combinational Logic T d T cq TdTd T setup

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU P. 7 Latch Based, Single Phase Clocking  Pulse Mode clocking  T cycle = cycle time of clock; T w = pulse width of clock  Timing requirements for T d  T dmax < T cycle –T dq  data latched correctly  T dmin > T w – T dq  no racing through next stage clk Combinational Logic Td Latch T cycle T dq TdTd TwTw

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU P. 8 Comparison  Flip-Flop Based − Larger in area − Larger clocking overhead (T setup, T cq )  Design more robust Only have to worry about T dmax T dmin usually small, can be easily fixed by buffer  Pulse width does not matter  Latch Based Single Phase  Smaller area  Smaller clocking overhead ( only T dq ) − Worry about both T dmax and T dmin − Pulse width does matter (unfortunately, pulse width can vary on chip)

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU P. 9 D Flip-Flop with Positive-Edge Clock module flop (Q, D, C, S, R); output Q; // Flip-Flop Output input D; // Data Input input C; // Positive Edge Clock input E; // Clock Enable reg Q; // Register Type C) begin if (E) // Check Enable Q <= D; end endmodule DQ C DQ C E

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU P. 10 D Flip-Flop with Positive-Edge Clock module flop (Q, D, C, S, R); output Q; // Flip-Flop Output input D; // Data Input input C; // Positive Edge Clock input R; // Asynchronous Reset input S; // synchronous Set reg Q; // Register Type C or negedge R) begin if (!R) Q <= 1’b0; else if (S) Q <= 1’b1; else Q <= D; end endmodule DQ C S R

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU P. 11 Latch Issue  Latches are to be avoided in most designs!  Prone to timing violations and glitches  Cannot implement synchronous operations  Common mistakes that generate latches a or b ) begin if( a == 2’d0 ) z = 1’b0; else if( a == 2’d1 ) z = ~b; else if( a == 2’d2 ) z = b; // no else statement! end a or b ) begin case( a ) 2’d0: z = b; 2’d1: z = ~b; 2’d2: z = c; // no default statement! endcase end /*forget edge!*/ clk ) begin z <= b; end

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU Finite State Machine

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU P. 13 What is FSM  A model of computation consisting of  a set of states, (limited number)  a start state,  input symbols,  a transition function that maps input symbols and current states to a next state.

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU P. 14 Elements of FSM  Memory Elements (ME)  Memorize Current States (CS)  Usually consist of FF or latch  N-bit FF have 2 n possible states  Next-state Logic (NL)  Combinational Logic  Produce next state  Based on current state (CS) and input (X)  Output Logic (OL)  Combinational Logic  Produce outputs (Z)  Based on current state  Based on current state and input

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU P. 15 Mealy Machine  Output (Z) is function of both  Input (X)  Current state (CS)

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU P. 16 Moore Machine  Output(Z) is function of  Current state (CS) only

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU P. 17 Mealy Finite State Machine A serially-transmitted BCD (8421 code) word is to be converted into an Excess-3 code. An Excess-3 code word is obtained by adding 3 to the decimal value and taking the binary equivalent. Excess-3 code is self-complementing [Wakerly, p. 80], i.e. the 9's complement of a code word is obtained by complementing the bits of the word.

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU P. 18 Mealy Finite State Machine  The vertices of the state transition graph of a Mealy machine are labeled with the states.  The branches are labeled with (1) the input that causes a transition to the indicated next state, and (2) with the output that is asserted in the present state for that input.  The state transition is synchronized to a clock.  The state table summarizes the machine's behavior in tabular format. The serial code converter is described by the state transition graph of a Mealy FSM. State Transition Graph

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU P. 19 Design of a Mealy Finite State Machine To design a D-type flip-flop realization of a FSM having the behavior described by a state transition graph, (1) select a state code, (2) encode the state table, (3) develop Boolean equations describing the input of a D-type flip-flop, and (4) using K-maps, optimize the Boolean equations.

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU P. 20 Design of a Mealy Finite State Machine Note: We will optimize the equations individually. In general - this does not necessarily produce the optimal (area, speed) realization of the logic. We'll address this when we consider synthesis.

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU P. 21 Design of a Mealy Finite State Machine Realization of the sequential BCD-to-Excess-3 code converter (Mealy machine):

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU P. 22 Design of a Mealy Finite State Machine Simulation results for Mealy machine:

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU Building Behavioral Models

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU P. 24 Modeling FSM in Verilog  Sequential Circuits  Memory elements of States (CS)  Combinational Circuits  Next-state Logic (NL)  Output Logic (OL)  Three coding styles  (1) Separate CS, OL and NL  (2) Combines NL+ OL, separate CS  (3) Combine CS + NL, separate OL

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU P. 25 Coding Style 1 – Separate CS, NL, OL  CS  NL  OL

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU P. 26 Coding Style 2 – Combine NL+OL; Separate CS  CS  NL+OL

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU P. 27 Coding Style 3 – Combine CS+NL; Separate OL  CS+NL  OL

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU P. 28 State Encoding

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU P. 29 Behavioral Models of FSM Example: Speed Machine

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU P. 30 FSM Architecture Modeling Coding style 2 Coding style 2 fits this architecture very well! Build combinational and sequential parts separately!

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU P. 31 Verilog Sample Code (using coding style 2)

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU Gate-Level Simulation of the Speed Machine P. 32

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU P. 33 Conclusion  FSM Design  Partition FSM and non-FSM logic  Partition combinational part and sequential part  Use parameter to define names of the state vector  Assign a default (reset) state