entity fulladd_tb is end fulladd_tb; architecture behav of fulladd_tb is component fulladd port (i0, i1 : in bit; ci : in bit; s : out bit; co : out bit); end component; signal i0_s, i1_s, ci_s, s_s, co_s : bit; -- il componente sotto test dovrebbe comportarsi secondo -- la seguente tabella di verita' -- -- i0 i1 ci s co -- -- 0 0 0 0 0 -- 0 0 0 0 0 -- 0 0 1 1 0 -- 0 1 0 1 0 -- 0 1 1 0 1 -- 1 0 0 1 0 -- 1 0 1 0 1 -- 1 1 0 0 1 -- 1 1 1 1 1 -- -- NB: il test verra' costruito descrivendo esplicitamente i segnali, -- ma esistono modi piu' eleganti per descrivere una tabella di verita'. begin -- Component instantiation. uut: fulladd port map (i0_s, i1_s, ci_s, s_s, co_s); i0_p: process -- andamento del segnale i0_s begin i0_s <= '0'; wait for 10 ns; i0_s <= '1'; wait for 10 ns; end process; i1_p: process -- andamento del segnale i1_s begin i1_s <= '0'; wait for 20 ns; i1_s <= '1'; wait for 20 ns; end process; ci_p: process -- andamento del segnale ci_s begin ci_s <= '0'; wait for 40 ns; ci_s <= '1'; wait for 40 ns; end process; end behav;