📄 subtractor_unsigned.vhd
字号:
use work.dp32_types.all;entity subtractor_unsigned is generic (width : positive); port(a,b : in bit_vector(width-1 downto 0); y : out bit_vector(width-1 downto 0); n,z : out bit);end subtractor_unsigned;architecture behaviour of subtractor_unsigned isbeginmain : process (a,b)variable t: bit_vector(width-1 downto 0);begin--wait for 1 ns;int_to_bits(bits_to_uint(a)-bits_to_uint(b) ,t);y<=t;if(bits_to_uint(a)-bits_to_uint(b) = 0) then z<='1';else if(bits_to_uint(a)-bits_to_uint(b) < 0) then n<='1'; else n<='0'; end if; z<='0';end if;end process;end behaviour;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -