projet-vlsi/adder1bit.vhdl

21 lines
492 B
VHDL
Raw Normal View History

2021-10-26 19:06:02 +02:00
library ieee;
use ieee.math_real.all;
use ieee.numeric_std.all;
use ieee.std_logic_1164.all;
-- ADDER 1 BIT
----------------------------------------------------------------
ENTITY adder1bit IS
PORT (
i0, i1, cin : IN std_logic;
q, cout : OUT std_logic
);
END ENTITY;
-----------------------------------------------------------------
ARCHITECTURE full_adder_1bit OF adder1bit IS
BEGIN
q <= i0 XOR i1 XOR cin;
cout <= (i0 and i1) or (i0 and cin) or (i1 and cin);
END full_adder_1bit;