uaveiro-leci/1ano/2semestre/lsd/pratica03/AdderDemo/FullAdder.vhd

16 lines
284 B
VHDL
Raw Permalink Normal View History

2023-03-09 16:54:03 +00:00
library IEEE;
use IEEE.STD_LOGIC_1164.all;
entity FullAdder is
port
(
a, b, cin : in std_logic;
s, cout : out std_logic
);
end FullAdder;
architecture Behavioral of FullAdder is
begin
s <= a xor b xor cin;
cout <= (a and b) or (a and cin) or (b and cin);
end Behavioral;