Your case statement is wrong. It should select based on the counter value:
always @ (*) begin
case(counter)
1: data= 8'b00000011; //number 0
2: data= 8'b00100101; //number 2
3: data= 8'b10011001; //number 4
default:data=8'b00000011;
endcase
end
Your counter should be:
always @ (posedge clock) begin
if(reset==1 || counter == 3) counter <= 1;
else counter <= counter + 1;
end
Note that case
is a keyword. You can't use it in an expression.