Full Adder - VHDL Code - Testbench - EDA Playground
Full Adder - VHDL Code - Testbench - EDA Playground
VHDL CODE
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity Fulladder is
Port ( a : in STD_LOGIC;
b : in STD_LOGIC;
c : in STD_LOGIC;
cy : out STD_LOGIC);
end Fulladder;
begin
end Behavioral;
Test bench
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
ENTITY Fulladder_tb IS
END Fulladder_tb;
COMPONENT Fulladder
PORT(
a : IN std_logic;
b : IN std_logic;
c : IN std_logic;
cy : OUT std_logic
);
END COMPONENT;
--Inputs
--Outputs
signal cy : std_logic;
BEGIN
a => a,
b => b,
c => c,
cy => cy
);
-- Stimulus process
stim_proc: process
begin
a <= '0';
b <= '0';
c <= '0';
a <= '0';
b <= '0';
c <= '1';
a <= '0';
b <= '1';
c <= '0';
b <= '1';
c <= '1';
a <= '1';
b <= '0';
c <= '0';
a <= '1';
b <= '0';
c <= '1';
a <= '1';
b <= '1';
c <= '0';
a <= '1';
b <= '1';
c <= '1';
wait;
end process;
END;