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/v3/jyh_4490_3_entry.v

63 lines
1 KiB
Coq
Raw Permalink Normal View History

2022-04-05 09:29:39 +00:00
module jyh_4490_3_entry(out1, out0, code, sel, CO,
// 十位输出 个位输出 数码管型码 数码管位码 /借位标志位
2022-04-12 08:38:43 +00:00
in1, in0, load, clk, clr, en, upd);
// 十位装载 个位装载 装载信号 计数时钟信号 清零信号 使能信号 正反计数标志位
output [3:0] out1;
output [3:0] out0;
output [6:0] code;
2022-04-09 13:38:47 +00:00
output [7:0] sel;
output CO;
input [3:0] in1;
input [3:0] in0;
2022-04-12 08:38:43 +00:00
input clk,load,clr,en,upd;
2022-04-09 13:38:47 +00:00
2022-04-12 08:38:43 +00:00
//wire subclk;
//jyh_4490_3_divide(
//.clkin(clk),
//.clkout(subclk)
//);
2022-04-09 13:38:47 +00:00
//个位计数器
jyh_4490_3_counter c0(
.Q(out0),
.clk(clk),
.co(CO),
.clr(clr),
.load(load),
.in(in0),
.en(en),
.upd(upd));
//十位计数器
jyh_4490_3_counter c1(
.Q(out1),
2022-04-09 13:38:47 +00:00
.clk(CO||load),
.clr(clr),
.load(load),
.in(in1),
.en(en),
.upd(upd));
2022-04-09 13:38:47 +00:00
2022-04-05 09:15:28 +00:00
//四位数码管译码器
2022-04-12 08:38:43 +00:00
//jyh_4490_3_encoder e1(
//.codeout(code),
//.d1(out0),
//.d2(out1),
//.clk(clk),
//.sel(sel[1:0])
//);
jyh_4490_3_simpleEncoder(
.codeout(code),
2022-04-05 09:15:28 +00:00
.d1(out0),
2022-04-12 08:38:43 +00:00
.clk(clk),
.sel(sel[0:0])
);
endmodule