Altera Home Page
Literature Licensing
Buy On-Line Download

  Home   |   Products   |   Support   |   End Markets   |   Technology Center   |   Education & Events   |   Corporate   |   Buy On-Line  
  Knowledge Database   |   Devices   |   Design Software   |   Intellectual Property   |   Design Examples   |   mySupport   |   Reference Designs  

 Products
      MAX/MAX II
      Stratix/Stratix GX
      Nios II
  
 Functionality
      Arithmetic
      Memory
      Bus & I/O
      Logic
      Interfaces & Peripherals
      DSP
      Communications
      PLL & Clocking
  
 Design Entry
      Quartus II Project
      Tcl
      VHDL
      Verilog HDL
      C Code Examples
      DSP Builder
      TimeQuest
   On-Chip Debugging
  
 Simulation Tools
      Mentor Graphics ModelSim
      Cadence NCsim
      Synopsys VCS
  
 Legacy Examples
      Graphic Editor
      AHDL
  

AHDL: Parameterized Tri-State Bus (lpm_bustri)

This example implements a tri-state bus. The width of the bus is specified with the LPM_WIDTH parameter and can be changed for your design. The dq and data_out pins are fed by tri-state buses. Because tri-state buses cannot feed internal logic, you should use the lpm_bustri function only if dq and data_out feed pins. This example uses an Include Statement (shown in blue text) to import the contents of the Include File containing the Function Prototype of the lpm_bustri function. An Instance Declaration implements (shown in red text) an instance of the function.

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

tribus.tdf


INCLUDE "lpm_bustri";

SUBDESIGN tribus
(
   enable_out, enable_in  : INPUT;
   datain[7..0]           : INPUT;
   dataout[7..0]          : OUTPUT;
   dq[7..0]               : BIDIR;
)

VARIABLE

   u1 : lpm_bustri 
        WITH (LPM_WIDTH=8);

BEGIN

   u1.data[7..0] = datain[7..0];
   u1.enabletr = enable_out;
   u1.enabledt = enable_in;
   dataout[7..0] = u1.result[7..0];
   dq[7..0] = u1.tridata[7..0];

END;

Feedback

Did this information help you?

If not, please log onto mySupport to file a technical request or enhancement.


Altera does not warrant that this solution will work for the customer's intended purpose and disclaims all liability for use of or reliance on the solution.

  Please Give Us Feedback