Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 8: Sequential Design Spring 2009 W. Rhett.

Slides:



Advertisements
Similar presentations
Digital System Design-II (CSEB312)
Advertisements

VERILOG: Synthesis - Combinational Logic Combination logic function can be expressed as: logic_output(t) = f(logic_inputs(t)) Rules Avoid technology dependent.
Verilog Fundamentals Shubham Singh Junior Undergrad. Electrical Engineering.
CDA 3100 Recitation Week 11.
Verilog Overview. University of Jordan Computer Engineering Department CPE 439: Computer Design Lab.
Sequential Logic in Verilog
Supplement on Verilog adder examples
EE 361 Fall 2003University of Hawaii1 Hardware Design Tips EE 361 University of Hawaii.
Combinational Logic.
Table 7.1 Verilog Operators.
Give qualifications of instructors: DAP
Slide 1 7. Verilog: Combinational always statements. VHDL: Combinational Processes: To avoid (I.E. DO NOT What in your HDL code?) Cases that generate Synthesis.
1 COMP541 Sequential Circuits Montek Singh Sep 17, 2014.
 HDLs – Verilog and Very High Speed Integrated Circuit (VHSIC) HDL  „ Widely used in logic design  „ Describe hardware  „ Document logic functions.
Verilog - 1 Writing Hardware Programs in Abstract Verilog  Abstract Verilog is a language with special semantics  Allows fine-grained parallelism to.
ECE 551 Digital System Design & Synthesis Lecture 09 Synthesis of Common Verilog Constructs.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 1: Introduction Spring 2009 W. Rhett Davis.
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.
CS 151 Digital Systems Design Lecture 37 Register Transfer Level
2-to-1 Multiplexer: if Statement Discussion D7.1 Example 4.
ELEN 468 Advanced Logic Design
From Design to Verilog EECS150 Fall Lecture #4
Advanced Verilog EECS 270 v10/23/06.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 13: Regression Testing, MemAccess Block.
Overview Logistics Last lecture Today HW5 due today
Spring 2007W. Rhett Davis with minor modification by Dean Brock UNCA ECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 7: Design Example,
Sequential Logic in Verilog
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 19: Cache Operation & Design Spring 2009.
Introduction to FPGA AVI SINGH. Prerequisites Digital Circuit Design - Logic Gates, FlipFlops, Counters, Mux-Demux Familiarity with a procedural programming.
Verilog Intro: Part 2. Procedural Blocks There are two types of procedural blocks in Verilog. – initial for single-pass behavior: initial blocks execute.
ECE 2372 Modern Digital System Design
Registers CPE 49 RMUTI KOTAT.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 2: Introduction to Verilog Syntax Spring.
ECE 551 Digital System Design & Synthesis Fall 2011 Midterm Exam Overview.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 3: Structural Modeling Spring 2009 W. Rhett.
ECE/CS 352 Digital System Fundamentals© 2001 C. Kime 1 ECE/CS 352 Digital Systems Fundamentals Spring 2001 Chapters 3 and 4: Verilog – Part 2 Charles R.
Register Transfer Level & Design with ASM
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 7: Design Example, Modeling Flip-Flops Spring.
1 COMP541 Sequential Circuits Montek Singh Feb 1, 2012.
Spring 2007 W. Rhett Davis with minor editing by J. Dean Brock UNCA ECE Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 1: Introduction.
Anurag Dwivedi. Basic Block - Gates Gates -> Flip Flops.
3/4/20031 ECE 551: Digital System Design * & Synthesis Lecture Set 3 3.1: Verilog - User-Defined Primitives (UDPs) (In separate file) 3.2: Verilog – Operators,
Behavioral Modelling - 1. Verilog Behavioral Modelling Behavioral Models represent functionality of the digital hardware. It describes how the circuit.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL State Machines Anselmo Lastra.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 16: Introduction to Buses and Interfaces.
Introduction to ASIC flow and Verilog HDL
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 4: Testing, Dataflow Modeling Spring 2009.
COMP541 Sequential Circuits
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 6: Procedural Modeling Spring 2009 W. Rhett.
Spring 20067W. Rhett Davis with minor modification by Dean Brock UNCA ECE 406Slide 1 ECE 406 Design of Complex Digital Systems Lecture 11: Data Converter,
1 COMP541 State Machines - II Montek Singh Feb 13, 2012.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 12: Intro to the LC-3 Micro-architecture.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 9: State Machines & Reset Behavior Spring.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 20: Cache Design Spring 2009 W. Rhett Davis.
SYEN 3330 Digital SystemsJung H. Kim Chapter SYEN 3330 Digital Systems Chapters 4 – Part4: Verilog – Part 2.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 10: Data-Converter Example Spring 2009 W.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 18: More Complex Interfaces Spring 2009.
1 (c) W. J. Dally Digital Design: A Systems Approach Lecture 7: Data Path State Machines.
1 Modeling Synchronous Logic Circuits Debdeep Mukhopadhyay Associate Professor Dept of Computer Science and Engineering NYU Shanghai and IIT Kharagpur.
Overview Logistics Last lecture Today HW5 due today
Hardware Description Languages: Verilog
Supplement on Verilog FF circuit examples
Adapted from Krste Asanovic
Reg and Wire:.
EMT 351/4 DIGITAL IC DESIGN Week # Synthesis of Sequential Logic 10.
Supplement on Verilog Sequential circuit examples: FSM
Hardware Description Languages: Verilog
SYNTHESIS OF SEQUENTIAL LOGIC
Supplement on Verilog Sequential circuit examples: FSM
The Verilog Hardware Description Language
Presentation transcript:

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 8: Sequential Design Spring 2009 W. Rhett Davis NC State University with significant material from Paul Franzon, Bill Allen, & Xun Liu

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 2 Announcements l HW#3 Due Today l Brief Exam Review Tuesday l Exam #1 in 1 Week l HW#4 Due in 2 Weeks

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 3 Today’s Lecture l Sequential Design w/ Simplified Coding Style l Sophisticated Coding Style

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 4 Design Process l Step 1: Write Specification l Step 2: Draw Schematic l Step 3: Write Verilog Code

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 5 Step 1: Write Specification Example: Count Down Timer from the Verilog Simulation Tutorial » 4-bit counter » count value loaded from `in’ on a positive clock edge when `latch’ is high » count value decremented by 1 on a positive clock edge when `dec’ is high » count value cleared when ‘clear’ is high » decrement stops at 0 » `zero’ flag active high whenever count value is 0

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 6 Step 2: Draw a Block Diagram l Identify from the Specification: » Ports » Registers » Datapath Logic » MUXes » Control Logic l ALWAYS DRAW A BLOCK DIAGRAM OR SCHEMATIC BEFORE CODING

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 7 Identify Ports l 4-bit counter l count value loaded from `in’ on a positive clock edge when `latch’ is high l count value decremented by 1 on a positive clock edge when `dec’ is high l count value cleared when ‘clear’ is high l decrement stops at 0 l `zero’ flag active high whenever count value is 0

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 8 Identify Registers l 4-bit counter l count value loaded from `in’ on a positive clock edge when `latch’ is high l count value decremented by 1 on a positive clock edge when `dec’ is high l count value cleared when ‘clear’ is high l decrement stops at 0 l `zero’ flag active high whenever count value is 0

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 9 Identify Datapath Logic l 4-bit counter l count value loaded from `in’ on a positive clock edge when `latch’ is high l count value decremented by 1 on a positive clock edge when `dec’ is high l count value cleared when ‘clear’ is high l decrement stops at 0 l `zero’ flag active high whenever count value is 0 l How would you implement the ==0? logic?

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 10 Identify MUXes l 4-bit counter l count value loaded from `in’ on a positive clock edge when `latch’ is high l count value decremented by 1 on a positive clock edge when `dec’ is high l count value cleared when ‘clear’ is high l decrement stops at 0 l `zero’ flag active high whenever count value is 0

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 11 Identify Control Logic l 4-bit counter l count value loaded from `in’ on a positive clock edge when `latch’ is high l count value decremented by 1 on a positive clock edge when `dec’ is high l count value cleared when ‘clear’ is high l decrement stops at 0 l `zero’ flag active high whenever count value is 0

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 12 Step 3: Write the Verilog Code l Name the internal signals l Write the description into code » Ports & internal signals » Registers » Datapath Logic » MUXes » Control Logic l Never write a piece of code if you can’t visualize the logic that it implements

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 13 Simplified Verilog Style l Verilog is a powerful and flexible language » It is very easy to describe functions that do NOT map well (or synthesize into) hardware l Constrain yourself to a subset of the language and a specific style of usage : Registers: clock) begin register_output1 <= register_input1; register_output2 <= register_input2; end MUXes and Control Logic: or input2 or...) begin end Datapath Logic: assign output =

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 14 Name the Internal Signals

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 15 Complete Verilog Code module counter (clock, in, latch, dec, clear, zero); /* simple top down counter with zero flag */ input clock; /* clock */ input [3:0] in; /* starting count */ input latch; /* latch `in’ when high */ input dec; /* decrement count when dec high */ input clear; /* clear count when clear high */ output zero; /* high when count down to zero */ reg [3:0] value; /* current count value */ reg [3:0] next_value; wire zero, enable; // D-Flip Flops with enable clock) if (enable) value <= next_value; // produce enable assign enable = latch | (dec & !zero) | clear; // input multiplexor to value register or value or in or dec or zero) begin if (latch) next_value = in; else if (dec && !zero) next_value = value - 1’b1; else next_value = 4’b0; // default is clear end // combinational logic to produce `zero’ flag assign zero = ~|value; endmodule /* counter */

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 16 clock) if (enable) value <= next_value; assign enable = latch | (dec & !zero) | clear; or value or in or dec or zero) begin if (latch) next_value = in; else if (dec && !zero) next_value = value - 1’b1; else next_value = 4’b0; // default is clear end assign zero = ~|value;

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 17 Today’s Lecture l Sequential Design w/ Simplified Coding Style l Sophisticated Coding Style

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 18 Sophisticated Style l Combine registers and as much combinational logic as you can into one clock) block clock) begin if (latch) value <= in; else if (dec && !zero) value <= value - 1’b1; else value <= 4’b0; // default is clear end assign zero = ~|value;

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 19 Comparison of Styles Simplified StyleSophisticated Style How many internal signals needed to be defined? How many lines of code? (including spaces) How many separate always blocks and assign statements? With the Sophisticated style, you’ll write descriptions faster.

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 20 Comparison of Styles Simplified StyleSophisticated Style How can you tell from the code where the flip-flops are? Do you need to worry about whether an assignment is blocking or non- blocking? With the Sophisticated style, it’s easier to make errors in your code

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 21 Summary l How do you infer flip-flops for an clock) procedure with blocking or non-blocking assignments? l Is it better to use blocking or non-blocking assignments in an clock) procedure? Why? l What are the key elements of the “simplified coding stlye”? l What Verilog constructs do you use to describe » MUXes » Control logic » Datapath logic » Registers l What would happen if you assigned the “zero” signal inside the clock) block in the “sophisticated style” example?