module count4( R, clk, Q );

input R, clk;
output [3:0] Q;

wire [3:0] Q;
reg [29:0] T;

always @ (posedge R or posedge clk)
   if( R )
      T <= 0;
   else
      T <= T+1;

assign Q = T[29:26];

endmodule