Wednesday, June 28, 2006

VHDL And Port

library ieee;
use ieee.std_logic_1164.all;

entity AndPort is
port( x: in std_logic;
y: in std_logic;
F: out std_logic
);

architecture DataFlow of AndPort is
begin

F <= x and y;

end DataFlow;

architecture DataFlow2 of AndPort is
begin

process(x,y)
begin
if ((x='1') and (y='1')) then
F<= '1';
else
F <='0';
end if;
end process;
end DataFlow2;

VHDL Not Port

library ieee;
use ieee.std_logic_1164.all;

entity NotPort is
port(
A: in std_logic;
B: out std_logic
);
end NotPort;

architecture DataFlow of NotPort is

begin

B <= not A;

end DataFlow;