FPGA Intellectual Property
PCI Express*, Networking and Connectivity, Memory Interfaces, DSP IP, and Video IP
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.

Verilog: tri-state mux

Altera_Forum
Honored Contributor II
874 Views

Hello, 

This is obviously a beginner question, but I am getting some odd behavior from a tri-state mux, and was just wondering if someone could check the correctness of this code: 

 

inout [7:0] bus; 

wire bus_oe; 

wire select; 

wire [7:0] data1; 

wire [7:0] data2; 

assign bus = bus_oe ? (select ? data1:data2): 8'hZZ; 

 

The behavior sought is: if 'bus_oe' is false then 'bus' is HiZ, otherwise if 'select' is true connect 'bus' to 'data1', if false connect 'bus' to 'data2'. 

 

I am using Quartus II 10.0 with a cyclone II chip. 

 

Thanks, 

 

Wahran
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
95 Views

This should be OK.

Altera_Forum
Honored Contributor II
95 Views

how odd is it?

Reply