VHDL for Modeling - Module 10

Size: px
Start display at page:

Download "VHDL for Modeling - Module 10"

Transcription

1 VHDL for Modeling Module 10 Jim Duckworth, WPI 1

2 Overview General examples AND model Flip-flop model SRAM Model Generics DDR SDRAM Model Constraints Metastability Block Statements Just for reference Jim Duckworth, WPI 2

3 We have covered VHDL for Modeling VHDL for Synthesis VHDL for testing (simulation) Now - VHDL for modeling Describes the expected behavior of a component or device Can be used to test other components for example a model of a CPU could be used to test: UART DRAM memory controller cache controller Jim Duckworth, WPI 3

4 AND gate model -- 74LS08 model (typical delays) ENTITY ls08 IS END ls08; PORT(a, b : IN std_logic; c : OUT std_logic); ARCHITECTURE behav OF ls08 IS BEGIN END behav; c <= 1 AFTER 8 ns WHEN a = 1 AND b = 1 ELSE 0 AFTER 10 ns; Jim Duckworth, WPI 4

5 Simulation Results Jim Duckworth, WPI 5

6 D flip-flop model -- 74LS74 model (typical delays) -- 74LS74 model (typical delays) ENTITY ENTITY ls74 ls74 IS IS PORT(d, PORT(d, clr, clr, pre, pre, clk clk : : IN IN std_logic; std_logic; q : OUT std_logic); q : OUT std_logic); END END ls74; ls74; ARCHITECTURE ARCHITECTURE behav behav OF OF ls74 ls74 IS IS BEGIN BEGIN PROCESS(clk, clr, pre) PROCESS(clk, clr, pre) BEGIN BEGIN IF clr = 0 THEN IF clr = 0 THEN q <= 0 AFTER 25 ns; q <= 0 AFTER 25 ns; ELSIF pre = 0 THEN ELSIF pre = 0 THEN q <= 1 AFTER 13 ns; q <= 1 AFTER 13 ns; ELSIF clk EVENT AND clk = 1 THEN ELSIF clk EVENT AND clk = 1 THEN IF IF d d = = 1 1 THEN THEN q q <= <= 1 1 AFTER AFTER ns; ns; ELSE ELSE q q <= <= 0 0 AFTER AFTER ns; ns; END END IF; IF; END END IF; IF; END END PROCESS; PROCESS; END END behav; behav; Jim Duckworth, WPI 6

7 Simulation Results Jim Duckworth, WPI 7

8 Adding Constants - same as previous -- 74LS74 model (typical delays) ENTITY ls74 IS PORT(d, clr, pre, clk : IN std_logic; q : OUT std_logic); CONSTANT t_rise : TIME := 13 ns; CONSTANT t_fall : TIME := 25 ns; END ls74; ARCHITECTURE behav OF ls74 IS BEGIN PROCESS(clk, clr, pre) BEGIN IF clr = 0 THEN q <= 0 AFTER t_fall; ELSIF pre = 0 THEN q <= 1 AFTER t_rise; ELSIF clk EVENT AND clk = 1 THEN IF d = 1 THEN q <= 1 AFTER t_rise; ELSE q <= 0 AFTER t_fall; END IF; END IF; END PROCESS; END behav; Jim Duckworth, WPI 8

9 Adding setup and pulse width checks LIBRARY ieee; USE ieee.std_logic_1164.all; ENTITY ls74 IS PORT(d, clr, pre, clk : IN std_logic; q : OUT std_logic); CONSTANT t_rise : TIME := 13 ns; CONSTANT t_fall : TIME := 25 ns; CONSTANT t_setup : TIME := 20 ns; CONSTANT t_width : TIME := 25 ns; END ls74; Jim Duckworth, WPI 9

10 Basic D flip-flop description same ARCHITECTURE behav OF ls74 IS BEGIN PROCESS(clk, clr, pre) BEGIN IF clr = '0' THEN q <= '0' AFTER t_fall; ELSIF pre = '0' THEN q <= '1' AFTER t_rise; ELSIF clk'event AND clk = '1' THEN IF d = '1' THEN q <= '1' AFTER t_rise; ELSE q <= '0' AFTER t_fall; END IF; END IF; END PROCESS; Jim Duckworth, WPI 10

11 Add setup and pulse width checks -- process to check data setup time PROCESS(clk) BEGIN IF clk'event AND clk = '1' THEN ASSERT d'last_event > t_setup REPORT "D changed within setup time" SEVERITY ERROR; END IF; END PROCESS; -- process to check clock high pulse width PROCESS(clk) VARIABLE last_clk : TIME := 0 ns; BEGIN IF clk'event AND clk = '0' THEN ASSERT NOW - last_clk > t_width REPORT "Clock pulse width too short" SEVERITY ERROR; ELSE last_clk := NOW; END IF; END PROCESS; END behav; Jim Duckworth, WPI 11

12 LS74 Model in ModelSim Jim Duckworth, WPI 12

13 Test Bench without SRAM SRAM connections are open DSP Picoblaze ZZ Display Jim Duckworth, WPI 13

14 SRAM model simplified, no delays Jim Duckworth, WPI 14

15 New testbench Adding the SRAM model DSP Picoblaze Display SRAM Model Jim Duckworth, WPI 15

16 Adding the SRAM model to the test bench Jim Duckworth, WPI 16

17 ISSI SRAM Verilog Model (partial) // IS61LV25616 Asynchronous SRAM, 256K x 16 = 4M; speed: 10ns. // Note; 1) Please include "+define+ OEb" in running script if you want to check // timing in the case of OE_ being set. // 2) Please specify access time by defining tac_10 or tac_12. // `define OEb `define tac_10 `timescale 1ns/10ps module IS61LV25616 (A, IO, CE_, OE_, WE_, LB_, UB_); parameter dqbits = 16; parameter memdepth = ; parameter addbits = 18; parameter Toha = 2; parameter Tsa = 2; `ifdef tac_10 parameter Taa = 10, Thzce = 3, Thzwe = 5; `endif `ifdef tac_12 parameter Taa = 12, Thzce = 5, Thzwe = 6; `endif input CE_, OE_, WE_, LB_, UB_; input [(addbits - 1) : 0] A; inout [(dqbits - 1) : 0] IO; wire [(dqbits - 1) : 0] dout; reg [(dqbits/2-1) : 0] bank0 [0 : memdepth]; Jim Duckworth, WPI 17

18 Generics Generics useful for making design units more general purpose Generics allow information to be passed into a design description Example information propagation delays size of component (changing input and output ports) load capacitance/resistance Jim Duckworth, WPI 18

19 LS08 example with generics -- 74LS08 model ENTITY ls08 IS GENERIC(t_rise, t_fall : TIME); END ls08; PORT(a, b : IN std_logic; c : OUT std_logic); ARCHITECTURE behav OF ls08 IS BEGIN END behav; c <= 1 AFTER t_rise WHEN a = 1 AND b = 1 ELSE 0 AFTER t_fall; This is now a parameterized model (general purpose) rather than hard-coded version Actual delay is determined at simulation time (or synthesis) by value passed to model Jim Duckworth, WPI 19

20 Instantiating Components with Generics -- example use of LS08 with generic values ENTITY test IS PORT(in1, in2, in3 : IN std_logic; END test; out1 : OUT std_logic); ARCHITECTURE behav OF test IS BEGIN END behav; COMPONENT ls08 GENERIC(t_rise, t_fall : TIME); PORT(a, b : IN std_logic; c : OUT std_logic); END COMPONENT; SIGNAL int : std_logic; u1: ls08 GENERIC MAP(8 ns, 10 ns) -- typical delays PORT MAP(a => in1, b => in2, c => int); u2: ls08 GENERIC MAP(15 ns, 20 ns)-- max delays PORT MAP(a => int, b => in3, c => out1); Jim Duckworth, WPI 20

21 Another Example (with default values) Can provide default values for generics Only need GENERIC MAP if necessary to change them ENTITY and2 IS GENERIC(t_rise, t_fall : TIME := 10 ns; load : INTEGER := 3); PORT(a, b IN : IN std_logic; c : OUT std_logic); END and2; ARCHITECTURE generic_model OF and2 IS BEGIN c <= 1 AFTER (t_rise + (load * 2 ns)) WHEN a = 1 AND b = 1 ELSE 0 AFTER (t_fall + (load * 2 ns)); END generic_model; u1: and2 GENERIC MAP(5 ns, 7 ns, 4) PORT MAP (a = > ); -- default overridden u2: and2 PORT MAP(a => ); -- uses default values Jim Duckworth, WPI 21

22 Modifying Component Size Jim Duckworth, WPI 22

23 Making two copies different size Jim Duckworth, WPI 23

24 Schematic of two shift registers Jim Duckworth, WPI 24

25 DDR SDRAM Model Jim Duckworth, WPI 25

26 DDR SDRAM Model (cont d) Jim Duckworth, WPI 26

27 DDR SDRAM Model (cont d) Jim Duckworth, WPI 27

28 DDR SDRAM Model (cont d) Jim Duckworth, WPI 28

29 DDR SDRAM Model (cont d) Jim Duckworth, WPI 29

30 Metastability Flip-flops may go metastable if input signals do not meet setup and hold specifications relative to clock signal CLK D Q Rules: Input only drives one FF Add 2-FF synchronizer IF clk EVENT AND clk = 1 THEN input_d <= input; input_dd <= input_d; Jim Duckworth, WPI 30

31 Constraints (for ref) Used to guide the synthesis tools Example 32-bit counter - no constraints (speed grades -4 and -5) ====================================================== Advanced HDL Synthesis Report Macro Statistics # Counters : 1 32-bit up counter : 1 ====================================================== Timing Summary: Speed Grade: -4 Minimum period: 6.680ns (Maximum Frequency: MHz) Minimum input arrival time before clock: No path found Maximum output required time after clock: 8.094ns Maximum combinational path delay: No path found =============================================== Speed Grade: -5 Minimum period: 5.767ns (Maximum Frequency: MHz) Jim Duckworth, WPI 31

32 Adding timing constraint Add to UCF file: NET "clk" PERIOD = 6ns HIGH 50%; WARNING:Par:62 - Your design did not meet timing Constraint Check Worst Case Best Case Timing Timing Slack Achievable Errors Score * NET "clk_bufgp/ibufg" PERIOD = 6 ns HIGH SETUP ns 6.456ns % HOLD 2.432ns constraint not met. Jim Duckworth, WPI 32

33 Try relaxing constraint NET "clk" PERIOD = 6.5ns HIGH 50%; Constraint Check Worst Case Best Case Timing Timing Slack Achievable Errors Score NET "clk_bufgp/ibufg" PERIOD = 6.5 ns HIG SETUP 0.203ns 6.297ns 0 0 H 50% HOLD 2.280ns All constraints were met. Also see Timing Constraint User Guide Examples: NET abc OFFSET = OUT xx ns AFTER clk ; NET def OFFSET = IN xx ns BEFORE clk ; Jim Duckworth, WPI 33

34 BLOCK statements (for ref) BLOCK statements can be used to partition and logically group areas of the design Like a schematic sheet Example: design of a CPU, divide into ALU block Control block Decode block Blocks represent a self-contained area, each block can: declare lcoal signals types, constants, etc. Blocks can reference signals from a level above Jim Duckworth, WPI 34

35 Example ENTITY cpu IS PORT(clk : IN std_logic; input_bus : IN std_logic_vector(63 DOWNTO 0); ); -- port descriptions END cpu; ARCHITECTURE block_model OF cpu IS SIGNAL instruction_bus, src_operand : std_logic_vector(63 DOWNTO 0); BEGIN alu: BLOCK SIGNAL inst_bus, data_bus : std_logic_vector(31 DOWNTO 0); BEGIN -- statements describing ALU operation END BLOCK alu; decode: BLOCK SIGNAL ; -- signals local to this decode block BEGIN -- statements describing decode operation END BLOCK decode; END block_model; Jim Duckworth, WPI 35

Verilog for Modeling - Module 9

Verilog for Modeling - Module 9 Verilog for Modeling Module 9 Jim Duckworth, WPI 1 General examples AND model Flip-flop model SRAM Model Customizing Models Generics in VHDL DDR SDRAM Model Parameters in Verilog Overview Commercial memory

More information

Sequential Logic - Module 5

Sequential Logic - Module 5 Sequential Logic Module 5 Jim Duckworth, WPI 1 Latches and Flip-Flops Implemented by using signals in IF statements that are not completely specified Necessary latches or registers are inferred by the

More information

Test Benches - Module 8

Test Benches - Module 8 Test Benches Module 8 Jim Duckworth, WPI 1 Overview We have concentrated on VHDL for synthesis Can also use VHDL as a test language Very important to conduct comprehensive verification on your design To

More information

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

Verilog Sequential Logic. Verilog for Synthesis Rev C (module 3 and 4) Verilog Sequential Logic Verilog for Synthesis Rev C (module 3 and 4) Jim Duckworth, WPI 1 Sequential Logic Module 3 Latches and Flip-Flops Implemented by using signals in always statements with edge-triggered

More information

Sequential Statement

Sequential Statement Sequential Statement Sequential Logic Output depends not only on current input values but also on previous input values. Are building blocks of; Counters Shift registers Memories Flip flops are basic sequential

More information

Computer-Aided Digital System Design VHDL

Computer-Aided Digital System Design VHDL بس م اهلل الر حم ن الر حی م Iran University of Science and Technology Department of Computer Engineering Computer-Aided Digital System Design VHDL Ramin Rajaei ramin_rajaei@ee.sharif.edu Modeling Styles

More information

Problem Set 10 Solutions

Problem Set 10 Solutions CSE 260 Digital Computers: Organization and Logical Design Problem Set 10 Solutions Jon Turner thru 6.20 1. The diagram below shows a memory array containing 32 words of 2 bits each. Label each memory

More information

Field Programmable Gate Array

Field Programmable Gate Array Field Programmable Gate Array System Arch 27 (Fire Tom Wada) What is FPGA? System Arch 27 (Fire Tom Wada) 2 FPGA Programmable (= reconfigurable) Digital System Component Basic components Combinational

More information

Verilog Module 1 Introduction and Combinational Logic

Verilog Module 1 Introduction and Combinational Logic Verilog Module 1 Introduction and Combinational Logic Jim Duckworth ECE Department, WPI 1 Module 1 Verilog background 1983: Gateway Design Automation released Verilog HDL Verilog and simulator 1985: Verilog

More information

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

ECE 574: Modeling and Synthesis of Digital Systems using Verilog and VHDL. Fall 2017 Final Exam (6.00 to 8.30pm) Verilog SOLUTIONS ECE 574: Modeling and Synthesis of Digital Systems using Verilog and VHDL Fall 2017 Final Exam (6.00 to 8.30pm) Verilog SOLUTIONS Note: Closed book no notes or other material allowed apart from the one

More information

Midterm Exam Thursday, October 24, :00--2:15PM (75 minutes)

Midterm Exam Thursday, October 24, :00--2:15PM (75 minutes) Last (family) name: Answer Key First (given) name: Student I.D. #: Department of Electrical and Computer Engineering University of Wisconsin - Madison ECE 551 Digital System Design and Synthesis Midterm

More information

In our case Dr. Johnson is setting the best practices

In our case Dr. Johnson is setting the best practices VHDL Best Practices Best Practices??? Best practices are often defined by company, toolset or device In our case Dr. Johnson is setting the best practices These rules are for Class/Lab purposes. Industry

More information

Note: Closed book no notes or other material allowed, no calculators or other electronic devices.

Note: Closed book no notes or other material allowed, no calculators or other electronic devices. ECE 574: Modeling and Synthesis of Digital Systems using Verilog and VHDL Fall 2017 Exam Review Note: Closed book no notes or other material allowed, no calculators or other electronic devices. One page

More information

Summary of FPGA & VHDL

Summary of FPGA & VHDL FYS4220/9220 Summary of FPGA & VHDL Lecture #6 Jan Kenneth Bekkeng, University of Oslo - Department of Physics 16.11.2011 Curriculum (VHDL & FPGA part) Curriculum (Syllabus) defined by: Lectures Lecture6:

More information

EEL 4712 Digital Design Test 1 Spring Semester 2007

EEL 4712 Digital Design Test 1 Spring Semester 2007 IMPORTANT: Please be neat and write (or draw) carefully. If we cannot read it with a reasonable effort, it is assumed wrong. COVER SHEET: Problem: Points: 1 (15 pts) 2 (20 pts) Total 3 (15 pts) 4 (18 pts)

More information

IT T35 Digital system desigm y - ii /s - iii

IT T35 Digital system desigm y - ii /s - iii UNIT - V Introduction to Verilog Hardware Description Language Introduction HDL for combinational circuits Sequential circuits Registers and counters HDL description for binary multiplier. 5.1 INTRODUCTION

More information

Design Problem 3 Solutions

Design Problem 3 Solutions CSE 260 Digital Computers: Organization and Logical Design Jon Turner Design Problem 3 Solutions In this problem, you are to design, simulate and implement a sequential pattern spotter, using VHDL. This

More information

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

Two HDLs used today VHDL. Why VHDL? Introduction to Structured VLSI Design Two HDLs used today Introduction to Structured VLSI Design VHDL I VHDL and Verilog Syntax and ``appearance'' of the two languages are very different Capabilities and scopes are quite similar Both are industrial

More information

CPE 626 Advanced VLSI Design Lecture 6: VHDL Synthesis. Register File: An Example. Register File: An Example (cont d) Aleksandar Milenkovic

CPE 626 Advanced VLSI Design Lecture 6: VHDL Synthesis. Register File: An Example. Register File: An Example (cont d) Aleksandar Milenkovic CPE 626 Lecture 6: VHDL Synthesis Aleksandar Milenkovic http://www.ece.uah.edu/~milenka http://www.ece.uah.edu/~milenka/cpe626-04f/ milenka@ece.uah.edu Assistant Professor Electrical and Computer Engineering

More information

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

VHDL. VHDL History. Why VHDL? Introduction to Structured VLSI Design. Very High Speed Integrated Circuit (VHSIC) Hardware Description Language VHDL Introduction to Structured VLSI Design VHDL I Very High Speed Integrated Circuit (VHSIC) Hardware Description Language Joachim Rodrigues A Technology Independent, Standard Hardware description Language

More information

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

Lecture 4: Modeling in VHDL (Continued ) EE 3610 Digital Systems EE 3610: Digital Systems 1 Lecture 4: Modeling in VHDL (Continued ) Sequential Statements Use Process process (sensitivity list) variable/constant declarations Sequential Statements end process; 2 Sequential

More information

Assignment. Last time. Last time. ECE 4514 Digital Design II. Back to the big picture. Back to the big picture

Assignment. Last time. Last time. ECE 4514 Digital Design II. Back to the big picture. Back to the big picture Assignment Last time Project 4: Using synthesis tools Synplify Pro and Webpack Due 11/11 ning of class Generics Used to parameterize models E.g., Delay, bit width Configurations Configuration specification

More information

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

Part 4: VHDL for sequential circuits. Introduction to Modeling and Verification of Digital Systems. Memory elements. Sequential circuits M1 Informatique / MOSIG Introduction to Modeling and erification of Digital Systems Part 4: HDL for sequential circuits Laurence PIERRE http://users-tima.imag.fr/amfors/lpierre/m1arc 2017/2018 81 Sequential

More information

VHDL Testbench. Test Bench Syntax. VHDL Testbench Tutorial 1. Contents

VHDL Testbench. Test Bench Syntax. VHDL Testbench Tutorial 1. Contents VHDL Testbench Tutorial 1 Contents 1 VHDL Testbench 2 Test Bench Syntax 3 Testbench Example: VHDL Code for Up Down Binary Counter 4 VHDL Testbench code for up down binary counter 5 Testbench Waveform for

More information

!"#$%&&"'(')"*+"%,%-".#"'/"'.001$$"

!#$%&&'(')*+%,%-.#'/'.001$$ !"#$%&&"'(')"*+"%,%-".#"'/"'.001$$"!!"#$%&'#()#*+"+#,-."/0110#230#4."50",+"+#)6# 6+-+#(.6+-0#)4475.8)60#0/#.65-0#230#9+**+"+# 2.48).-0#(.6+-0#! 2+"*5."5*:#,."/0110#;)**0! *),".6*:#-.99-0*0"5."+#2+660,.40"5)#;)*)2)#

More information

CSE 260 Introduction to Digital Logic and Computer Design. Exam 1. Your name 2/13/2014

CSE 260 Introduction to Digital Logic and Computer Design. Exam 1. Your name 2/13/2014 CSE 260 Introduction to Digital Logic and Computer Design Jonathan Turner Exam 1 Your name 2/13/2014 1. (10 points) Draw a logic diagram that implements the expression A(B+C)(C +D)(B+D ) directly (do not

More information

Timing in synchronous systems

Timing in synchronous systems BO 1 esign of sequential logic Outline Timing in synchronous networks Synchronous processes in VHL VHL-code that introduces latches andf flip-flops Initialization of registers Mealy- and Moore machines

More information

Introduction to VHDL Lecture D

Introduction to VHDL Lecture D Introduction to VHDL Lecture D Prof. K. J. Hintz Department of Electrical and Computer Engineering George Mason University Copyright 1995, 1996 Basic VHDL RASSP Education & Facilitation Module 10 Version

More information

DIGITAL LOGIC WITH VHDL (Fall 2013) Unit 1

DIGITAL LOGIC WITH VHDL (Fall 2013) Unit 1 DIGITAL LOGIC WITH VHDL (Fall 23) Unit DESIGN FLOW DATA TYPES LOGIC GATES WITH VHDL TESTBENCH GENERATION DESIGN FLOW Design Entry: We specify the logic circuit using a Hardware Description Language (e.g.,

More information

The University of Alabama in Huntsville ECE Department CPE Midterm Exam Solution March 2, 2006

The University of Alabama in Huntsville ECE Department CPE Midterm Exam Solution March 2, 2006 The University of Alabama in Huntsville ECE Department CPE 526 01 Midterm Exam Solution March 2, 2006 1. (15 points) A barrel shifter is a shift register in which the data can be shifted either by one

More information

Experiment 0 OR3 Gate ECE 332 Section 000 Dr. Ron Hayne June 8, 2003

Experiment 0 OR3 Gate ECE 332 Section 000 Dr. Ron Hayne June 8, 2003 Experiment 0 OR3 Gate ECE 332 Section 000 Dr. Ron Hayne June 8, 2003 On my honor I have neither received nor given aid on this report. Signed: Ronald J. Hayne Part I Description of the Experiment Experiment

More information

VHDL Examples Mohamed Zaky

VHDL Examples Mohamed Zaky VHDL Examples By Mohamed Zaky (mz_rasmy@yahoo.co.uk) 1 Half Adder The Half Adder simply adds 2 input bits, to produce a sum & carry output. Here we want to add A + B to produce Sum (S) and carry (C). A

More information

Digital Design with SystemVerilog

Digital Design with SystemVerilog Digital Design with SystemVerilog Prof. Stephen A. Edwards Columbia University Spring 25 Synchronous Digital Design Combinational Logic Sequential Logic Summary of Modeling Styles Testbenches Why HDLs?

More information

EITF35: Introduction to Structured VLSI Design

EITF35: Introduction to Structured VLSI Design EITF35: Introduction to Structured VLSI Design Part 1.2.2: VHDL-1 Liang Liu liang.liu@eit.lth.se 1 Outline VHDL Background Basic VHDL Component An example FSM Design with VHDL Simulation & TestBench 2

More information

[VARIABLE declaration] BEGIN. sequential statements

[VARIABLE declaration] BEGIN. sequential statements PROCESS statement (contains sequential statements) Simple signal assignment statement

More information

CS/EE Homework 7 Solutions

CS/EE Homework 7 Solutions CS/EE 260 - Homework 7 Solutions 4/2/2001 1. (20 points) A 4 bit twisted ring counter is a sequential circuit which produces the following sequence of output values: 0000, 1000, 1100, 1110, 1111, 0111,

More information

COVER SHEET: Total: Regrade Info: 5 (14 points) 7 (15 points) Midterm 1 Spring 2012 VERSION 1 UFID:

COVER SHEET: Total: Regrade Info: 5 (14 points) 7 (15 points) Midterm 1 Spring 2012 VERSION 1 UFID: EEL 4712 Midterm 1 Spring 2012 VERSION 1 Name: UFID: IMPORTANT: Please be neat and write (or draw) carefully. If we cannot read it with a reasonable effort, it is assumed wrong. As always, the best answer

More information

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

Logic Circuits II ECE 2411 Thursday 4:45pm-7:20pm. Lecture 3 Logic Circuits II ECE 2411 Thursday 4:45pm-7:20pm Lecture 3 Lecture 3 Topics Covered: Chapter 4 Discuss Sequential logic Verilog Coding Introduce Sequential coding Further review of Combinational Verilog

More information

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

Synthesis from VHDL. Krzysztof Kuchcinski Department of Computer Science Lund Institute of Technology Sweden Synthesis from VHDL Krzysztof Kuchcinski Krzysztof.Kuchcinski@cs.lth.se Department of Computer Science Lund Institute of Technology Sweden March 23, 2006 Kris Kuchcinski (LTH) Synthesis from VHDL March

More information

VHDL And Synthesis Review

VHDL And Synthesis Review VHDL And Synthesis Review VHDL In Detail Things that we will look at: Port and Types Arithmetic Operators Design styles for Synthesis VHDL Ports Four Different Types of Ports in: signal values are read-only

More information

Schedule. ECE U530 Digital Hardware Synthesis. Rest of Semester. Midterm Question 1a

Schedule. ECE U530 Digital Hardware Synthesis. Rest of Semester. Midterm Question 1a ECE U530 Digital Hardware Synthesis Prof. Miriam Leeser mel@coe.neu.edu November 8, 2006 Midterm Average: 70 Lecture 16: Midterm Solutions Homework 6: Calculator Handshaking HW 6: Due Wednesday, November

More information

VHDL/Verilog Simulation. Testbench Design

VHDL/Verilog Simulation. Testbench Design VHDL/Verilog Simulation Testbench Design The Test Bench Concept Elements of a VHDL/Verilog testbench Unit Under Test (UUT) or Device Under Test (DUT) instantiate one or more UUT s Stimulus of UUT inputs

More information

CCE 3202 Advanced Digital System Design

CCE 3202 Advanced Digital System Design CCE 3202 Advanced Digital System Design Lab Exercise #2 This lab exercise will show you how to create, synthesize, and test a 3-bit ripple counter. A ripple counter is simply a circuit that outputs the

More information

Design Examples. ELEC 418 Advanced Digital Systems Dr. Ron Hayne. Images Courtesy of Cengage Learning

Design Examples. ELEC 418 Advanced Digital Systems Dr. Ron Hayne. Images Courtesy of Cengage Learning Design Examples ELEC 418 Advanced Digital Systems Dr. Ron Hayne Images Courtesy of Cengage Learning BCD to 7-Segment Display 418_04 2 BCD to 7-Segment Display entity BCD_Seven is port(bcd: in std_logic_vector(3

More information

ECEU530. Schedule. ECE U530 Digital Hardware Synthesis. Datapath for the Calculator (HW 5) HW 5 Datapath Entity

ECEU530. Schedule. ECE U530 Digital Hardware Synthesis. Datapath for the Calculator (HW 5) HW 5 Datapath Entity ECE U530 Digital Hardware Synthesis Prof. Miriam Leeser mel@coe.neu.edu November 6, 2006 Classes November 6 and 8 are in 429 Dana! Lecture 15: Homework 5: Datapath How to write a testbench for synchronous

More information

DIGITAL LOGIC DESIGN VHDL Coding for FPGAs Unit 6

DIGITAL LOGIC DESIGN VHDL Coding for FPGAs Unit 6 DIGITAL LOGIC DESIGN VHDL Coding for FPGAs Unit 6 FINITE STATE MACHINES (FSMs) Moore Machines Mealy Machines Algorithmic State Machine (ASM) charts FINITE STATE MACHINES (FSMs) Classification: Moore Machine:

More information

The University of Alabama in Huntsville ECE Department CPE Final Exam Solution Spring 2004

The University of Alabama in Huntsville ECE Department CPE Final Exam Solution Spring 2004 The University of Alabama in Huntsville ECE Department CPE 526 01 Final Exam Solution Spring 2004 1. (15 points) An old Thunderbird car has three left and three right tail lights, which flash in unique

More information

VHDL in 1h. Martin Schöberl

VHDL in 1h. Martin Schöberl VHDL in 1h Martin Schöberl VHDL /= C, Java, Think in hardware All constructs run concurrent Different from software programming Forget the simulation explanation VHDL is complex We use only a small subset

More information

Outline. CPE/EE 422/522 Advanced Logic Design L05. Review: General Model of Moore Sequential Machine. Review: Mealy Sequential Networks.

Outline. CPE/EE 422/522 Advanced Logic Design L05. Review: General Model of Moore Sequential Machine. Review: Mealy Sequential Networks. Outline CPE/EE 422/522 Advanced Logic Design L05 Electrical and Computer Engineering University of Alabama in Huntsville What we know Combinational Networks Sequential Networks: Basic Building Blocks,

More information

ENGG3380: Computer Organization and Design Lab4: Buses and Peripheral Devices

ENGG3380: Computer Organization and Design Lab4: Buses and Peripheral Devices ENGG3380: Computer Organization and Design Lab4: Buses and Peripheral Devices School of Engineering, University of Guelph Winter 2017 1 Objectives: The purpose of this lab is : Learn basic bus design techniques.

More information

The University of Alabama in Huntsville Electrical and Computer Engineering CPE/EE 422/522 Spring 2005 Homework #6 Solution

The University of Alabama in Huntsville Electrical and Computer Engineering CPE/EE 422/522 Spring 2005 Homework #6 Solution 5.3(a)(2), 5.6(c)(2), 5.2(2), 8.2(2), 8.8(2) The University of Alabama in Huntsville Electrical and Computer Engineering CPE/EE 422/522 Spring 25 Homework #6 Solution 5.3 (a) For the following SM chart:

More information

Mridula Allani Fall Fall

Mridula Allani Fall Fall Mridula Allani Fall 2010 Fall 2010 1 Model and document digital systems Hierarchical models System, RTL (Register Transfer Level), gates Different levels of abstraction Behavior, structure Verify circuit/system

More information

VHDL: Modeling RAM and Register Files. Textbook Chapters: 6.6.1, 8.7, 8.8, 9.5.2, 11.2

VHDL: Modeling RAM and Register Files. Textbook Chapters: 6.6.1, 8.7, 8.8, 9.5.2, 11.2 VHDL: Modeling RAM and Register Files Textbook Chapters: 6.6.1, 8.7, 8.8, 9.5.2, 11.2 Memory Synthesis Approaches: Random logic using flip-flops or latches Register files in datapaths RAM standard components

More information

FPGA briefing Part II FPGA development DMW: FPGA development DMW:

FPGA briefing Part II FPGA development DMW: FPGA development DMW: FPGA briefing Part II FPGA development FPGA development 1 FPGA development FPGA development : Domain level analysis (Level 3). System level design (Level 2). Module level design (Level 1). Academical focus

More information

COE 405, Term 062. Design & Modeling of Digital Systems. HW# 1 Solution. Due date: Wednesday, March. 14

COE 405, Term 062. Design & Modeling of Digital Systems. HW# 1 Solution. Due date: Wednesday, March. 14 COE 405, Term 062 Design & Modeling of Digital Systems HW# 1 Solution Due date: Wednesday, March. 14 Q.1. Consider the 4-bit carry-look-ahead adder (CLA) block shown below: A 3 -A 0 B 3 -B 0 C 3 4-bit

More information

VHDL for Logic Synthesis

VHDL for Logic Synthesis VHDL for Logic Synthesis Overview Design Flow for Hardware Design VHDL coding for synthesis General guidelines for hardware designers This lecture includes the content from: Nitin Yogi, Modelling for Synthesis

More information

Quartus Counter Example. Last updated 9/6/18

Quartus Counter Example. Last updated 9/6/18 Quartus Counter Example Last updated 9/6/18 Create a logic design from start to a DE10 implementation This example uses best design practices This example is not about creating HDL The HDL code will be

More information

Hardware Description Language VHDL (1) Introduction

Hardware Description Language VHDL (1) Introduction Hardware Description Language VHDL (1) Introduction Digital Radiation Measurement and Spectroscopy NE/RHP 537 Introduction Hardware description language (HDL) Intended to describe circuits textually, for

More information

VHDL Simulation. Testbench Design

VHDL Simulation. Testbench Design VHDL Simulation Testbench Design The Test Bench Concept Elements of a VHDL/Verilog testbench Unit Under Test (UUT) or Device Under Test (DUT) instantiate one or more UUT s Stimulus of UUT inputs algorithmic

More information

DIGITAL LOGIC WITH VHDL (Fall 2013) Unit 6

DIGITAL LOGIC WITH VHDL (Fall 2013) Unit 6 DIGITAL LOGIC WITH VHDL (Fall 2013) Unit 6 FINITE STATE MACHINES (FSMs) Moore Machines Mealy Machines FINITE STATE MACHINES (FSMs) Classification: Moore Machine: Outputs depend only on the current state

More information

HDL. Hardware Description Languages extensively used for:

HDL. Hardware Description Languages extensively used for: HDL Hardware Description Languages extensively used for: Describing (digital) hardware (formal documentation) Simulating it Verifying it Synthesizing it (first step of modern design flow) 2 main options:

More information

VHDL: RTL Synthesis Basics. 1 of 59

VHDL: RTL Synthesis Basics. 1 of 59 VHDL: RTL Synthesis Basics 1 of 59 Goals To learn the basics of RTL synthesis. To be able to synthesize a digital system, given its VHDL model. To be able to relate VHDL code to its synthesized output.

More information

Chapter 2 Solutions. 2.1 (a) VHDL - VHSIC Hardware Description Language VHSIC - Very High Speed Integrated Circuit

Chapter 2 Solutions. 2.1 (a) VHDL - VHSIC Hardware Description Language VHSIC - Very High Speed Integrated Circuit Chapter 2 Solutions 2.1 (a) VHDL - VHSIC Hardware Description Language VHSIC - Very High Speed Integrated Circuit (b) VHDL has statements that execute concurrently since it must model real hardware in

More information

VHDL. ELEC 418 Advanced Digital Systems Dr. Ron Hayne. Images Courtesy of Cengage Learning

VHDL. ELEC 418 Advanced Digital Systems Dr. Ron Hayne. Images Courtesy of Cengage Learning VHDL ELEC 418 Advanced Digital Systems Dr. Ron Hayne Images Courtesy of Cengage Learning Design Flow 418_02 2 VHDL Modules 418_02 3 VHDL Libraries library IEEE; use IEEE.std_logic_1164.all; std_logic Single-bit

More information

CSE 260 Digital Computers: Organization and Logical Design. Exam 2. Jon Turner 3/28/2012

CSE 260 Digital Computers: Organization and Logical Design. Exam 2. Jon Turner 3/28/2012 CSE 260 Digital Computers: Organization and Logical Design Exam 2 Jon Turner 3/28/2012 1. (15 points). Draw a diagram for a circuit that implements the VHDL module shown below. Your diagram may include

More information

COVER SHEET: Total: Regrade Info: Problem#: Points. 7 (14 points) 6 (7 points) 9 (6 points) 10 (21 points) 11 (4 points)

COVER SHEET: Total: Regrade Info: Problem#: Points. 7 (14 points) 6 (7 points) 9 (6 points) 10 (21 points) 11 (4 points) EEL 4712 Midterm 3 Spring 2013 VERSION 1 Name: UFID: Sign your name here if you would like for your test to be returned in class: IMPORTANT: Please be neat and write (or draw) carefully. If we cannot read

More information

DESCRIPTION OF DIGITAL CIRCUITS USING VHDL

DESCRIPTION OF DIGITAL CIRCUITS USING VHDL DESCRIPTION OF DIGITAL CIRCUITS USING VHDL Combinatinal circuits Sequential circuits Design organization. Generic design Iterative operations Authors: Luis Entrena Arrontes, Celia López, Mario García,

More information

Control and Datapath 8

Control and Datapath 8 Control and Datapath 8 Engineering attempts to develop design methods that break a problem up into separate steps to simplify the design and increase the likelihood of a correct solution. Digital system

More information

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

ECE 448 Lecture 4. Sequential-Circuit Building Blocks. Mixing Description Styles ECE 448 Lecture 4 Sequential-Circuit Building Blocks Mixing Description Styles George Mason University Reading Required P. Chu, FPGA Prototyping by VHDL Examples Chapter 4, Regular Sequential Circuit Recommended

More information

MCPU - A Minimal 8Bit CPU in a 32 Macrocell CPLD.

MCPU - A Minimal 8Bit CPU in a 32 Macrocell CPLD. MCPU - A Minimal 8Bit CPU in a 32 Macrocell CPLD. Tim Böscke, cpldcpu@opencores.org 02/2001 - Revised 10/2004 This documents describes a successful attempt to fit a simple VHDL - CPU into a 32 macrocell

More information

Design Problem 4 Solution

Design Problem 4 Solution CSE 260 Digital Computers: Organization and Logical Design Design Problem 4 Solution Jon Turner Due 4/13/06 1. (125 points). In this problem, you will design a packet FIFO, which is a circuit that temporarily

More information

EL 310 Hardware Description Languages Midterm

EL 310 Hardware Description Languages Midterm EL 3 Hardware Description Languages Midterm 2 3 4 5 Total Name: ID : Notes: ) Please answer the questions in the provided space after each question. 2) Duration is minutes 3) Closed books and closed notes.

More information

Introduction to VHDL #3

Introduction to VHDL #3 ECE 322 Digital Design with VHDL Introduction to VHDL #3 Lecture 7 & 8 VHDL Modeling Styles VHDL Modeling Styles Dataflow Concurrent statements Structural Components and interconnects Behavioral (sequential)

More information

Lecture 12 VHDL Synthesis

Lecture 12 VHDL Synthesis CPE 487: Digital System Design Spring 2018 Lecture 12 VHDL Synthesis Bryan Ackland Department of Electrical and Computer Engineering Stevens Institute of Technology Hoboken, NJ 07030 1 What is Synthesis?

More information

EEL 4712 Name: SOLUTION Midterm 1 Spring 2016 VERSION 1 UFID:

EEL 4712 Name: SOLUTION Midterm 1 Spring 2016 VERSION 1 UFID: EEL 4712 Name: SOLUTION Midterm 1 Spring 2016 VERSION 1 UFID: Sign here to give permission to return your test in class, where other students might see your score: IMPORTANT: Please be neat and write (or

More information

COVER SHEET: Total: Regrade Info: 5 (5 points) 2 (8 points) 6 (10 points) 7b (13 points) 7c (13 points) 7d (13 points)

COVER SHEET: Total: Regrade Info: 5 (5 points) 2 (8 points) 6 (10 points) 7b (13 points) 7c (13 points) 7d (13 points) EEL 4712 Midterm 2 Spring 2011 VERSION 1 Name: UFID: Sign your name here if you would like for your test to be returned in class: IMPORTANT: Please be neat and write (or draw) carefully. If we cannot read

More information

PACKAGE. Package syntax: PACKAGE identifier IS...item declaration... END PACKAGE [identifier]

PACKAGE. Package syntax: PACKAGE identifier IS...item declaration... END PACKAGE [identifier] Modular Design PACKAGE Package is a collection of : - Type declaration - Component declaration - Constants declaration - Subprograms (functions or procedures) Package is a separate VHDL code consisting

More information

The University of Alabama in Huntsville ECE Department CPE Midterm Exam Solution Spring 2016

The University of Alabama in Huntsville ECE Department CPE Midterm Exam Solution Spring 2016 The University of Alabama in Huntsville ECE Department CPE 526 01 Midterm Exam Solution Spring 2016 1. (15 points) Write a VHDL function that accepts a std_logic_vector of arbitrary length and an integer

More information

COVER SHEET: Total: Regrade Info: 1 (8 points) 2 ( 8 points) 3 (16 points) 4 (16 points) 5 (16 points) 6 (16 points) 7 (16 points) 8 (8 points)

COVER SHEET: Total: Regrade Info: 1 (8 points) 2 ( 8 points) 3 (16 points) 4 (16 points) 5 (16 points) 6 (16 points) 7 (16 points) 8 (8 points) EEL 4712 Midterm 1 Spring 2010 VERSION 1 Name: UFID: IMPORTANT: Please be neat and write (or draw) carefully. If we cannot read it with a reasonable effort, it is assumed wrong. As always, the best answer

More information

Laboratory Exercise 8

Laboratory Exercise 8 Laboratory Exercise 8 Memory Blocks In computer systems it is necessary to provide a substantial amount of memory. If a system is implemented using FPGA technology it is possible to provide some amount

More information

Abi Farsoni, Department of Nuclear Engineering and Radiation Health Physics, Oregon State University

Abi Farsoni, Department of Nuclear Engineering and Radiation Health Physics, Oregon State University Hardware description language (HDL) Intended to describe circuits textually, for a computer to read Evolved starting in the 1970s and 1980s Popular languages today include: VHDL Defined in 1980s by U.S.

More information

CSE 591: Advanced Hardware Design and Verification (2012 Spring) LAB #0

CSE 591: Advanced Hardware Design and Verification (2012 Spring) LAB #0 Lab 0: Tutorial on Xilinx Project Navigator & ALDEC s Active-HDL Simulator CSE 591: Advanced Hardware Design and Verification Assigned: 01/05/2011 Due: 01/19/2011 Table of Contents 1 Overview... 2 1.1

More information

Sign here to give permission to return your test in class, where other students might see your score:

Sign here to give permission to return your test in class, where other students might see your score: EEL 4712 Midterm 1 Spring 2017 VERSION 1 Name: UFID: Sign here to give permission to return your test in class, where other students might see your score: IMPORTANT: Please be neat and write (or draw)

More information

COVER SHEET: Total: Regrade Info: 2 (6 points) 3 (8 points) 4 (10 points) 8 (12 points) 6 (6 points) 7 (6 points) 9 (30 points) 10 (4 points)

COVER SHEET: Total: Regrade Info: 2 (6 points) 3 (8 points) 4 (10 points) 8 (12 points) 6 (6 points) 7 (6 points) 9 (30 points) 10 (4 points) EEL 4712 Midterm 2 Spring 2010 VERSION 1 Name: UFID: Sign your name here if you would like for your test to be returned in class: IMPORTANT: Please be neat and write (or draw) carefully. If we cannot read

More information

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

ECE 545 Lecture 6. Behavioral Modeling of Sequential-Circuit Building Blocks. George Mason University ECE 545 Lecture 6 Behavioral Modeling of Sequential-Circuit Building Blocks George Mason University Required reading P. Chu, RTL Hardware Design using VHDL Chapter 5.1, VHDL Process Chapter 8, Sequential

More information

Constructing VHDL Models with CSA

Constructing VHDL Models with CSA Constructing VHDL Models with CSA List all components (e.g., gate) inclusive propagation delays. Identify input/output signals as input/output ports. All remaining signals are internal signals. Identify

More information

A Brief Introduction to Verilog Hardware Definition Language (HDL)

A Brief Introduction to Verilog Hardware Definition Language (HDL) www.realdigital.org A Brief Introduction to Verilog Hardware Definition Language (HDL) Forward Verilog is a Hardware Description language (HDL) that is used to define the structure and/or behavior of digital

More information

The CPU Bus : Structure 0

The CPU Bus : Structure 0 The CPU Bus : Structure 0 The following can be applied to both the internal CPU buses and the external system buses. This distinction becomes blurred when we discuss Systems on a single Chip (SoC). The

More information

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

Counters. Counter Types. Variations. Modulo Gray Code BCD (Decimal) Decade Ring Johnson (twisted ring) LFSR CE 1911 Counters Counter Types Modulo Gray Code BC (ecimal) ecade Ring Johnson (twisted ring) LFSR Variations Asynchronous / Synchronous Up/own Loadable 2 tj Modulo-n (n = a power of 2) Asynchronous Count

More information

VHDL Testbench Design. Textbook chapters 2.19, , 9.5

VHDL Testbench Design. Textbook chapters 2.19, , 9.5 VHDL Testbench Design Textbook chapters 2.19, 4.10-4.12, 9.5 The Test Bench Concept Elements of a VHDL/Verilog testbench Unit Under Test (UUT) or Device Under Test (DUT) instantiate one or more UUT s Stimulus

More information

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

Lecture 7. Standard ICs FPGA (Field Programmable Gate Array) VHDL (Very-high-speed integrated circuits. Hardware Description Language) Standard ICs FPGA (Field Programmable Gate Array) VHDL (Very-high-speed integrated circuits Hardware Description Language) 1 Standard ICs PLD: Programmable Logic Device CPLD: Complex PLD FPGA: Field Programmable

More information

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

Nanosistemų programavimo kalbos 5 paskaita. Sekvencinių schemų projektavimas Nanosistemų programavimo kalbos 5 paskaita Sekvencinių schemų projektavimas Terminai Combinational circuit kombinacinė schema (be atminties elementų) Sequential circuit nuosekli (trigerinė, sekvencinė)

More information

Verilog introduction. Embedded and Ambient Systems Lab

Verilog introduction. Embedded and Ambient Systems Lab Verilog introduction Embedded and Ambient Systems Lab Purpose of HDL languages Modeling hardware behavior Large part of these languages can only be used for simulation, not for hardware generation (synthesis)

More information

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

FSM Components. FSM Description. HDL Coding Methods. Chapter 7: HDL Coding Techniques FSM Components XST features: Specific inference capabilities for synchronous Finite State Machine (FSM) components. Built-in FSM encoding strategies to accommodate your optimization goals. You may also

More information

Verilog. Verilog for Synthesis

Verilog. Verilog for Synthesis Verilog Verilog for Synthesis 1 Verilog background 1983: Gateway Design Automation released Verilog HDL Verilog and simulator 1985: Verilog enhanced version Verilog-XL 1987: Verilog-XL becoming more popular

More information

Assignment 01 Computer Architecture Lab ECSE

Assignment 01 Computer Architecture Lab ECSE Assignment 01 Computer Architecture Lab ECSE 487-001 Date due: September 22, 2006, Trottier Assignment Box by 14:30 1 Introduction The purpose of this assignment is to re-familiarize the student with VHDL

More information

The Virtex FPGA and Introduction to design techniques

The Virtex FPGA and Introduction to design techniques The Virtex FPGA and Introduction to design techniques SM098 Computation Structures Lecture 6 Simple Programmable Logic evices Programmable Array Logic (PAL) AN-OR arrays are common blocks in SPL and CPL

More information

Exp#8: Designing a Programmable Sequence Detector

Exp#8: Designing a Programmable Sequence Detector Exp#8: Designing a Programmable Sequence Detector Objectives Learning how to partition a system into data-path and control unit. Integrating Schematics and Verilog code together Overview In this lab you

More information

EEL 4712 Digital Design Test 2 Spring Semester 2008

EEL 4712 Digital Design Test 2 Spring Semester 2008 IMPORTANT: Please be neat and write (or draw) carefully. If we cannot read it with a reasonable effort, it is assumed wrong. As always, the best answer gets the most points. COVER SHEET: Problem: Points:

More information

CS211 Digital Systems/Lab. Introduction to VHDL. Hyotaek Shim, Computer Architecture Laboratory

CS211 Digital Systems/Lab. Introduction to VHDL. Hyotaek Shim, Computer Architecture Laboratory CS211 Digital Systems/Lab Introduction to VHDL Hyotaek Shim, Computer Architecture Laboratory Programmable Logic Device (PLD) 2/32 An electronic component used to build reconfigurable digital circuits

More information