The most common loop, synthesizable when bounds are constant:
module bit_count (
input wire [7:0] data,
output reg [3:0] count // Max 8 = fits in 4 bits
);
integer i;
always @(*) begin
count = 0;
for (i = 0; i < 8; i = i + 1) begin
count = count + data[i];
end
end
endmodule
Synthesis Requirement
For synthesis, loop bounds must be compile-time constants. The loop is "unrolled" into parallel hardware.