Professional Documents
Culture Documents
use IEEE.STD_LOGIC_1164.all;
entity one_four_demux is
port(i : in BIT;
sel : in BIT_VECTOR(1 downto 0);
y : out BIT_VECTOR(3 downto 0));
end one_four_demux;
-----------
library IEEE;
use IEEE.STD_LOGIC_1164.all;
entity four_one_mux is
port(i : in BIT_VECTOR(3 downto 0);
sel : in BIT_VECTOR(1 downto 0);
y : out bit);
end four_one_mux;
------
library IEEE;
use IEEE.STD_LOGIC_1164.all;
entity two_one_mux is
port(i : in BIT_VECTOR(1 downto 0);
sel : in bit;
y : out bit);
end two_one_mux;
-----
library IEEE;
use IEEE.STD_LOGIC_1164.all;
entity four_one_mux_struct is
port( a,b,c,d : in bit;
sel1,sel0 : in bit;
y_out : out bit);
end four_one_mux_struct;
component two_one_mux is
port(i : in BIT_VECTOR(1 downto 0);
sel : in bit;
y : out bit);
end component;
begin
end four_one_mux_struct_arch;
-------
entity and_gate is
port (a, b : in bit;
c: out bit);
end and_gate;
architecture arch_and of and_gate is
begin
process(a,b)
begin
if (a ='1' and b = '1') then
c<= '1';
else
c<= '0';
end if;
end process;
end arch_and;
---
library IEEE;
use IEEE.std_logic_1164.all;
entity and_gate1 is
port (a, b : in std_logic;
c: out std_logic);
end and_gate1;
architecture arch_and of and_gate1 is
begin
process(a,b)
begin
if (a ='1' and b = '1') then
c<= '1';
else
c<= '0';
end if;
end process;
end arch_and1;
--------
library IEEE;
use IEEE.std_logic_1164.all;
entity and_gate1 is
port (a : in std_logic_vector(1 downto 0);
c: out std_logic);
end and_gate1;
architecture arch_and of and_gate1 is
begin
process(a)
begin
if (a="11" ) then
c<= '1';
else
c<= '0';
end if;
end process;
end arch_and1;