正在加载图片...
generic(参量名:参量类型;…); 经过定义后,在程序中,该参量名可作为常量使用 在元件语句中赋值 元件编号:元件名 generic map(参量名→>常量值) port map(信号…); 赋值后,参量名由具体常量值所替代 例p285表447,p.286表448 任意宽度总线反相器 generic语句的应用 带有 generIc语句的实体 generic(width: positive =4 ); y: out std logic vector( width-I downto 0)); end busing architecture s of busing component kin port(a: in std logic, y: out std logic) end component gl: for b in width-l downto 0 generate ((b), y(b)); end generate 16位总线反相器的结构设计 library ieeegeneric (参量名:参量类型;….); port ….. 经过定义后,在程序中,该参量名可作为常量使用; 在元件语句中赋值: 元件编号:元件名 generic map(参量名=>常量值) port map(信号…); 赋值后,参量名由具体常量值所替代。 例 p.285 表 4-47,p.286 表 4-48 任意宽度总线反相器 generic 语句的应用 带有 generic 语句的实体 library ieee; use ieee.std_logic_1164.all; entity businv is generic (width:positive:=4); port (x: in std_logic_vector (width-1 downto 0); y:out std_logic_vector (width-1 downto 0) ); end businv; architecture s of businv is component kinv port (a: in std_logic; y: out std_logic); end component; begin g1: for b in width-1 downto 0 generate u1: kinv port map (x(b),y(b)); end generate; end s; 16 位总线反相器的结构设计 library ieee;
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有