Digital Design – Hardware Description Languages Chapter 9 - Hardware Description Languages.

Slides:



Advertisements
Similar presentations
VHDL Lecture 1 Megan Peck EECS 443 Spring 08.
Advertisements

OBJECTIVES Learn the history of HDL Development. Learn how the HDL module is structured. Learn the use of operators in HDL module. Learn the different.
Digital Logic with VHDL EE 230 Digital Systems Fall 2006 (10/17/2006)
1 Lecture 13 VHDL 3/16/09. 2 VHDL VHDL is a hardware description language. The behavior of a digital system can be described (specified) by writing a.
L18 – VHDL for other counters and controllers. Other counters  More examples Gray Code counter Controlled counters  Up down counter  Ref: text Unit.
1 VLSI DESIGN USING VHDL Part II A workshop by Dr. Junaid Ahmed Zubairi.
Top-level VHDL Designs
2-to-1 Multiplexer: if Statement Discussion D2.1 Example 4.
Sequential-Circuit Building Blocks
Hardware Description Languages Drawing of circuit schematics is not practical for circuits containing more than few tens of gates. We need a way to just.
Register-Transfer Level (RTL) Design
Chapter 9: Hardware Description Languages
1 Register-Transfer Level (RTL) Design Recall –Chapter 2: Combinational Logic Design First step: Capture behavior (using equation or truth table) Remaining.
FPGAs and VHDL Lecture L12.1. FPGAs and VHDL Field Programmable Gate Arrays (FPGAs) VHDL –2 x 1 MUX –4 x 1 MUX –An Adder –Binary-to-BCD Converter –A Register.
Counters Discussion D5.3 Example 33. Counters 3-Bit, Divide-by-8 Counter 3-Bit Behavioral Counter in Verilog Modulo-5 Counter An N-Bit Counter.
Dr. Turki F. Al-Somani VHDL synthesis and simulation – Part 3 Microcomputer Systems Design (Embedded Systems)
ELEN 468 Lecture 191 ELEN 468 Advanced Logic Design Lecture 19 VHDL.
Kazi Fall 2006 EEGN 4941 EEGN-494 HDL Design Principles for VLSI/FPGAs Khurram Kazi Some of the slides were taken from K Gaj’s lecture slides from GMU’s.
Finite State Machines Discussion D8.1 Example 36.
ECE 331 – Digital System Design Single-bit Adder Circuits and Adder Circuits in VHDL (Lecture #12) The slides included herein were taken from the materials.
Chapter 9: Hardware Description Languages
Jai Henwood Introduction to VHDL ECE /24/03 Dr. Veton Këpuska.
UART ELEC 418 Advanced Digital Systems Dr. Ron Hayne Images Courtesy of Thomson Engineering.
VHDL TUTORIAL Preetha Thulasiraman ECE 223 Winter 2007.
CprE / ComS 583 Reconfigurable Computing Prof. Joseph Zambreno Department of Electrical and Computer Engineering Iowa State University Lecture #17 – Introduction.
ENG6090 RCS1 ENG6090 Reconfigurable Computing Systems Hardware Description Languages Part 5: Modeling Structure.
VHDL in 1h Martin Schöberl. AK: JVMHWVHDL2 VHDL /= C, Java,… Think in hardware All constructs run concurrent Different from software programming Forget.
ENG241 Digital Design Week #8 Registers and Counters.
CWRU EECS 317 EECS 317 Computer Design LECTURE 1: The VHDL Adder Instructor: Francis G. Wolff Case Western Reserve University.
Copyright(c) 1996 W. B. Ligon III1 Getting Started with VHDL VHDL code is composed of a number of entities Entities describe the interface of the component.
Introduction to VHDL Simulation … Synthesis …. The digital design process… Initial specification Block diagram Final product Circuit equations Logic design.
Hardware Description Languages Digital Logic Design Instructor: Kasım Sinan YILDIRIM.
1 Introduction to VHDL Part 2 Fall We will use Std_logic And, Or have same precedence See slide 8 of part 1.
VHDL for Finite State Machines. Sorry – no standard way One way –Use TYPE and SIGNAL ARCHITECTURE Behavior OF two_ones_fsm IS TYPE State_type IS ( A,
Digital System Projects
04/26/20031 ECE 551: Digital System Design & Synthesis Lecture Set : Introduction to VHDL 12.2: VHDL versus Verilog (Separate File)
CEC 220 Digital Circuit Design VHDL in Sequential Logic Wednesday, March 25 CEC 220 Digital Circuit Design Slide 1 of 13.
Controllers ENGIN 341 – Advanced Digital Design University of Massachusetts Boston Department of Engineering Dr. Filip Cuckov.
ENG241 Digital Design Week #7 Sequential Circuits (Part B)
VHDL ELEC 311 Digital Logic and Circuits Dr. Ron Hayne Images Courtesy of Cengage Learning.
Digital Design 2e Copyright © 2010 Frank Vahid 1 RTL Design Process: Create a datapath Sub-steps –HLSM data inputs/outputs  Datapath inputs/outputs. –HLSM.
George Mason University Behavioral Modeling of Sequential-Circuit Building Blocks ECE 545 Lecture 8.
Algorithmic State Machine (ASM) Charts: VHDL Code & Timing Diagrams
LAB #6 Sequential Logic Design (Flip Flops, Shift Registers)
Week #7 Sequential Circuits (Part B)
Describing Combinational Logic Using Processes
Registers and Counters
Figure 7.1 Control of an alarm system
Introduction Introduction to VHDL Entities Signals Data & Scalar Types
Hardware Description Languages
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
Sequential-Circuit Building Blocks
Algorithmic State Machine (ASM) Charts: VHDL Code & Timing Diagrams
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
Verilog for Digital Design
ELEC 5200/6200 Computer Architecture and Design Review of VHDL
VHDL (VHSIC Hardware Description Language)
Hardware Descriptive Languages these notes are taken from Mano’s book
HDL Hardware Description Language
A Greatest Common Divisor (GCD) Processor
CPE 528: Lecture #5 Department of Electrical and Computer Engineering University of Alabama in Huntsville.
Behavioral Modeling of Sequential-Circuit Building Blocks
Sequntial-Circuit Building Blocks
Figure 8.1. The general form of a sequential circuit.
ECE 448 Lecture 6 Finite State Machines State Diagrams vs. Algorithmic State Machine (ASM) Charts.
CprE / ComS 583 Reconfigurable Computing
Sequntial-Circuit Building Blocks
디 지 털 시 스 템 설 계 UP2 Kit를 이용한 카운터 설계
Digital Logic with VHDL
(Sequential-Circuit Building Blocks)
Presentation transcript:

Digital Design – Hardware Description Languages Chapter 9 - Hardware Description Languages

2 Digital Design Hardware Description Languages Figure 9.1 Drawn circuit.

3 Digital Design Hardware Description Languages Figure 9.2 Schematics become hard to read beyond a dozen or so components -- the graphical information becomes a nuisance rather than an aid.

4 Digital Design Hardware Description Languages Figure 9.3 Describing a circuit using a textual language rather than a graphical drawing: (a) schematic, (b) textual description in the English language.

5 Digital Design Hardware Description Languages (VHDL) Figure 9.4 Describing a circuit using a textual language rather than a graphical drawing: (a) schematic, (b) textual description in the English language, (c) textual description in the VHDL language. Bolded words are reserved words in VHDL.

6 Digital Design Hardware Description Languages (VHDL) Figure 9.7 Behavioral description of an OR gate.

7 Digital Design Hardware Description Languages (VHDL) Figure 9.8 Behavioral description off DoorOpener design.

8 Digital Design Hardware Description Languages (VHDL) Figure 9.9 Behavioral description of DoorOpener testbench. library ieee; use ieee.std_logic_1164.all; entity Testbenchis end Testbench; architecture behaviorof Testbenchis component DoorOpener port ( c, h, p:in std_logic; f:out std_logic ); end component; signal c, h, p, f: std_logic; begin DoorOpener1: DoorOpenerport map(c,h,p,f); process begin -- case 0 c <= ’0’; h <= ’0’; p <= ’0’; wait for 1ns; assert (f=’0’)report “Case 0 failed”; -- case 1 c <= ’0’; h <= ’0’; p <= ’1’; wait for 1ns; assert (f=’1’)report “Case 1 failed”; -- (cases 2-6 omitted from figure) -- case 7 c <= ’1’; h <= ’1’; p <= ’1’; wait for 1ns; assert (f=’0’)report “Case 7 failed”; wait; -- process does not wake up again end process; end behavior;

9 Digital Design Hardware Description Languages (VHDL) Figure 9.10 Behavioral description of a 4-bit register.

10 Digital Design Hardware Description Languages (VHDL) Figure 9.11 Oscillator description.

11 Digital Design Hardware Description Languages (VHDL) Figure 9.12 Behavioral description of LaserTimer controller. library ieee; use ieee.std_logic_1164.all; entity LaserTimeris port ( b:instd_logic; x:out std_logic; clk, rst:in std_logic ); end LaserTimer; architecture behaviorof LaserTimeris typestatetype is (S_Off, S_On1, S_On2, S_On3); signal currentstate, nextstate: statetype; begin statereg:process(clk, rst) begin if (rst=’1’)then currentstate <= S_Off; -- initial state elsif (clk=’1’and clk’event)then currentstate <= nextstate; end if; end process; comblogic:process (currentstate, b) begin case currentstateis when S_Off => x <= ’0’; -- laser off if (b=’0’)then nextstate <= S_Off; elsif (b=’1’)then nextstate <= S_On1; end if; when S_On1 => x <= ’1’; -- laser on nextstate <= S_On2; when S_On2 => x <= ’1’; -- laser still on nextstate <= S_On3; when S_On3 => x <= ’1’; -- laser still on nextstate <= S_Off; end case; end process; end behavior;

12 Digital Design Hardware Description Languages (VHDL) Figure 9.13 Behavioral description of a full-adder.

13 Digital Design Hardware Description Languages (VHDL) Figure 9.14 Structural description of a 4-bit carry-ripple adder.

14 Digital Design Hardware Description Languages (VHDL) Figure 9.15 Structural description of 4-bit up-counter. library ieee; use ieee.std_logic_1164.all; entity UpCounteris port ( clk:instd_logic; cnt:instd_logic; C:outstd_logic_vector(3downto 0); tc:out std_logic ); end UpCounter; architecture structureof UpCounteris component Reg4 port ( I:instd_logic_vector(3downto 0); Q:outstd_logic_vector(3downto 0); clk, ld:instd_logic ); end component; component Inc4 port ( a:instd_logic_vector(3downto 0); s:outstd_logic_vector(3downto 0); ); end component; component AND4 port ( w,x,y,z:instd_logic; F:outstd_logic ); end component; signal tempC: std_logic_vector(3downto 0); signal incC: std_logic_vector(3downto 0); begin Reg4_1: Reg4port map(incC, tempC, clk, cnt); Inc4_1: Inc4port map(tempC, incC); AND4_1: AND4port map(tempC(3), tempC(2) tempC(1), tempC(0), tc); outputC:process(tempC) begin C <= tempC; end process; end structure;

15 Digital Design Hardware Description Languages (VHDL) Figure 9.16 Structural description of top-level VHDL description of laser-based distance measurer. library ieee; use ieee.std_logic_1164.all; entity LaserDistMeasureris port ( clk, rst:in std_logic; B, S:in std_logic; L:out std_logic; D:out std_logic_vector(15downto 0) ); end LaserDistMeasurer; architecture structureof LaserDistMeasureris component LDM_Controller port ( clk, rst:in std_logic; B, S:in std_logic; L:out std_logic; Dreg_clr, Dreg_ld:out std_logic; Dctr_clr, Dctr_cnt:out std_logic ); end component; component LDM_Datapath port ( clk:in std_logic; Dreg_clr, Dreg_ld:in std_logic; Dctr_clr, Dctr_cnt:in std_logic; D:out std_logic_vector(15downto 0) ); end component; signal Dreg_clr, Dreg_ld: std_logic; signalDctr_clr, Dctr_cnt: std_logic; begin LDM_Controller_1: LDM_Controller port map (clk, rst, B, S, L, Dreg_clr, Dreg_ld, Dctr_clr, Dctr_cnt); LDM_Datapath_1: LDM_Datapath port map(clk, Dreg_clr, Dreg_ld, Dctr_clr, Dctr_cnt, D); end structure;

16 Digital Design Hardware Description Languages (VHDL) Figure 9.17 Structural description of the laser-based distance measurer’s datapath.

17 Digital Design Hardware Description Languages (VHDL) Figure 9.18/9.19 Behavioral description of laser-based distance measurer’s controller. library ieee; use ieee.std_logic_1164.all; entity LDM_Controlleris port ( clk, rst:in std_logic; B, S:in std_logic; L:out std_logic; Dreg_clr, Dreg_ld:out std_logic; Dctr_clr, Dctr_cnt:out std_logic ); end LDM_Controller; architecture behaviorof LDM_Controlleris type statetypeis (S0, S1, S2, S3, S4, S5); signal currentstate, nextstate: statetype; begin statereg:process(clk, rst) begin if(rst=’1’)then currentstate <= S0; -- initial state elsif (clk=’1’and clk’event)then currentstate <= nextstate; end if; end process; comblogic: process (currentstate, B, S) begin L <= ’0’; Dreg_clr <= ’0’; Dreg_ld <= ’0’; Dctr_clr <= ’0’; case currentstateis whenS0 => L <= ’0’; -- turn off laser Dreg_clr <= ’1’; -- clear Dreg nextstate <= S1; when S1 => Dctr_clr <= ’1’; -- clear timer if(B=’1’)then nextstate <= S2; else nextstate <= S1; end if; when S2 => L <= ’1’; -- turn on laser Dctr_cnt <= ’1’; -- enable timer nextstate <= S3; when S3 => L <= ’0’; -- turn off laser if (S=’1’)then nextstate <= S4; else nextstate <= S3; end if; when S4 => Dctr_cnt <= ’0’; -- disable timer nextstate <= S5; when S5 => Dreg_ld <= ’1’; -- load Dreg nextstate <= S1; end case; end process; end behavior;

18 Digital Design Hardware Description Languages (Verilog) Figure 9.5 Describing a circuit using a textual language rather than a graphical drawing: (a) schematic, (b) textual description in the English language, (c) textual description in the Verilog language. Bolded words are reserved words in Verilog.

19 Digital Design Hardware Description Languages (SystemC) Figure 9.6 Describing a circuit using a textual language rather than a graphical drawing: (a) schematic, (b) textual description in the English language, (c) textual description in the SystemC language. Bolded words are reserved words in SystemC.