- module DFF (output reg Q, input C, D, R);
- always @(posedge C)
- if (~R) begin
- Q <= 1'b0;
- end else begin
- Q <= D;
- end
- endmodule
-
+ module example (output reg [0:5] Q, input C);
+ reg [0:8] counter;
+ always @(posedge C)
+ begin
+ counter <= counter + 1'b1;
+ Q = counter[7] ^ counter[5] | counter<<2;
+ end
+ endmodule
+
+