full_adder.vhd

来自「內含fulladder結構檔,電路檔,測試檔(testbench)以及執行檔(.」· VHDL 代码 · 共 26 行

VHD
26
字号
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use work.pkg_Full_Adder.all;

entity Full_Adder is
  port( in1      : in  std_logic;
        in2      : in  std_logic;
        carryin  : in  std_logic;

        sum      : out std_logic;
        carryout : out std_logic
      );
end Full_Adder;

architecture arc of Full_Adder is
begin
Do_Full_Adder:
    process( in1, in2, carryin )
        variable result : std_logic_vector( 1 downto 0);
    begin
        result := '0'&in1 + in2 + carryin;
        carryout <= result(1);
        sum      <= result(0);
    end process Do_Full_Adder;
end arc;

⌨️ 快捷键说明

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