I am looking to implement a 32-bit Parallel in-Parallel out in verilog HDL. Here is the code I have written...
module pipo(input_seq, answer,reset, clock);
input [31:0] input_seq;
input reset,clock;
output [31:0] answer;
always @ (reset)
begin
if(!reset)
begin
answer[31:0]<=1'b0;
end
end
always @ (posedge clock)
begin
answer[31:1]<=input_seq[30:0];
end
endmodule
However this leads to the following error log( using iverilog
):
pipo.v:10: error: answer['sd31:'sd0] is not a valid l-value in pipo.
pipo.v:4: : answer['sd31:'sd0] is declared here as wire.
pipo.v:16: error: answer['sd31:'sd1] is not a valid l-value in pipo.
pipo.v:4: : answer['sd31:'sd1] is declared here as wire.
Elaboration failed
What are the problems?
You are using
answer
as a register, but it's declared as a wire.Wire
is something which connects two points, and thus does not have any driving strength. On the other handreg
can store value and drive strength.Change declaration of
answer
toreg
and it should help.