In this example, three tri-state buses feed a flipflop. Because Altera devices do not have internal device tri-state buses (i.e., tri-state buffers only exist in I/O cells), MAX+PLUS II converts the tri-state bus to a multiplexer.
For more information on using this example in your project, go to:- How to Use Graphic Editor Examples
- Graphic Editor: Tri-State Buses Converted to a Multiplexer
- Implementing Tri-State Buses in Altera Devices
- MAX+PLUS II Help
tribus.tdf
SUBDESIGN tribus
(
ina[7..0], inb[7..0], inc[7..0], oe_a, oe_b, oe_c, clock
: INPUT;
out[7..0] : OUTPUT;
)
VARIABLE
tri_a[7..0], tri_b[7..0], tri_c[7..0] : TRI;
mid[7..0] : TRI_STATE_NODE;
flip[7..0] : DFF;
BEGIN
-- Declare the data inputs to the tri-state buses
tri_a[] = ina[];
tri_b[] = inb[];
tri_c[] = inc[];
-- Declare the output enable inputs to the tri-state buses
tri_a[].oe = oe_a;
tri_b[].oe = oe_b;
tri_c[].oe = oe_c;
-- Connect the outputs of the tri-state buses together
mid[] = tri_a[];
mid[] = tri_b[];
mid[] = tri_c[];
-- Feed the output pins
flip[].d = mid[];
flip[].clk = clock;
out[] = flip[].q;
END;
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.

