You are on page 1of 1

library IEEE;

use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

entity MUX_8to1_bhvr is

Port ( A : in STD_LOGIC_VECTOR (7 downto 0);


S : in STD_LOGIC_VECTOR (2 downto 0);
Y : out STD_LOGIC);

end MUX_8to1_bhvr;

architecture Behavioral of MUX_8to1_bhvr is

begin

MUX : Process (A, S)

Variable s1 : STD_LOGIC_VECTOR (2 downto 0);

Begin
If (S = "000") Then
Y <= A(0);
Elsif (S = "001") Then
Y <= A(1);
Elsif (S = "010") Then
Y <= A(2);
Elsif (S = "011") Then
Y <= A(3);
Elsif (S = "100") Then
Y <= A(4);
Elsif (S = "101") Then
Y <= A(5);
Elsif (S = "110") Then
Y <= A(6);
Elsif (S = "111") Then
Y <= A(7);
End If;

End Process;

end Behavioral;

You might also like