N
nisheethg@gmail.com
Guest
Hello
I m stuck with the follwoing. I want to make port c as inout
and use it in 'always'.But, 'always' needs left hand side to be
register type which is not possible with inout type. Any solutions??
------------------------------------------
module(rd,wr,c,clk);
input rd,wr;
inout [7:0] c;
input clk;
reg [7:0] c;
reg [7:0] data;
always@(rd,wr,posedge clk)
begin
if(clk)
begin
if(rd)
c<=data;
if(wr)
data<=c;
end
end
endmodule
----------------------------------------
Nisheeth
I m stuck with the follwoing. I want to make port c as inout
and use it in 'always'.But, 'always' needs left hand side to be
register type which is not possible with inout type. Any solutions??
------------------------------------------
module(rd,wr,c,clk);
input rd,wr;
inout [7:0] c;
input clk;
reg [7:0] c;
reg [7:0] data;
always@(rd,wr,posedge clk)
begin
if(clk)
begin
if(rd)
c<=data;
if(wr)
data<=c;
end
end
endmodule
----------------------------------------
Nisheeth