This repository has been archived on 2024-01-06. You can view files and clone it, but cannot push or open issues or pull requests.
justhomework/Quartus/v6/jyh_4490_6_entry.v

79 lines
1 KiB
Coq
Raw Permalink Normal View History

2022-05-10 10:11:28 +00:00
module jyh_4490_6_entry(code, seg, clk_50m, en, in,
//数码管型码 数码管位码 50M 使能信号 按键
2022-05-11 03:49:38 +00:00
out0, cnt, subclk);
//计数值 消抖值
2022-05-10 09:37:13 +00:00
output [6:0] code;
output [7:0] seg;
2022-05-10 10:11:28 +00:00
input en,clk_50m,in;
2022-05-10 09:37:13 +00:00
output subclk;
output [3:0] out0;
2022-05-11 03:49:38 +00:00
output [19:0] cnt;
2022-05-10 09:37:13 +00:00
2022-05-10 10:11:28 +00:00
2022-05-10 09:37:13 +00:00
wire freshclk;
2022-05-11 06:25:40 +00:00
wire [3:0] out1;
wire [3:0] out2;
wire [3:0] out3;
wire co,co2,co3;
2022-05-10 09:37:13 +00:00
reg upd;
initial begin
upd=1;
end
//分频器
jyh_4490_6_divider D1(
.clk(clk_50m),
.clk_out(freshclk)
);
//个位计数器
jyh_4490_6_counter C1(
.Q(out0),
.clk(subclk),
.en(en),
2022-05-11 06:25:40 +00:00
.co(co),
.upd(upd));
jyh_4490_6_counter C2(
.Q(out1),
.clk(co),
.co(co2),
.en(en),
.upd(upd));
jyh_4490_6_counter C3(
.Q(out2),
.clk(co2),
.co(co3),
.en(en),
.upd(upd));
jyh_4490_6_counter C4(
.Q(out3),
.clk(co3),
.en(en),
2022-05-10 09:37:13 +00:00
.upd(upd));
//四位数码管译码器
jyh_4490_4_encoder E1(
.codeout(code),
.d1(out0),
2022-05-11 06:25:40 +00:00
.d2(out1),
.d3(out2),
.d4(out3),
2022-05-10 09:37:13 +00:00
.clk(freshclk),
.sel(seg[3:0])
);
//消抖模块
jyh_4490_mstate M1(
.clk(clk_50m),
.in(in),
.en(en),
2022-05-11 03:49:38 +00:00
.out(subclk),
.cnt(cnt)
2022-05-10 09:37:13 +00:00
);
endmodule