Selasa, 26 Juni 2012

Program Multiplexer


Mmultiplexer program using IF statement
Using VHDL .....

Description:
a, b, c, d is the input data
s [1:0] is the data for the MUX selector
o Data for Output

Program
library ieee; 
use ieee.std_logic_1164.all; 

entity mux is 
port (a, b, c, d : in std_logic; 
s : in std_logic_vector (1 downto 0); 
o : out std_logic); 
end mux; 
architecture archi of mux is 
begin 
process (a, b, c, d, s) 
begin 
if (s = "00") then o <= a; 
elsif (s = "01") then o <= b; 
elsif (s = "10") then o <= c; 
else o <= d; 
end if; 
end process; 
end archi;

Tidak ada komentar:

Posting Komentar