To increment by 1 each time through the loop, use DATA_IN=DATA_IN+1
. Here is a self-contained example:
module tb;
reg [7:0] DATA_IN;
initial begin
for (DATA_IN=7'b0000000; DATA_IN<=7'b0011111; DATA_IN=DATA_IN+1) begin
$displayb(DATA_IN);
end
end
endmodule
Output:
00000000
00000001
00000010
00000011
00000100
00000101
00000110
00000111
00001000
00001001
00001010
00001011
00001100
00001101
00001110
00001111
00010000
00010001
00010010
00010011
00010100
00010101
00010110
00010111
00011000
00011001
00011010
00011011
00011100
00011101
00011110
00011111
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…