FPGA, CPLD, and ASIC solutions from Altera
  • Download Center
  • Literature
Sign in/register
myAltera Account
Welcome
  •   myAltera
  •   Logout
  • Products
    • Devices
    • Design Software
    • Intellectual Property
    • Development Kits/Cables
    • Design & Support Services
    • Literature
  • End Markets
    • Automotive
    • Broadcast
    • Computer & Storage
    • Consumer
    • Industrial
    • Medical
    • Military
    • Test & Measurement
    • Wireless
    • Wireline
  • Technology
    • DSP
    • External Memory
    • Embedded Processing
    • Transceivers
    • Parallel I/O
    • Signal Integrity
    • System Integration
  • Training
    • Training Courses
    • University Program
    • Webcasts & Videos
    • Demonstrations
    • Events Calendar
  • Support
    • Design & Support Resources
    • Knowledge Database
    • Devices
    • Design Software
    • Intellectual Property
    • Development Kits/Cables
    • Design Examples
    • Downloads
    • User Communities/Forums
    • mySupport
  • About Altera
    • About Us
    • Environmental
    • Customer Successes
    • Partners
    • Newsroom
    • Investor Relations
    • Jobs
    • Contact Us
  • Buy Online
    • Devices
    • Design Software
    • Development & Education Kits
    • Cables & Programming Hardware
    • Intellectual Property
  • Entire Site
  • Part Number
  • Knowledge Database
  • Support & Technical Docs
  • Forums & Wiki
Username:  
Password:  
 
Forgot my username or password
Don't have myAltera account? Register Now.
Enter your email address:


Home > Support > Knowledge Database > Support Solution

Solution ID: rd06252007_878
Last Modified: Aug 28, 2007
Product Category: Design Software
Product Area: Design Entry/Planning
Product Sub-area: Coding Style

Problem

How do I implement open drain outputs in the Quartus II software?

Solution

You can implement an open drain output signal using standard VHDL or Verilog HDL statements, or by instantiating an Altera® open drain (OPNDRN) primitive.

Method 1. Use one of the following HDL statements to create an open drain output for a signal called top_out:

VHDL:  top_out <= 'Z';
Verilog HDL:  assign top_out = 1'bZ;

Method 2. Use the Altera OPNDRN primitive to create an open drain output. This primitive is defined in Quartus® II Help as described below.

VHDL:
<instance_name>: opndrn PORT MAP (
a_in => <input_wire>,
a_out => <output_pin>
);

The VHDL component is declared in an Altera primitives library. Use the following commands to include the library:

LIBRARY altera;
USE altera.altera_primitives_components.all;

Verilog HDL:
OPNDRN <instance_name> (.in(<input_wire>), .out(<output_pin>));

You can use the Quartus II language templates to help you instantiate the primitive. Right-click in the Quartus II text editor and choose Insert Template. In the Language templates list, expand the list for VHDL or Verilog HDL, then expand Altera Primitives, and then Buffers. Choose the OPNDRN primitive and click Insert. You can then customize the instantiation and continue design entry.

To confirm that the open drain output pin was implemented, check the Compilation Report. In the Fitter section of the report, expand the Resource Section and click Output Pins. The Open Drain column indicates yes for any open drain output pins.


Feedback

     This solution answers my question:
Strongly Disagree
   
Strongly Agree
 
  1 2 3 4 5  
     This solution was easy to find:          
Strongly Disagree
   
Strongly Agree
 
  1 2 3 4 5  

    Please provide additional feedback to improve support solutions:


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.


  • Altera Troubleshooters
    • Overview
    • Licensing
    • Simulating with ModelSim
    • Timing Analysis
    • PLL Loss of Lock
    • FPGA Configuration
    • JTAG Config & ISP
    • PFL Troubleshooter
    • Jam, JBC and SVF
    • Usage Guidelines
    • Optimization Advisor
    Please Give Us Feedback
    Products | End Markets | Technology | Training | Support | About Altera | Buy Online
    Jobs | Investor Relations | Contact Us | Site Map | Privacy | Legal Notice
    Copyright © 1995-2010 Altera Corporation. All Rights Reserved.
    Altera Forum
    Altera
    Forum
    Twitter
    Twitter
    RSS
    RSS
    Facebook
    Facebook
    Flickr
    Flickr
    YouTube
    YouTube
    Email Updates
    Email
    Updates