1.VHDL语言
库IEEE; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; 实体CNT4isport (clk : instd _ logic; q : buffer STD _ logic _ vector (3down to0); end cnt4; architecturebehaveofcnt4isbeginprocess (clk ) begini fclk ' eventandclk='1' thenifq=15 thenq=' 0000 '; else q=q 1; end if; end if; 结束进程; end behave; 2 .注意
2.1 .使用整数型Integer时,请参阅必须定义整数取值范围
2.2 .加减算术码的适用范围—— 整数
2.3 .整数和比特的表达方式: 15; “一”; 1011