Sequential Circuit Design: Principle

Similar documents
Sequential Circuit Design: Principle

Nanosistemų programavimo kalbos 5 paskaita. Sekvencinių schemų projektavimas

EITF35: Introduction to Structured VLSI Design

EITF35: Introduction to Structured VLSI Design

SEQUENTIAL CIRCUIT DESIGN: PRINCIPLE

Sequential Logic - Module 5

Inferring Storage Elements

Lecture 12 VHDL Synthesis

ECEU530. Homework 4 due Wednesday Oct 25. ECE U530 Digital Hardware Synthesis. VHDL for Synthesis with Xilinx. Schedule

Techniques for Digital Systems Lab. Verilog HDL. Tajana Simunic Rosing. Source: Eric Crabill, Xilinx

Modeling Synchronous Logic Circuits. Debdeep Mukhopadhyay IIT Madras

VHDL Modeling Behavior from Synthesis Perspective -Part B - EL 310 Erkay Savaş Sabancı University

[VARIABLE declaration] BEGIN. sequential statements

VHDL for Synthesis. Course Description. Course Duration. Goals

Latch Based Design (1A) Young Won Lim 2/18/15

Verilog for High Performance

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

Spiral 1 / Unit 6. Flip-flops and Registers

State Machine Descriptions

ECE 545 Lecture 6. Behavioral Modeling of Sequential-Circuit Building Blocks. George Mason University

DIGITAL LOGIC WITH VHDL (Fall 2013) Unit 6

Part 4: VHDL for sequential circuits. Introduction to Modeling and Verification of Digital Systems. Memory elements. Sequential circuits

FSM Components. FSM Description. HDL Coding Methods. Chapter 7: HDL Coding Techniques

University of Technology

VHDL: RTL Synthesis Basics. 1 of 59

VHDL And Synthesis Review

DIGITAL LOGIC DESIGN VHDL Coding for FPGAs Unit 6

ECE 448 Lecture 4. Sequential-Circuit Building Blocks. Mixing Description Styles

Summary of FPGA & VHDL

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

Overview. Ram vs Register. Register File. Introduction to Structured VLSI Design. Recap Operator Sharing FSMD Counters.

Problem Set 10 Solutions

CS232 VHDL Lecture. Types

ELCT 501: Digital System Design

OUTLINE SYSTEM-ON-CHIP DESIGN. GETTING STARTED WITH VHDL September 3, 2018 GAJSKI S Y-CHART (1983) TOP-DOWN DESIGN (1)

Outcomes. Spiral 1 / Unit 6. Flip Flops FLIP FLOPS AND REGISTERS. Flip flops and Registers. Outputs only change once per clock period

Register Transfer Methodology II

Outline. Register Transfer Methodology II. 1. One shot pulse generator. Refined block diagram of FSMD

Lecture 7. Standard ICs FPGA (Field Programmable Gate Array) VHDL (Very-high-speed integrated circuits. Hardware Description Language)

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

Programmable Logic Design Grzegorz Budzyń Lecture. 6: Combinational & sequential circuits

Counters. Counter Types. Variations. Modulo Gray Code BCD (Decimal) Decade Ring Johnson (twisted ring) LFSR

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Department of Electrical Engineering and Computer Sciences

Modeling Sequential Circuits in Verilog

DESCRIPTION OF DIGITAL CIRCUITS USING VHDL

L5: Simple Sequential Circuits and Verilog

VHDL. VHDL History. Why VHDL? Introduction to Structured VLSI Design. Very High Speed Integrated Circuit (VHSIC) Hardware Description Language

Recommended Design Techniques for ECE241 Project Franjo Plavec Department of Electrical and Computer Engineering University of Toronto

EECS150 - Digital Design Lecture 5 - Verilog Logic Synthesis

FPGA for Software Engineers

Timing in synchronous systems

Finite State Machines (FSM) Description in VHDL. Review and Synthesis

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

Outcomes. Spiral 1 / Unit 6. Flip Flops FLIP FLOPS AND REGISTERS. Flip flops and Registers. Outputs only change once per clock period

HIERARCHICAL DESIGN. RTL Hardware Design by P. Chu. Chapter 13 1

Outline HIERARCHICAL DESIGN. 1. Introduction. Benefits of hierarchical design

Logic Circuits II ECE 2411 Thursday 4:45pm-7:20pm. Lecture 3

Field Programmable Gate Array

Two HDLs used today VHDL. Why VHDL? Introduction to Structured VLSI Design

Laboratory Exercise 3 Davide Rossi DEI University of Bologna AA

Synthesis from VHDL. Krzysztof Kuchcinski Department of Computer Science Lund Institute of Technology Sweden

קורס VHDL for High Performance. VHDL

Mark Redekopp, All rights reserved. EE 352 Unit 8. HW Constructs

Debouncing a Switch. A Design Example. Page 1

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

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

Lecture 9. VHDL, part IV. Hierarchical and parameterized design. Section 1 HIERARCHICAL DESIGN

CSE140L: Components and Design Techniques for Digital Systems Lab

FINITE STATE MACHINES (FSM) DESCRIPTION IN VHDL. Cristian Sisterna UNSJ

CS/EE Homework 7 Solutions

Topics. Midterm Finish Chapter 7

Digital Design with SystemVerilog

ECE 545 Lecture 6. Behavioral Modeling of Sequential-Circuit Building Blocks. Behavioral Design Style: Registers & Counters.

8 Register, Multiplexer and

TOPIC : Verilog Synthesis examples. Module 4.3 : Verilog synthesis

CSE140L: Components and Design

Control and Datapath 8

L5: Simple Sequential Circuits and Verilog

Verilog Execution Semantics

EECS150 - Digital Design Lecture 20 - Finite State Machines Revisited

Ripple Counters. Lecture 30 1

L5: Simple Sequential Circuits and Verilog

Verilog for Synthesis Ing. Pullini Antonio

Lecture 4: Modeling in VHDL (Continued ) EE 3610 Digital Systems

L5: Simple Sequential Circuits and Verilog

Used to perform operations many times. See previous Parallel to Serial Example

Introduction to Design Vision. Instructor: Prof. Shantanu Dutt. TA: Soumya Banerjee

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

ECE 574: Modeling and Synthesis of Digital Systems using Verilog and VHDL. Fall 2017 Final Exam (6.00 to 8.30pm) Verilog SOLUTIONS

Registers and finite state machines

Outline. Finite State Machine. 2. Representation of FSM. 1. Overview on FSM

Last Lecture. Talked about combinational logic always statements. e.g., module ex2(input logic a, b, c, output logic f); logic t; // internal signal

Sequential Statement

Writing Circuit Descriptions 8

Least Common Multiple (LCM)

Control Unit: Binary Multiplier. Arturo Díaz-Pérez Departamento de Computación Laboratorio de Tecnologías de Información CINVESTAV-IPN

ECE 545 Lecture 12. Datapath vs. Controller. Structure of a Typical Digital System Data Inputs. Required reading. Design of Controllers

V1 - VHDL Language. FPGA Programming with VHDL and Simulation (through the training Xilinx, Lattice or Actel FPGA are targeted) Objectives

VHDL for Logic Synthesis

Lecture 32: SystemVerilog

Transcription:

Sequential Circuit Design: Principle Chapter 8 1

Outline 1. Overview on sequential circuits 2. Synchronous circuits 3. Danger of synthesizing async circuit 4. Inference of basic memory elements 5. Simple design examples 6. Timing analysis 7. Alternative one-segment coding style 8. Use of variable for sequential circuit Chapter 8 2

1. Overview on sequential circuit Combinational vs sequential circuit Sequential circuit: output is a function of current input and state (memory) Basic memory elements D latch D FF (Flip-Flop) RAM Synchronous vs asynchronous circuit Chapter 8 3

D latch: level sensitive D FF: edge sensitive Chapter 8 4

Chapter 8 5

Problem wit D latch: Can the two D latches swap data? Chapter 8 6

Timing of a D FF: Clock-to-q delay Constraint: setup time and hold time Chapter 8 7

Synch vs asynch circuits Globally synchronous circuit: all memory elements (D FFs) controlled (synchronized) by a common global clock signal Globally asynchronous but locally synchronous circuit (GALS). Globally asynchronous circuit Use D FF but not a global clock Use no clock signal Chapter 8 8

2. Synchronous circuit One of the most difficult design aspects of a sequential circuit: How to satisfy the timing constraints The Big idea: Synchronous methodology Group all D FFs together with a single clock: Synchronous methodology Only need to deal with the timing constraint of one memory element Chapter 8 9

Basic block diagram State register (memory elements) Next-state logic (combinational circuit) Output logic (combinational circuit) Operation At the rising edge of the clock, state_next sampled and stored into the register (and becomes the new value of state_reg The next-state logic determines the new value (new state_next) and the output logic generates the output At the rising edge of the clock, the new value of state_next sampled and stored into the register Glitches have no effect as long as the state_next is stable at the sampling edge Chapter 8 10

Chapter 8 11

Sync circuit and EDA Synthesis: reduce to combinational circuit synthesis Timing analysis: involve only a single closed feedback loop (others reduce to combinational circuit analysis) Simulation: support cycle-based simulation Testing: can facilitate scan-chain Chapter 8 12

Types of sync circuits Not formally defined, Just for coding Three types: Regular sequential circuit Random sequential circuit (FSM) Combined sequential circuit (FSM with a Data path, FSMD) Chapter 8 13

3. Danger of synthesizing D Latch/DFF asynchronous circuits Are combinational circuits with feedback loop Design is different from normal combinational circuits (it is delay-sensitive) Should not be synthesized from scratch Should use pre-designed cells from device library Chapter 8 14

E.g., a D latch from scratch library ieee; use ieee.std_logic_1164.all all; entity dlatch is port ( c: in std_logic; d: in std_logic; q: out std_logic ); end dlatch; architecture demo_arch of dlatch is signal q_latch: std_logic; begin process (c, d) begin if (c= 1 ) then q_latch <= d; else q_latch <= q_latch; end if; end process; q <= q_latch; end demo_arch; Chapter 8 15

1 1 0 0 1 1 Initial values Chapter 8 16

1 0 0 0 1 1 T=t0 Chapter 8 17

1 0 1 0 0 1 T=t1 Chapter 8 18

1 0 1 1 0 0 T=t2 Chapter 8 19

1 0 1 0 0 1 T=t3 Chapter 8 20

4. Inference of basic memory elements VHDL code should be clear so that the pre-designed cells can be inferred VHDL code D Latch Positive edge-triggered D FF Negative edge-triggered D FF D FF with asynchronous reset Chapter 8 21

D Latch No else branch D latch will be inferred Chapter 8 22

Pos edge-triggered D FF No else branch Note the sensitivity list Chapter 8 23

Neg edge-triggered D FF Chapter 8 24

D FF with async reset No else branch Note the sensitivity list Chapter 8 25

Register Multiple D FFs with same clock and reset Chapter 8 26

5. Simple design examples Follow the block diagram Register Next-state logic (combinational circuit) Output logic (combinational circuit) Chapter 8 27

D FF with sync enable Note that the en is controlled by clock Note the sensitivity list Chapter 8 28

Chapter 8 29

Chapter 8 30

T FF Chapter 8 31

Chapter 8 32

Chapter 8 33

Free-running shift register Chapter 8 34

Chapter 8 35

Chapter 8 36

Chapter 8 37

Universal shift register 4 ops: parallel load, shift right, shift left, pause Chapter 8 38

Chapter 8 39

Chapter 8 40

Arbitrary sequence counter Chapter 8 41

Chapter 8 42

Free-running binary counter Count in binary sequence With a max_pulse output: asserted when counter is in 11 11 state Chapter 8 43

Chapter 8 44

Wrapped around automatically Poor practice: Chapter 8 45

Binary counter with bells & whistles Chapter 8 46

Chapter 8 47

Decade (mod-10) counter Chapter 8 48

Chapter 8 49

Programmable mod-m counter Chapter 8 50

Chapter 8 51

Chapter 8 52

Chapter 8 53

6. Timing analysis Combinational circuit: characterized by propagation delay Sequential circuit: Has to satisfy setup/hold time constraint Characterized by maximal clock rate (e.g., 200 MHz counter, 2.4 GHz Pentium II) Setup time and clock-to-q delay of register and the propagation delay of next-state logic are embedded in clock rate Chapter 8 54

state_next must satisfy the constraint Must consider effect of state_reg: can be controlled synchronized external input (from a subsystem of same clock) unsynchronized external input Approach First 2: adjust clock rate to prevent violation Last: use synchronization circuit to resolve violation Chapter 8 55

Setup time violation and maximal clock rate Chapter 8 56

Chapter 8 57

E.g., shift register; let Tcq=1.0ns Tsetup=0.5ns Chapter 8 58

E.g., Binary counter; let Tcq=1.0ns Tsetup=0.5ns Chapter 8 59

Chapter 8 60

Hold time violation Chapter 8 61

Chapter 8 62

Output delay Chapter 8 63

Input Timing of Systems Chapter 8 64

7. Alternative one-segment coding style Combine register and next-state logic/output logic in the same process May appear compact for certain simple circuit But it can be error-prone Chapter 8 65

D FF with sync enable Chapter 8 66

Chapter 8 67

Chapter 8 68

Interpretation: any left-hand-side signal within the clk event and clk= 1 branch infers a D FF Chapter 8 69

T FF Chapter 8 70

Chapter 8 71

Chapter 8 72

Chapter 8 73

Binary counter with bells & whistles Chapter 8 74

Chapter 8 75

Chapter 8 76

Free-running binary counter Count in binary sequence With a max_pulse output: asserted when counter is in 11 11 state Chapter 8 77

Chapter 8 78

Chapter 8 79

Chapter 8 80

Chapter 8 81

Chapter 8 82

Programmable mod-m counter Chapter 8 83

Chapter 8 84

Chapter 8 85

Chapter 8 86

Chapter 8 87

Two-segment code Separate memory segment from the rest Can be little cumbersome Has a clear mapping to hardware component One-segment code Mix memory segment and next-state logic / output logic Can sometimes be more compact No clear hardware mapping Error prone Two-segment code is preferred Chapter 8 88