Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

[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
561
Helped
121
Reputation
242
Reaction score
116
Trophy points
1,343
Location
India
Activity points
4,989
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 .
 

j_andr

Full Member level 4
Joined
Mar 30, 2008
Messages
208
Helped
59
Reputation
118
Reaction score
37
Trophy points
1,308
Location
europe
Activity points
2,491
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

Top