ELEN 468 Lecture 191 ELEN 468 Advanced Logic Design Lecture 19 VHDL.

Slides:



Advertisements
Similar presentations
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.
Advertisements

History TTL-logic PAL (Programmable Array Logic)
Mridula Allani Fall 2010 (Refer to the comments if required) ELEC Fall 2010, Nov 21(Adopted from Profs. Nelson and Stroud)
Modeling & Simulating ASIC Designs with VHDL Reference: Smith text: Chapters 10 & 12.
VHDL ELEC 418 Advanced Digital Systems Dr. Ron Hayne Images Courtesy of Thomson Engineering.
Introduction to VHDL (Lecture #5) ECE 331 – Digital System Design The slides included herein were taken from the materials accompanying Fundamentals of.
Introduction to VHDL VHDL Tutorial R. E. Haskell and D. M. Hanna T1: Combinational Logic Circuits.
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.
Introduction to VHDL Multiplexers. Introduction to VHDL VHDL is an acronym for VHSIC (Very High Speed Integrated Circuit) Hardware Description Language.
COE 405 Design Methodology Based on VHDL Dr. Aiman H. El-Maleh Computer Engineering Department King Fahd University of Petroleum & Minerals Dr. Aiman H.
Introduction to VHDL CSCE 496/896: Embedded Systems Witawas Srisa-an.
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.
VHDL And Synthesis Review. VHDL In Detail Things that we will look at: –Port and Types –Arithmetic Operators –Design styles for Synthesis.
ECE C03 Lecture 141 Lecture 14 VHDL Modeling of Sequential Machines Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
VHDL. What is VHDL? VHDL: VHSIC Hardware Description Language  VHSIC: Very High Speed Integrated Circuit 7/2/ R.H.Khade.
Introduction to VHDL (part 2)
VHDL Training ©1995 Cypress Semiconductor 1 Introduction  VHDL is used to:  document circuits  simulate circuits  synthesize design descriptions 
1 Part V: VHDL CODING. 2 Design StructureData TypesOperators and AttributesConcurrent DesignSequential DesignSignals and VariablesState Machines A VHDL.
1 Part I: VHDL CODING. 2 Design StructureData TypesOperators and AttributesConcurrent DesignSequential DesignSignals and VariablesState Machines A VHDL.
VHDL TUTORIAL Preetha Thulasiraman ECE 223 Winter 2007.
INTRO TO VLSI DESIGN (CPE 448) (VHDL Tutorial ) Prof: Asuif Mahmood.
VHDL – Dataflow and Structural Modeling and Testbenches ENGIN 341 – Advanced Digital Design University of Massachusetts Boston Department of Engineering.
CprE / ComS 583 Reconfigurable Computing Prof. Joseph Zambreno Department of Electrical and Computer Engineering Iowa State University Lecture #17 – Introduction.
A VHDL Tutorial ENG2410. ENG241/VHDL Tutorial2 Goals Introduce the students to the following: –VHDL as Hardware description language. –How to describe.
Fall 09, Aug 19 ELEC / Lecture 2 (from Prof. Nelson's and Prof. Stroud's course material) 1 ELEC / Computer Architecture.
VHDL Introduction. V- VHSIC Very High Speed Integrated Circuit H- Hardware D- Description L- Language.
1 CAD for VLSI Tutorial #1 VHDL - Very High Speed Integrated Circuit (VHSIC) Hardware Description Language.
4OI5 Engineering Design Introduction to VHDL.
Language Concepts Ver 1.1, Copyright 1997 TS, Inc. VHDL L a n g u a g e C o n c e p t s Page 1.
Fall 2004EE 3563 Digital Systems Design EE 3563 VHDL – Basic Language Elements  Identifiers: –basic identifier: composed of a sequence of one or more.
George Mason University ECE 545 – Introduction to VHDL Variables, Functions, Memory, File I/O ECE 545 Lecture 7.
Introduction to VHDL Spring EENG 2920 Digital Systems Design Introduction VHDL – VHSIC (Very high speed integrated circuit) Hardware Description.
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.
VHDL Very High Speed Integrated Circuit Hardware Description Language Shiraz University of shiraz spring 2011.
Design Methodology Based on VHDL Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
(1) Basic Language Concepts © Sudhakar Yalamanchili, Georgia Institute of Technology, 2006.
VHDL Basics. VHDL BASICS 2 OUTLINE –Component model –Code model –Entity –Architecture –Identifiers and objects –Operations for relations VHDL ET062G &
Introduction to VHDL Simulation … Synthesis …. The digital design process… Initial specification Block diagram Final product Circuit equations Logic design.
Lecture #7 Page 1 Lecture #7 Agenda 1.VHDL Data Types Announcements 1.n/a ECE 4110– Digital Logic Design.
Hardware languages "Programming"-language for modelling of (digital) hardware 1 Two main languages: VHDL (Very High Speed Integrated Circuit Hardware Description.
Chapter 5 Introduction to VHDL. 2 Hardware Description Language A computer language used to design circuits with text-based descriptions of the circuits.
15-Dec-15EE5141 Chapter 4 Sequential Statements ä Variable assignment statement ä Signal assignment statement ä If statement ä Case statement ä Loop statement.
VHDL Discussion Sequential Sytems. Memory Elements. Registers. Counters IAY 0600 Digital Systems Design Alexander Sudnitson Tallinn University of Technology.
1 Part III: VHDL CODING. 2 Design StructureData TypesOperators and AttributesConcurrent DesignSequential DesignSignals and VariablesState Machines A VHDL.
8-Jan-16EE5141 Chapter 6 Subprograms & Packages Subprogram declaration Subprogram body Package declaration Package body Resolution function Subprogram.
04/26/20031 ECE 551: Digital System Design & Synthesis Lecture Set : Introduction to VHDL 12.2: VHDL versus Verilog (Separate File)
ACANEL VHDL 의 이해와 실습 2000 년 1 학기 Computer Architecture (classes links)
CEC 220 Digital Circuit Design VHDL in Sequential Logic Wednesday, March 25 CEC 220 Digital Circuit Design Slide 1 of 13.
BASIC VHDL LANGUAGE ELEMENTS Digital Design for Instrumentation with VHDL 1.
VHDL Discussion Subprograms IAY 0600 Digital Systems Design Alexander Sudnitson Tallinn University of Technology 1.
VHDL Programming Fundamentals Presented By Dr. Pradyut Kumar Biswal Department of Electronics, IIIT Bhubaneswar.
Signals & Data-typesVer 1.1, Copyright 1997, TS, Inc. VHDL S i g n a l s & D a t a T y p e s Page 1.
George Mason University Behavioral Modeling of Sequential-Circuit Building Blocks ECE 545 Lecture 8.
Case Study: Xilinx Synthesis Tool (XST). Arrays & Records 2.
1 Introduction to Engineering Spring 2007 Lecture 18: Digital Tools 2.
1 Introduction to Engineering Spring 2007 Lecture 19: Digital Tools 3.
Combinational logic circuit
Basic Language Concepts
Subject Name: FUNDAMENTALS OF HDL Subject Code: 10EC45
Dataflow Style Combinational Design with VHDL
Part IV: VHDL CODING.
IAS 0600 Digital Systems Design
CHAPTER 10 Introduction to VHDL
VHDL VHSIC Hardware Description Language VHSIC
VHDL Discussion Subprograms
CPE 528: Lecture #5 Department of Electrical and Computer Engineering University of Alabama in Huntsville.
VHDL Discussion Subprograms
ECE 545 Lecture 5 Simple Testbenches.
Sequntial-Circuit Building Blocks
EEL4712 Digital Design (VHDL Tutorial).
Presentation transcript:

ELEN 468 Lecture 191 ELEN 468 Advanced Logic Design Lecture 19 VHDL

ELEN 468 Lecture 192 Introduction VHDL VHSIC Hardware Description Language VHSIC Very High Speed Integrated Circuit

ELEN 468 Lecture 193 Example -- eqcomp4 is a four bit equality comparator -- Entity declaration entity eqcomp4 is port ( a, b: in bit_vector( 3 downto 0 ); equals: out bit ); -- equal is active high end eqcomp4; -- Architecture body architecture dataflow of eqcomp4 is begin equals <= ‘1’ when ( a = b ) else ‘0’; end dataflow; -- eqcomp4 is a four bit equality comparator -- Entity declaration entity eqcomp4 is port ( a, b: in bit_vector( 3 downto 0 ); equals: out bit ); -- equal is active high end eqcomp4; -- Architecture body architecture dataflow of eqcomp4 is begin equals <= ‘1’ when ( a = b ) else ‘0’; end dataflow;

ELEN 468 Lecture 194 Entity Declarations Describe I/O and parameterized values Port declaration Name Mode  in  out  buffer: for internal feedback  inout Data type  Boolean, bit, bit_vector, integer, std_logic …

ELEN 468 Lecture 195 Example of Entity Declaration library ieee; use ieee.std_logic_1164.all; entity add4 is port ( a, b:in std_logic_vector( 3 downto 0 ); ci: in std_logic; sum:out std_logic_vector( 3 downto 0 ); co:out std_logic ); end add4; library ieee; use ieee.std_logic_1164.all; entity add4 is port ( a, b:in std_logic_vector( 3 downto 0 ); ci: in std_logic; sum:out std_logic_vector( 3 downto 0 ); co:out std_logic ); end add4;

ELEN 468 Lecture 196 Architecture Bodies Always associated with an entity declaration Description styles Behavioral Dataflow Structural

ELEN 468 Lecture 197 Behavioral Descriptions library ieee; use ieee.std_logic_1164.all; entity eqcomp4 is port ( a, b:in std_logic_vector( 3 downto 0 ); equals:out std_logic ); end eqcomp4; architecture behavioral of eqcomp4 is begin comp: process ( a, b ) -- sensitivity list begin if a = b then equals <= ‘1’; else equals <= ‘0’; -- sequential assignment endif end process comp; end behavioral;

ELEN 468 Lecture 198 Dataflow Descriptions library ieee; use ieee.std_logic_1164.all; entity eqcomp4 is port ( a, b:in std_logic_vector( 3 downto 0 ); equals:out std_logic ); end eqcomp4; architecture dataflow of eqcomp4 is begin equals <= ‘1’ when ( a = b ) else ‘0’; end dataflow; -- No process -- Concurrent assignment library ieee; use ieee.std_logic_1164.all; entity eqcomp4 is port ( a, b:in std_logic_vector( 3 downto 0 ); equals:out std_logic ); end eqcomp4; architecture dataflow of eqcomp4 is begin equals <= ‘1’ when ( a = b ) else ‘0’; end dataflow; -- No process -- Concurrent assignment

ELEN 468 Lecture 199 Structural Descriptions library ieee; use ieee.std_logic_1164.all; entity eqcomp4 is port ( a, b:in std_logic_vector( 3 downto 0 ); equals: out std_logic ); end eqcomp4; use work.gatespkg.all; architecture struct of eqcomp4 is signal x : std_logic_vector( 0 to 3); begin u0: xnor2 port map ( a(0), b(0), x(0) ); -- component instantiation u1: xnor2 port map ( a(1), b(1), x(1) ); u2: xnor2 port map ( a(2), b(2), x(2) ); u3: xnor2 port map ( a(3), b(3), x(3) ); u4: and4 port map ( x(0), x(1), x(2), x(3), equals ); end struct; library ieee; use ieee.std_logic_1164.all; entity eqcomp4 is port ( a, b:in std_logic_vector( 3 downto 0 ); equals: out std_logic ); end eqcomp4; use work.gatespkg.all; architecture struct of eqcomp4 is signal x : std_logic_vector( 0 to 3); begin u0: xnor2 port map ( a(0), b(0), x(0) ); -- component instantiation u1: xnor2 port map ( a(1), b(1), x(1) ); u2: xnor2 port map ( a(2), b(2), x(2) ); u3: xnor2 port map ( a(3), b(3), x(3) ); u4: and4 port map ( x(0), x(1), x(2), x(3), equals ); end struct;

ELEN 468 Lecture 1910 Identifiers Made up of alphabetic, numeric, and/or underscore The first character must be a letter The last character cannot be an underscore Two underscores in succession are not allowed Uppercase and lowercase are equivalent

ELEN 468 Lecture 1911 Data Objects Constants Signals Similar to “wire” in Verilog Variables Only in processes and subprograms Usually applied as loop or tmp variable Files constant width: integer := 8; signal count: bit_vector( 3 downto 0);

ELEN 468 Lecture 1912 Data Types Scalar types Composite types

ELEN 468 Lecture 1913 Scalar Types Enumeration Integer Floating Physical

ELEN 468 Lecture 1914 Enumeration Types type states is ( idle, waiting, read, write ); signal current_state: states; type bit is ( ‘0’, ‘1’ ); type std_ulogic is ( ‘U’, -- Uninitialized ‘X’, ‘0’, ‘1’, ‘Z’, ‘W’, -- Weak unknown ‘L’, -- Weak 0 ‘H’, -- Weak 1 ‘-’, -- Don’t care ); type states is ( idle, waiting, read, write ); signal current_state: states; type bit is ( ‘0’, ‘1’ ); type std_ulogic is ( ‘U’, -- Uninitialized ‘X’, ‘0’, ‘1’, ‘Z’, ‘W’, -- Weak unknown ‘L’, -- Weak 0 ‘H’, -- Weak 1 ‘-’, -- Don’t care );

ELEN 468 Lecture 1915 Integer and Floating Types VHDL supports Integers from –( ) to ( ) Floating number from –1E38 to 1E38 variable a: integer range –255 to 255;

ELEN 468 Lecture 1916 Physical Types type time is range – to units fs; ps = 1000 fs; ns = 1000 ps; us = 1000 ns; ms = 1000 ns; sec = 1000 ms; min = 60 sec; hr = 60 min; end units; -- time is a predefined type -- physical types are mostly for simulations type time is range – to units fs; ps = 1000 fs; ns = 1000 ps; us = 1000 ns; ms = 1000 ns; sec = 1000 ms; min = 60 sec; hr = 60 min; end units; -- time is a predefined type -- physical types are mostly for simulations

ELEN 468 Lecture 1917 Composite Types Array Record Has multiple elements of different types type bit_vector is array ( natural range <> ) of bit);

ELEN 468 Lecture 1918 Two Dimensional Array type table8x4 is array ( 0 to 7, 0 to 3 ) of bit; constant exclusive_or: table8x4 := ( “000_0”,“001_1”, “010_1”,“011_0”, “100_1”,“101_0”, “110_0”,“111_1” ); type table8x4 is array ( 0 to 7, 0 to 3 ) of bit; constant exclusive_or: table8x4 := ( “000_0”,“001_1”, “010_1”,“011_0”, “100_1”,“101_0”, “110_0”,“111_1” );

ELEN 468 Lecture 1919 Strongly Typed VHDL is a strongly typed language If a and b are integer variables, following assignment is not allowed a <= b + ‘1’; since ‘1’ is a bit, unless ‘+’ is overloaded

ELEN 468 Lecture 1920 Concurrent Statements Lie outside of a process Signal assignment Concurrent Selective (with-select-when) Conditional (when-else) Generate

ELEN 468 Lecture 1921 Concurrent Signal Assignment entity my_design is port ( mem_op, io_op:in bit; read, write:in bit; memr, memw:out bit; io_rd, io_wr:out bit ); end my_design; architecture control of my_design is begin memw <= mem_op and write; memr <= mem_op and read; io_wr <= io_op and write; io_rd <= io_op and read; end control entity my_design is port ( mem_op, io_op:in bit; read, write:in bit; memr, memw:out bit; io_rd, io_wr:out bit ); end my_design; architecture control of my_design is begin memw <= mem_op and write; memr <= mem_op and read; io_wr <= io_op and write; io_rd <= io_op and read; end control

ELEN 468 Lecture 1922 Selective Signal Assignment entity mux is port ( a, b, c, d:in bit_vector( 3 downto 0 ); s:in bit_vector( 1 downto 0 ); x:out bit_vector( 3 downto 0 ) ); end mux; architecture archmux of mux is begin with s select x <= a when “00”, b when “01”, c when “10”, d when others; end archmux; entity mux is port ( a, b, c, d:in bit_vector( 3 downto 0 ); s:in bit_vector( 1 downto 0 ); x:out bit_vector( 3 downto 0 ) ); end mux; architecture archmux of mux is begin with s select x <= a when “00”, b when “01”, c when “10”, d when others; end archmux;

ELEN 468 Lecture 1923 Conditional Signal Assignment entity mux is port ( a, b, c, d:in bit_vector( 3 downto 0 ); s:in bit_vector( 1 downto 0 ); x:out bit_vector( 3 downto 0 ) ); end mux; architecture archmux of mux is begin x <= a when ( s = “00” ) else b when ( s = “01” ) else c when ( s = “10” ) else d; end archmux; entity mux is port ( a, b, c, d:in bit_vector( 3 downto 0 ); s:in bit_vector( 1 downto 0 ); x:out bit_vector( 3 downto 0 ) ); end mux; architecture archmux of mux is begin x <= a when ( s = “00” ) else b when ( s = “01” ) else c when ( s = “10” ) else d; end archmux;

ELEN 468 Lecture 1924 Component Instantiation and Generate Statement architecture RTL of SHIFT is component DFF port ( rst, clk, d: in bit; q: out bit ); end component; signal T: bit_vector( 8 downto 0 ); begin T(8) <= SI; SO <= T(0); g0: for i in 7 downto 0 generate -- variable i is implicitly declared allbit: DFF port map ( rst=>rst, clk=>clk, d=>T(i+1), q=>T(i)); end generate; end RTL; architecture RTL of SHIFT is component DFF port ( rst, clk, d: in bit; q: out bit ); end component; signal T: bit_vector( 8 downto 0 ); begin T(8) <= SI; SO <= T(0); g0: for i in 7 downto 0 generate -- variable i is implicitly declared allbit: DFF port map ( rst=>rst, clk=>clk, d=>T(i+1), q=>T(i)); end generate; end RTL;

ELEN 468 Lecture 1925 Sequential Statements In a process, function or procedure if-then-else when-else

ELEN 468 Lecture 1926 if-then-else … if ( condition1 ) then x <= value1; elsif ( condition2 ) then x <= value2; else x <= value3; end if; … if ( condition1 ) then x <= value1; elsif ( condition2 ) then x <= value2; else x <= value3; end if;

ELEN 468 Lecture 1927 case-when … architecture design of test_case is begin process ( address ) begin case address is when “001” => decode <= X”11”; -- X indicates hexadecimal when “111” => decode <= X”42”; when “010” => decode <= X”44”; when “101” => decode <= X”88”; when others => decode <= X”00”; end case; end process; end design; … architecture design of test_case is begin process ( address ) begin case address is when “001” => decode <= X”11”; -- X indicates hexadecimal when “111” => decode <= X”42”; when “010” => decode <= X”44”; when “101” => decode <= X”88”; when others => decode <= X”00”; end case; end process; end design;

ELEN 468 Lecture 1928 Loop … p0: process ( A ) variable sum, i : integer; begin sum := 0; loop1 : for i in 0 to 9 loop exit loop1 when A(i) > 20; next when A(i) > 10; sum := sum + A(i); end loop loop1 end process … p0: process ( A ) variable sum, i : integer; begin sum := 0; loop1 : for i in 0 to 9 loop exit loop1 when A(i) > 20; next when A(i) > 10; sum := sum + A(i); end loop loop1 end process

ELEN 468 Lecture 1929 D Flip-Flop library ieee; use ieee.std_logic_1164.all; entity dff is port ( d, clk, rst: in std_logic; q:out std_logic ); end dff; architecture behavior of dff is begin process ( clk, rst ) begin if rst = ‘1’ then q <= ‘0’; elsif ( clk’event and clk = ‘1’ ) then q <= d; -- ‘event is an attribute end if; end process; end behavior library ieee; use ieee.std_logic_1164.all; entity dff is port ( d, clk, rst: in std_logic; q:out std_logic ); end dff; architecture behavior of dff is begin process ( clk, rst ) begin if rst = ‘1’ then q <= ‘0’; elsif ( clk’event and clk = ‘1’ ) then q <= d; -- ‘event is an attribute end if; end process; end behavior

ELEN 468 Lecture 1930 wait-until library ieee; use ieee.std_logic_1164.all; entity dff is port ( d, clk, rst: in std_logic; q:out std_logic ); end dff; architecture behavior of dff is begin process ( clk, rst ) begin if rst = ‘1’ then q <= ‘0’; else wait until ( clk = ‘1’ ) q <= d; end if; end process; end behavior library ieee; use ieee.std_logic_1164.all; entity dff is port ( d, clk, rst: in std_logic; q:out std_logic ); end dff; architecture behavior of dff is begin process ( clk, rst ) begin if rst = ‘1’ then q <= ‘0’; else wait until ( clk = ‘1’ ) q <= d; end if; end process; end behavior

ELEN 468 Lecture 1931 Functions function bl2bit ( a: BOOLEAN ) return BIT is begin if a then return ‘1’; else return ‘0’; end if end bl2bit; function bl2bit ( a: BOOLEAN ) return BIT is begin if a then return ‘1’; else return ‘0’; end if end bl2bit;

ELEN 468 Lecture 1932 Using Functions entity full_add is port ( a, b, carry_in: in bit; sum, carry_out: out bit ); end full_add; architecture fall_add of full_add is function majority( a, b, c: bit ) return bit is begin return ( ( a and b ) or ( a and c ) or ( b and c ) ); end majority; begin sum <= a xor b xor carry_in; carry_out <= majority( a, b, carry_in ); end; entity full_add is port ( a, b, carry_in: in bit; sum, carry_out: out bit ); end full_add; architecture fall_add of full_add is function majority( a, b, c: bit ) return bit is begin return ( ( a and b ) or ( a and c ) or ( b and c ) ); end majority; begin sum <= a xor b xor carry_in; carry_out <= majority( a, b, carry_in ); end;

ELEN 468 Lecture 1933 Procedures procedure dff ( signal d: bit_vector; signal clk, rst: bit; signal q: out bit_vector ) is begin if rst = ‘1’ then q ‘0’ ); elsif clk’event and clk = ‘1’ then q <= d; end if; end procedure; procedure dff ( signal d: bit_vector; signal clk, rst: bit; signal q: out bit_vector ) is begin if rst = ‘1’ then q ‘0’ ); elsif clk’event and clk = ‘1’ then q <= d; end if; end procedure;

ELEN 468 Lecture 1934 Packages Similar to library A design unit whose type, component, function and other declarations can be visible to outside Consists of Package declaration Package body (optional) Made visible through “use” use library_name.package_name.item; use work.std_arith.all; Some vendors provide a default work library

ELEN 468 Lecture 1935 Declare Types in Package package STANDARD is type BOOLEAN is ( FALSE, TRUE ); type BIT is ( ‘0’, ‘1’ ); type INTEGER is range to ; … end STANDARD; package STANDARD is type BOOLEAN is ( FALSE, TRUE ); type BIT is ( ‘0’, ‘1’ ); type INTEGER is range to ; … end STANDARD;

ELEN 468 Lecture 1936 Define Procedure in Package package myflop is procedure dff ( signal d: bit_vector; signal clk, rst: bit; signal q: out bit_vector ); end myflop; package body myflop is procedure dff ( signal d: bit_vector; signal clk, rst: bit; signal q: out bit_vector ) is begin if rst = ‘1’ then q ‘0’ ); elsif clk’event and clk = ‘1’ then q <= d; end if; end procedure; end myflop; package myflop is procedure dff ( signal d: bit_vector; signal clk, rst: bit; signal q: out bit_vector ); end myflop; package body myflop is procedure dff ( signal d: bit_vector; signal clk, rst: bit; signal q: out bit_vector ) is begin if rst = ‘1’ then q ‘0’ ); elsif clk’event and clk = ‘1’ then q <= d; end if; end procedure; end myflop;

ELEN 468 Lecture 1937 Using Procedure entity flop8 is port ( clk, rst: in bit; data_in: in bit_vector( 7 downto 0 ); data:out bit_vector( 7 downto 0 ) ); end flop8; use work.myflop.all; architecture archflop8 of flop8 is begin dff( data_in, clk, rst, data ); end archflop8; entity flop8 is port ( clk, rst: in bit; data_in: in bit_vector( 7 downto 0 ); data:out bit_vector( 7 downto 0 ) ); end flop8; use work.myflop.all; architecture archflop8 of flop8 is begin dff( data_in, clk, rst, data ); end archflop8;

ELEN 468 Lecture 1938 Generics entity dff is generic ( size: integer := 2 ) port ( clk, rst: in bit; d:in bit_vector( size-1 downto 0 ); q:out bit_vector( size-1 downto 0 ) ); end dff; architecture behavior of dff is … end behavior … u1: dff generic map(8) port map( myclk, myrst, data, output ); … entity dff is generic ( size: integer := 2 ) port ( clk, rst: in bit; d:in bit_vector( size-1 downto 0 ); q:out bit_vector( size-1 downto 0 ) ); end dff; architecture behavior of dff is … end behavior … u1: dff generic map(8) port map( myclk, myrst, data, output ); …