Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] how to declare a bidrectional bus in verilog

Status
Not open for further replies.

blooz

Advanced Member level 2
Joined
Dec 29, 2010
Messages
560
Helped
121
Reputation
242
Reaction score
116
Trophy points
1,343
Location
India
Activity points
4,985
suppose if the bidirectional bus is

inout bus_bidir[7:0]

with enable signal en
is it possible to use the bus_bidir alone to make the data transfer in both directions

if en=1 the bus to be used as output

and if en=0 the bus to e used as input .
 

quite simple:

assign bus_bidir = en ? data : 8'hZZ;
wire [7:0] internal_bus = bus_bidir;
----
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top