Mode:
Duration:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
module Counter(
input clk,
input reset,
output reg [31:0] count,
output reg isDark
);
always @(posedge clk or posedge reset) begin
if (reset) begin
count <= 0;
isDark <= 0;
end else begin
count <= count + 1;
isDark <= ~isDark;
end
end
endmoduleCoding works best on desktop or with an external keyboard.