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/v4/jyh_4490_4_entry.v

53 lines
1,000 B
Coq
Raw Permalink Normal View History

2022-04-12 14:26:39 +00:00
module jyh_4490_4_entry(out1, out0, code, seg, CO,
2022-04-12 08:39:06 +00:00
// 十位输出 个位输出 数码管型码 数码管位码 /借位标志位
2022-04-12 14:26:39 +00:00
in1, in0, load, clk, clk_50m, subclk, clr, en, upd);
// 十位装载 个位装载 装载信号 计数时钟信号 50M 分频信号 清零信号 使能信号 正反计数标志位
2022-04-12 08:39:06 +00:00
output [3:0] out1;
output [3:0] out0;
output [6:0] code;
2022-04-12 14:26:39 +00:00
output [7:0] seg;
2022-04-12 08:39:06 +00:00
output CO;
input [3:0] in1;
input [3:0] in0;
2022-04-12 14:26:39 +00:00
input clk,load,clr,en,upd,clk_50m;
2022-04-12 08:39:06 +00:00
2022-04-12 09:25:52 +00:00
//分频器
2022-04-12 09:03:50 +00:00
output subclk;
jyh_4490_4_divider D1(
2022-04-12 14:26:39 +00:00
.clk(clk_50m),
2022-04-12 09:03:50 +00:00
.clk_out(subclk)
);
2022-04-12 08:39:06 +00:00
//个位计数器
2022-04-12 09:03:50 +00:00
jyh_4490_4_counter C1(
2022-04-12 08:39:06 +00:00
.Q(out0),
2022-04-12 14:26:39 +00:00
.clk(clk),
2022-04-12 08:39:06 +00:00
.co(CO),
.clr(clr),
.load(load),
.in(in0),
.en(en),
.upd(upd));
//十位计数器
2022-04-12 09:03:50 +00:00
jyh_4490_4_counter C2(
2022-04-12 08:39:06 +00:00
.Q(out1),
2022-04-12 14:26:39 +00:00
.clk(CO||(load && clk)),
2022-04-12 08:39:06 +00:00
.clr(clr),
2022-04-12 14:26:39 +00:00
.in(in1),
2022-04-12 08:39:06 +00:00
.load(load),
.en(en),
.upd(upd));
//四位数码管译码器
2022-04-12 09:03:50 +00:00
jyh_4490_4_encoder E1(
2022-04-12 08:39:06 +00:00
.codeout(code),
.d1(out0),
2022-04-12 09:03:50 +00:00
.d2(out1),
2022-04-12 14:26:39 +00:00
.clk(subclk),
.sel(seg[3:0])
2022-04-12 08:39:06 +00:00
);
endmodule