结构体一一行为描述 Architecture behavioral of egcomp4 is begin comp process(a, b) begin if a=b then equal else equal<=0 end if 高层次的功能描述, end process comp 不必考虑在电路中到 end behavioral 底是怎样实现的
结构体--行为描述 Architecture behavioral of eqcomp4 is begin comp: process (a,b) begin if a=b then equal <= ‘1’; else equal <=‘0’; end if; end process comp; end behavioral ; 高层次的功能描述, 不必考虑在电路中到 底是怎样实现的
结构体一一数据流描述 描述输入信号经过怎样的变换得到输出信号 Architecture dataflow of egcomp4 is begin equal <=1, when a=b else 0 end dataflow 1 Architecture dataflow of egcomp4 is 当a和b的宽度发生变化 begin 时,需要修改设计 equal not(a(0)xor b(o)) 宽度过大时,设计非常 繁琐 and not(a(1)or b(1) and not(a(2)or b(2)) and not(a3)or b3)) end dataflow
结构体--数据流描述 描述输入信号经过怎样的变换得到输出信号 Architecture dataflow1 of eqcomp4 is begin equal <= ‘1’ when a=b else ‘0’; end dataflow1; Architecture dataflow2 of eqcomp4 is begin equal <= not(a(0) xor b(0)) and not(a(1) xor b(1)) and not(a(2) xor b(2)) and not(a(3) xor b(3)); end dataflow2; 当a和b的宽度发生变化 时,需要修改设计,当 宽度过大时,设计非常 繁琐
结构体一一结构化描述 architecture struct of eqcomp4 is begin U0: xnor2 port map(a(o),b(O),x(O) Ul: xnor 2 port map(a(1),b(1),x(D)) U2: ]nor 2 port map(a(2),b(2), x(2)) U3: ]nor 2 port map(a(),b(3),x 3)) U4: and4 port map(x(o),x (1), x(2), x 3),equal) end struct a6 XNOR 类似于电路的网络表,将各 个器件通过语言的形式进行1 NDI 连接,与电路有一一对应的 b1 1 白xoR X e:)。口1 关系 3 b2 般用于大规模电路的层次 3 % NOR 化设计时。 b 3
结构体--结构化描述 architecture struct of eqcomp4 is begin U0:xnor2 port map(a(0),b(0),x(0)); 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),equal); end struct; 类似于电路的网络表,将各 个器件通过语言的形式进行 连接,与电路有一一对应的 关系。 一般用于大规模电路的层次 化设计时
三种描述方式的比较 描述方式优点 缺点 适用场合 结构化描连接关系清电路不易理解、电路层次化设 述 晰,电路模繁琐、复杂 计 块化清晰 数据流描|布尔函数定不易描述复杂电小门数设计 述 义明白 路,修改不易 行为描述电路特性清进行综合效率相大型复杂的电 楚明了 对较低 路模块设讠
三种描述方式的比较 描述方式 优点 缺点 适用场合 结构化描 述 连接关系清 晰,电路模 块化清晰 电路不易理解、 繁琐、复杂 电路层次化设 计 数据流描 述 布尔函数定 义明白 不易描述复杂电 路,修改不易 小门数设计 行为描述 电路特性清 楚明了 进行综合效率相 对较低 大型复杂的电 路模块设计
VHDL标识符( Identifiers ●基本标识符由字母、数字和下划线组成 第一个字符必须是字母 ●最后一个字符不能是下划线 不允许连续2个下划线 ●保留字(关键字)不能用于标识符 ●大小写是等效的
VHDL标识符(Identifiers) ⚫ 基本标识符由字母、数字和下划线组成 ⚫ 第一个字符必须是字母 ⚫ 最后一个字符不能是下划线 ⚫ 不允许连续2个下划线 ⚫ 保留字(关键字)不能用于标识符 ⚫ 大小写是等效的