Ravindranit
Newbie level 2
problem inout port
Hello friends,
I want to use inout declaration in my code. but it gives the error that port is not a legal value. i use it into the always block both as a input & output.
code is:
module check(a,s1,out,d,enable);
input s1,enable;
input a;
output out;
reg b;
inout d;
reg out;
assign b=d;
always @(posedge enable)
if(s1)
begin out=a; d=~a; end
else
out=b;
endmodule
Hello friends,
I want to use inout declaration in my code. but it gives the error that port is not a legal value. i use it into the always block both as a input & output.
code is:
module check(a,s1,out,d,enable);
input s1,enable;
input a;
output out;
reg b;
inout d;
reg out;
assign b=d;
always @(posedge enable)
if(s1)
begin out=a; d=~a; end
else
out=b;
endmodule