⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 adder_signed.vhd

📁 DLX CPU VHDL CODE UNIVERSITY
💻 VHD
字号:
use work.dp32_types.all;entity adder_signed is    generic(width : positive);    port(a,b : in bit_vector(width-1 downto 0);         y : out bit_vector(width-1 downto 0);	 o : out bit );end adder_signed;architecture behaviour of adder_signed isbeginmain : process (a,b)variable t: bit_vector(width-1 downto 0);begin--wait for 1 ns;if(bits_to_int(a)+bits_to_int(b) > power(2,width)-1)then  o<='1';else  o<='0';  int_to_bits(bits_to_int(a)+bits_to_int(b) ,t);  y<=t;end if;end process;end behaviour;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -