目的:用VHDL文本输入法设计并实现一个一位半加器。
程序(使用quartus II软件进行编写)
library ieee;
use ieee.std_logic_1164.all;
entity add1_half is
port(
Ai,Bi :in std_logic;
So,Co :out std_logic --So半加和,Co进位输出
);
end add1_half;
architecture behave of add1_half is
begin
process(Ai,Bi)
begin
So <= Ai xor Bi;
Co <= Ai and Bi;
end process;
end behave;
仿真波形图