Guest
Hi,
I got a short verilog tutorial on line.
I feel that I understand the last part after "and any variable that is..." of the
below paragraph.
But it looks like for me that it does not explain the error of the example.
.. Is it (assign LP=3'b101 a continuous assignment?
For me, (assign LP=3'b101 is just what "Any variable that is continuously
assigned (using assign keyword) has to be wire" requires.
Could you explain it to me?
Thanks,
Q: Is the following code fragment correct?
wire[2:0] LP;
initial begin
assign LP=3'b101;
end
Wrong. Any variable that is continuously assigned (using assign keyword) has to
be wire, and any variable that is assigned using = inside an always or initial
block has to be of type reg.
I got a short verilog tutorial on line.
I feel that I understand the last part after "and any variable that is..." of the
below paragraph.
But it looks like for me that it does not explain the error of the example.
.. Is it (assign LP=3'b101 a continuous assignment?
For me, (assign LP=3'b101 is just what "Any variable that is continuously
assigned (using assign keyword) has to be wire" requires.
Could you explain it to me?
Thanks,
Q: Is the following code fragment correct?
wire[2:0] LP;
initial begin
assign LP=3'b101;
end
Wrong. Any variable that is continuously assigned (using assign keyword) has to
be wire, and any variable that is assigned using = inside an always or initial
block has to be of type reg.