📄 16位加法器.vhd
字号:
LIBRARY IEEE; //调用标准库文件
use ieee.std_logic_1164.all ;
use ieee.std_logic_unsigned.all ;
entity add16 is //定义实体
port( //定义端口
cin : in std_logic ;
a , b : in std_logic_vector(15 downto 0) ;
s : out std_logic_vector(15 downto 0)) ;
end add16 ;
architecture behavior of add16 is
signal st : std_logic_vector(16 downto 0) ;
signal ag,bg : std_logic_vector(16 downto 0) ;
begin
ag<='0'&a ;
bg<='0'&b ;
st<=ag+bg+cin ;
s<=st(15 downto 0) ;
end behavior ;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -