Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
21611 Discussions

Tristate Buffer and Open Drain

Altera_Forum
Honored Contributor II
2,019 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
766 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
766 Views

You are right. i do a mistake there. thanks

0 Kudos
Reply