Altera_Forum
Honored Contributor
12 years agoThe question about bidirectional port
In my design, I have a inout port. Then I search it, found most examples, they only put the high impedance for output direction as (case 1):
inout [7:0 ]data_io; reg [7:0] out_a; wire [7:0] in_b; reg rnw; assign data_io = (rnw==1'b0) out_a : 8'bZ; /// when read, assign io as high impedance assign in_b = data_io; But I think we may also put high impedance in both direction like (case 2): inout [7:0 ]data_io; reg [7:0] out_a; wire [7:0] in_b; reg rnw; assign data_io = (rnw==1'b0) out_a : 8'bZ; /// when read, assign io as high impedance assign in_b = (rnw==1'b1) data_io : 8'bZ; /// when write, read high impedance So my question is, will put high impedance in both directions (like case 2) cause problems? My understanding is it won't cause problem. The difference between case 1 and case 2 is, in case 1, the "in_b" will equal the output date during write operation. Thanks.