Multiplexing Output Signals in VHDL
-- Using macrocell logic for a conventional multiplexer:
process (SEL, A, B, C, D)
begin
case SEL is
end process; when "00" => MUX_OUT <= A;
end case;
when "01" => MUX_OUT <= B;
when "10" => MUX_OUT <= C;
when "11" => MUX_OUT <= D;
-- Using 3-state outputs to multiplex registers fast
process (CLK)
begin
if CLK'event and CLK='1' then --CLK rising edge
end process; REG_A <= DATA_A;
end if;
REG_B <= DATA_B;
DOUT_A <= REG_A when SELECT='0' else 'Z';
DOUT_B <= REG_B when SELECT='1' else 'Z';
--Tie output pins DOUT_A and DOUT_B together off-chip.