fulladd.vhd

来自「用于实现两个数相加的vhdl代码」· VHDL 代码 · 共 31 行

VHD
31
字号
-------------------------------------------------------
-- Full adder.
--
-- This project demonstrates the use of concurrent
-- statements in VHDL., and demonstrates the simplest
-- form of VHDL design description. There are no
-- external libraries specified.
--
-- The test bench for this example (TESTADD.VHD) expects
-- that this module (FULLADD.VHD) be compiled into the
-- WORK library.
--

entity FULLADDER is
    port (X: in bit;
          Y: in bit;
          Cin: in bit;
          Cout: out bit;
          Sum: out bit);
end FULLADDER;

architecture CONCURRENT of FULLADDER is
begin

    -- Concurrent statements go here...

    Sum <= X xor Y xor Cin;
    Cout <= (X and Y) or (X and Cin) or (Y and Cin);

end CONCURRENT;

⌨️ 快捷键说明

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