bidirectional to unidirectional

F

faz

Guest
Hai all,

I have to convert bidrectional signal g3_g4_io into unidirectional...

ex:Bidirectional

inout g3_g4_io;
wire enable_1;
wire g3_i;
wire g3_in;

assign g3_g4_io = (enable_1 ==1'b1)?g3_g4_o:1b'z;

assign g3_i = g3_g4_io;

assign g3_in = (enable_1 ==1'b0)?g3_i:1b'0;


To unidirectional:
input g3;
output g4;
output enable_1;

reg g3;
reg g4;

if(enable_1 ==1'b1)
begin
g4=1'b1;
end
else
begin
g3 =1'b1;
end


Is the above conversion is correct...pls point out the mistake and
give your suggestions...

regards,
faz
 

Welcome to EDABoard.com

Sponsor

Back
Top