题解 | #十六进制计数器#
十六进制计数器
http://www.nowcoder.com/practice/7a7cf1062faf4b5dbb578e0c761c2b42
。。。。?
`timescale 1ns/1ns
module counter_16(
input clk ,
input rst_n ,
output reg [3:0] Q
);
always @(posedge clk or negedge rst_n) begin
if (!rst_n) begin
Q <= 4'b0;
end else begin
Q <= Q +1'b1;
end
end
endmodule