-1

I want to write a module in Verilog that outputs the same 32-bit input at positive clock edge. However, I have some trouble with the loop conditions. enter image description here

  • 1
    in verilog there is no `+=` operator. you would need `i = i+1` instead. Or you can switch to system verilog. Also you have a bunch of other syntactic errors in port declaration. – Serge Oct 19 '20 at 11:07

1 Answers1

2
module if_id (
  input             clk
 ,input      [31:0] in
 ,output reg [31:0] out
);

 always@(posedge clk)
   out <= in;

endmodule

you don't need to write looping code if your intention is to register a 32bit value . But if u need to write it in array mode u need to use genvar variable in your code. By the way int isn't supported in verilog variants . migrate to System-verilog for more number of data types.