Cse (B)
Cse (B)
Cse (B)
entity half_sub is
port( a,b : IN std_logic;
diff,borrow : OUT std_logic);
end half_sub;
end dataflow;
TEST BENCH:
-- Code your testbench here
library IEEE;
use IEEE.std_logic_1164.all;
entity half_sub_tb is
end entity;
architecture tb of half_sub_tb is
component half_sub is
port(a,b : IN std_logic;
diff,borrow : OUT std_logic);
end component;
begin
stim: process
begin
a <= '0';
b <= '0';
wait for 20 ns;
a <= '0';
b <= '1';
wait for 20 ns;
a <= '1';
b <= '0';
wait for 20 ns;
a <= '1';
b <= '1';
wait for 20 ns;
wait;
end process;
end tb;
OUTPUT :
…………………………………………………………………………………………………
…………………………………………………………………………………………………
……………………
end dataflow;
TEST BENCH:
-- Code your testbench here
library IEEE;
use IEEE.std_logic_1164.all;
entity full_sub_tb is
end entity;
architecture tb of full_sub_tb is
component full_sub is
port(a,b,c : IN std_logic;
diff,borrow : OUT std_logic);
end component;
begin
stim: process
begin
a <= '0';
b <= '0';
c <= '0';
wait for 20 ns;
a <= '0';
b <= '0';
c <= '1';
wait for 20 ns;
a <= '0';
b <= '1';
c <= '0';
wait for 20 ns;
a <= '0';
b <= '1';
c <= '1';
wait for 20 ns;
wait;
end process;
end tb;
OUTPUT:
…………………………………………………………
…………………………………………………………
…………….