Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
21615 Discussions

Tristate Buffer and Open Drain

Altera_Forum
Honored Contributor II
2,026 Views

Hi 

 

I would like to implement open drain function with the verilog code below: 

 

assign q = sel ? 1'bz : 1'b0; //open drain 

 

assign q = sel ? 1'b1 : 1'bz; // use tristate buffer to model open drain function with weak pull up resistor 

 

Both using Pin Assignment with weak pull up resistor on q. 

 

So, are they equivalent? Will the tristate buffer cause the contention? 

 

Thanks.
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
773 Views

They are not equivalent. The first one is the right code, if I understood what you mean. 

The second one doesn't make sense: you'd always get a high level on that pin, unless you have an external pull DOWN instead of the internal pull up.
0 Kudos
Altera_Forum
Honored Contributor II
773 Views

You are right. i do a mistake there. thanks

0 Kudos
Reply