What is VHDL program for 2 to 1 multiplexer?

1 answer

Answer

1290363

2026-08-02 23:15

+ Follow

library IEEE;

use IEEE.STD_LOGIC_1164.ALL;

use IEEE.STD_LOGIC_ARITH.ALL;

use IEEE.STD_LOGIC_UNSIGNED.ALL;

entity mux2x1 is

Port ( i : in STD_LOGIC_VECTOR (1 downto 0);

s : in STD_LOGIC;

y : out STD_LOGIC);

end mux2x1;


architecture df of mux2x1 is

begin

with s select

y<= i(0) when '0',

i(1) when '1',

'0' when others;

end df;

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.