VHDL:Tri-State Buses

This example implements 8 tri-state buffers by using a WHEN-ELSE clause in an Architecture Body statement. It does not have a feedback path, and therefore the output pin my_out is designated as OUT, instead of INOUT.

This example is similar to the VHDL: Bidirectional Bus example, except that it does not use a feedback line.

For more information on using this example in your project, go to:


    USE ieee.std_logic_1164.ALL;

ENTITY prebus IS
        my_in  : IN STD_LOGIC_VECTOR(7 DOWNTO 0);
        sel    : IN STD_LOGIC;
        my_out : OUT STD_LOGIC_VECTOR(7 DOWNTO 0));
END prebus;

ARCHITECTURE maxpld OF prebus IS
    my_out <= "ZZZZZZZZ"
    WHEN (sel = '1')
    ELSE my_in;
END maxpld;

Design Examples Disclaimer

These design examples may only be used within Altera Corporation devices and remain the property of Altera. They are being provided on an “as-is” basis and as an accommodation; therefore, all warranties, representations, or guarantees of any kind (whether express, implied, or statutory) including, without limitation, warranties of merchantability, non-infringement, or fitness for a particular purpose, are specifically disclaimed. Altera expressly does not recommend, suggest, or require that these examples be used in combination with any other product not provided by Altera.