最新VHDL双语教学第3章(共91张PPT课件).pptx
《最新VHDL双语教学第3章(共91张PPT课件).pptx》由会员分享,可在线阅读,更多相关《最新VHDL双语教学第3章(共91张PPT课件).pptx(91页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、VHDLSynthesis & Simulation(Basic Language Items)第一页,共九十一页。AgendanEntitynArchitecturenLibrary & UsenPackagenConfiguration第二页,共九十一页。Basic Language Frameworklibrary ieee;use ieee.std_logic_1164.all;-entity XYZ is port ( A, B, C : in std_logic; - Comments F : out std_logic );end XYZ;-architecture XYZ_ar
2、ch of XYZ isbegin F = (A and B) or (B and C) or (C and A); end XYZ_arch; 第三页,共九十一页。AgendanOverviewnPortnGenericnArchitecturenLibrary & UsenPackagenConfiguration第四页,共九十一页。Entitylibrary ieee;use ieee.std_logic_1164.all;- XYZ port ( A, B, C : in std_logic; F : out std_logic ); XYZ;-architecture XYZ_arc
3、h of XYZ isbegin F = (A and B) or (B and C) or (C and A);end XYZ_arch; 第五页,共九十一页。Entity Definition entity_name entity_name Generics; Ports; Other Declarative Parts; Statements; entity entity_nameentity_name ; 第六页,共九十一页。Entity Examples (ROM) ROM port ( D0 : out bit; D1 : out bit; D2 : out bit; D3 : o
4、ut bit; D4, D5, D6, D7 : out bit; A : in bit_vector(7 down to 0) ); ROM;ROMA0A1A2A3A4A5A6A7D0D1D2D3D4D5D6D7第七页,共九十一页。Entity Examples (Adder) Full_Adder port (X, Y, Cin: in Bit; Cout, Sum: out Bit) ;Full_AdderXYCinSumCout第八页,共九十一页。Entity Examples (n-input AND) ANDN generic (wid : integer := 2); port
5、( X : in bit_vector(wid-1 downto 0); F : out bit ); X(0) X(1) X(2) X(wid-1) F 第九页,共九十一页。Entity Example (Empty Entity) Test_Bench Test_BenchTest_BenchSignal GeneratorTest Target第十页,共九十一页。AgendanOverviewnKeywordsnGenericnArchitecturenLibrary & UsenPackagenConfiguration第十一页,共九十一页。Entity Definition (Por
6、ts) entity_name entity_name Generics; Other Declarative Parts; Statements; entity entity_nameentity_name ; 第十二页,共九十一页。Port Example (ANDN)entity ANDN is generic (wid : integer := 2); ( X : in bit_vector(wid-1 downto 0); F : out bit );end; X(0) X(1) X(2) X(wid-1) F 第十三页,共九十一页。Port Examples (ROM)entity
7、 ROM is ( D0 : out bit; D1 : out bit; D2 : out bit; D3 : out bit; D4, D5, D6, D7 : out bit; A : in bit_vector(7 down to 0) );end ROM;ROMA0A1A2A3A4A5A6A7D0D1D2D3D4D5D6D7第十四页,共九十一页。Port Examples (Adder) Full_Adder (X, Y, Cin: in Bit; Cout, Sum: out Bit) ;end entity Full_Adder ;XYCinSumCout第十五页,共九十一页。P
8、ort Examples (n-input AND)entity ANDN is generic (wid : integer := 2); ( X : in bit_vector(wid-1 downto 0); F : out bit );end; X(0) X(1) X(2) X(wid-1) F 第十六页,共九十一页。Port Definition Port_Name, Port_Name : Dir Type:=Default_ValPort_Name, Port_Name : Dir Type:=Default_Val .Port_Name, Port_Name : Dir Typ
9、e:=Default_Val第十七页,共九十一页。Each Parts of Port A0, A1 : in std_logic; A2 : in std_logic := 1; F0 : buffer std_logic; F1 : out std_logic; F2 : inout std_logic Port Name Dir Type Default Value第十八页,共九十一页。Type of “Dir”nInnOutnInoutnBuffernLinkage第十九页,共九十一页。Signal Direction D Q D Q A0 (IN) A1 (IN) A2 (IN) F
10、0 (BUFFER) F1 (OUT) F2 (INOUT) Other ICOther IC第二十页,共九十一页。Dir Example D Q D Q A0 (IN) A1 (IN) A2 (IN) F0 (BUFFER) F1 (OUT) F2 (INOUT) A0, A1 : in std_logic A2 : in std_logic := 1 F0 : buffer std_logic F1 : out std_logic F2 : inout std_logic第二十一页,共九十一页。Use of Dirlibrary ieee;use ieee.std_logic_1164.a
11、ll;-entity ABC is port ( : std_logic; : std_logic; : std_logic; : std_logic );end ABC;-architecture ABC_arch of ABC isbegin process() begin if rising_edge() then = not ; = ; end if; end process; = when = 1 ELSE Z;end ABC_arch; 第二十二页,共九十一页。Type A0, A1 : in std_logic; A2 : in std_logic := 1; F0 : buff
12、er std_logic; F1 : out std_logic; F2 : inout std_logic Port Name Dir Type Default Value第二十三页,共九十一页。Typical Port TypenBitnBit_vectornStd_logicnStd_logic_vector第二十四页,共九十一页。Bitn1n0第二十五页,共九十一页。Bit_vectorport( X : in bit_vector(3 downto 0); F : out bit );X0X1X2X3FPort ( X0 : in bit; X1 : in bit; X2 : in
13、bit; X3 : in bit; F : out bit );Port ( X0, X1, X2, X3 : in bit; F : out bit );第二十六页,共九十一页。Std_logicnU, - UninitializednX, - Forcing Unknownn0, - Forcing 0n1, - Forcing 1nZ, - High Impedance nW, - Weak UnknownnL, - Weak 0 nH, - Weak 1 n- - Dont care第二十七页,共九十一页。Resolution Function Of Std_logicU X 01 Z
14、 W L H -U U U U U U U U U UX U X X X X X X X X0 U X 0 X 0000 X1 U X X 11111 XZ U X 01 Z W L H XW U X 01 W W W W XL U X 01 L W L W XH U X 01 H W W H X-U X X X X X X X X第二十八页,共九十一页。Std_logic_vectorport( X : in std_logic_vector(3 downto 0); F : out std_logic );X0X1X2X3F第二十九页,共九十一页。AgendanOverviewnKeywo
15、rdsnPortnArchitecturenLibrary & UsenPackagenConfiguration第三十页,共九十一页。Entity Definition (Generics) entity_name entity_name Ports; Other Declarative Parts; Statements; entity entity_nameentity_name ; 第三十一页,共九十一页。An AND Gate With Unknown Inputsentity ANDN is ( : integer := 2); port ( X : in bit_vector(-
16、1 downto 0); F : out bit );end ANDN; X(0) X(1) X(2) X(wid-1) F 第三十二页,共九十一页。Generic Definition ( Name , Name : DataType := DefaultValue Name , Name : DataType := DefaultValue Name , Name : DataType := DefaultValue);第三十三页,共九十一页。Generic Example (1)entity abcd is ( p_a : integer : = 2; p_b : integer : =
17、 7 ); port ( A : out bit_vector(0 to p_a - 1); F : in bit );end;第三十四页,共九十一页。Use of the Generic (ANDN.vhd)library ieee;use ieee.std_logic_1164.all;- is ( : integer := 2); port ( X : in bit_vector(-1 downto 0); F : out bit ); ;-architecture ANDN_arch of isbegin process(X) variable tmp : bit; begin tmp
18、 := 1; for i in -1 downto 0 loop tmp := tmp and X(i); end loop; F = tmp; end process;end ANDN_arch; X(0) X(1) X(2) X(wid-1) F 第三十五页,共九十一页。Use of the Generic (My_package.vhd)library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_unsigned.all;-package my_package is is
19、 generic (wid : integer := 2); port ( X : in bit_vector(wid-1 downto 0); F : out bit ); component; end my_package; 第三十六页,共九十一页。library ieee;use ieee.std_logic_1164.all;library work;use work.my_package.all;-entity SEE is port ( A : in bit_vector(3 downto 0); B : in bit_vector(1 downto 0); F1, F2 : ou
20、t bit );end SEE;-architecture SEE_arch of SEE isbegin U1: port map (A, F1); U2: port map (B, F2);end SEE_arch; Use of the Generic (see.vhd)U1A(0)A(1)A(2)A(3)F1U2B(1)B(3)F2第三十七页,共九十一页。AgendanOverviewnEntitynBlocknProcessnSubprogramnFunctionnProcedurenLibrary & UsenPackagenConfiguration第三十八页,共九十一页。Arc
21、hitecturelibrary ieee;use ieee.std_logic_1164.all;-entity XYZ is port ( A, B, C : in std_logic; F : out std_logic );end XYZ;- XYZ_arch XYZ F = (A and B) or (B and C) or (C and A); XYZ_arch; 第三十九页,共九十一页。Architecture Definition arch_name entity_name architecture_declarative_part architecture_statement
22、_part architecture arch_name ;第四十页,共九十一页。Architecture Example (ABC.vhd)library ieee;use ieee.std_logic_1164.all;-entity ABC is port( A0,A1,A2 : in std_logic; F0 : buffer std_logic; F1 : out std_logic; F2 : inout std_logic );end ABC;- ABC_arch ABC process(A0) begin if rising_edge(A0) then F0 = not F0
23、; F1 = F2; end if; end process; F2 = A1 when A2 = 1 ELSE Z; ABC_arch; 第四十一页,共九十一页。Architecture Example (ANDN.vhd)library ieee;use ieee.std_logic_1164.all;-entity ANDN is generic (wid : integer := 2); port( X : in bit_vector(wid-1 downto 0); F : out bit );end ANDN;- ANDN process(X) variable tmp : bit
24、; begin tmp := 1; for i in wid-1 downto 0 loop tmp := tmp and X(i); end loop; F = tmp; end process; ; X(0) X(1) X(2) X(wid-1) F 第四十二页,共九十一页。Use of the Generic (see.vhd)library ieee;use ieee.std_logic_1164.all;library work;use work.my_package.all;-entity SEE is port ( A : in bit_vector(3 downto 0); B
25、 : in bit_vector(1 downto 0); F1, F2 : out bit );end SEE;- SEE_arch SEE U1: ANDN generic map(4) port map (A, F1); U2: ANDN port map (B, F2); SEE_arch; U1A(0)A(1)A(2)A(3)F1U2B(1)B(3)F2第四十三页,共九十一页。AgendanOverviewnEntitynKeywordsnProcessnSubprogramnFunctionnProcedurenLibrary & UsenPackage nConfiguratio
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 最新 VHDL 双语 教学 91 PPT 课件
限制150内