EDAboard.com | EDAboard.eu | EDAboard.de | EDAboard.co.uk | RTV forum PL | NewsGroups PL

Using bidirectional pins in Verilog

elektroda.net NewsGroups Forum Index - FPGA - Using bidirectional pins in Verilog

Giorgos Tzampanakis
Guest

Wed Mar 03, 2010 9:33 pm   



I'm trying to use bidirectional pins in Quartus with Verilog.
What's the correct way to do it? Altera has some example code:

http://www.altera.com/support/examples/verilog/ver_bidirec.html

But I don't really understand it. For example, it says it can
drive the value b out but I can't see bidir being assigned to at
all, rather just being connected to a when oe is asserted.

Gabor
Guest

Wed Mar 03, 2010 10:17 pm   



On Mar 3, 2:33 pm, Giorgos Tzampanakis <g...@hw.ac.uk> wrote:
Quote:
I'm trying to use bidirectional pins in Quartus with Verilog.
What's the correct way to do it? Altera has some example code:

http://www.altera.com/support/examples/verilog/ver_bidirec.html

But I don't really understand it. For example, it says it can
drive the value b out but I can't see bidir being assigned to at
all, rather just being connected to a when oe is asserted.

assign bidir = oe ? a : 8'bZ ;

So why is this different to bidir "being assigned to"? It
says drive bidir with whatever value is on "a" when oe is
high. "a" itself is assigned in the synchronous always
block:

always @ (posedge clk)
begin
a <= inp;
end

This presumably shows a registered output. If you wanted
a combinatorial I/O you'd just assign inp directly to bidir
like:

assign bidir = oe ? inp : 8'bZ ;

HTH,
Gabor

elektroda.net NewsGroups Forum Index - FPGA - Using bidirectional pins in Verilog

Arabic versionBulgarian versionCatalan versionCzech versionDanish versionGerman versionGreek versionEnglish versionSpanish versionFinnish versionFrench versionHindi versionCroatian versionIndonesian versionItalian versionHebrew versionJapanese versionKorean versionLithuanian versionLatvian versionDutch versionNorwegian versionPolish versionPortuguese versionRomanian versionRussian versionSlovak versionSlovenian versionSerbian versionSwedish versionTagalog versionUkrainian versionVietnamese versionChinese version
RTV map EDAboard.com map News map EDAboard.eu map EDAboard.de map EDAboard.co.uk map Opony