always@(posedge CLK) begin if(!rst) LEDS <= 8'b0; else if(div0) begin LEDS <= LEDS * 2 + (LEDS[17] ? 1'b0 : 1'b1) ; end end