You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
983 B
Coq
42 lines
983 B
Coq
5 months ago
|
module clock_circuit(
|
||
|
input sys_clk ,
|
||
|
input sys_rst_n ,
|
||
|
input [3: 0] opcode ,
|
||
|
input [3: 0] data ,
|
||
|
input [1: 0] dev_id ,//设备地址
|
||
|
|
||
|
output [7: 0] seg_led ,
|
||
|
output [5: 0] sel_led
|
||
|
);
|
||
|
wire [4: 0] hour;
|
||
|
wire [5: 0] min ;
|
||
|
wire [5: 0] sec ;
|
||
|
|
||
|
timer timer_inst(
|
||
|
.sys_clk (sys_clk),
|
||
|
.sys_rst_n (sys_rst_n),
|
||
|
.dev_id (dev_id),
|
||
|
.opcode (opcode),
|
||
|
|
||
|
.hour (hour),
|
||
|
.min (min),
|
||
|
.sec (sec)
|
||
|
);
|
||
|
|
||
|
timer_decoder timer_decoder_inst(
|
||
|
.sys_clk (sys_clk),
|
||
|
.sys_rst_n (sys_rst_n),
|
||
|
.hour (hour),
|
||
|
.min (min),
|
||
|
.sec (sec),
|
||
|
.dev_id (dev_id),
|
||
|
.opcode (opcode),
|
||
|
|
||
|
.seg_led (seg_led),
|
||
|
.sel_led (sel_led)
|
||
|
);
|
||
|
|
||
|
// defparam timer_inst.MAX = 5;//5 * 20 = 100ns
|
||
|
// defparam timer_inst.DAY = 864;//864 * 100 = 86400ns;
|
||
|
// defparam timer_decoder_inst.FPS = 10;//200ns;
|
||
|
endmodule
|