- 2
- 0
- 约1.39万字
- 约 15页
- 2019-06-24 发布于河北
- 举报
实验8:动态扫描实验
实验8:动态扫描实验:
用4个按键分别代表加、减、暂停、复位,四位数码管代表四位十进制数,从0000开始到9999循环,自动计数,数据显示时间不大于1秒。
module dongtaisaomiao(sys_sclk, kadd,kcut,kstop,krest,sels,seg);
input sys_sclk,kadd,kcut,kstop,krest;
output reg[2:0] sels;
output reg[6:0] seg;
reg [1:0] sels0;
reg [15:0] data;
reg clk1hz;
reg clk;
reg [3:0] disdata;
reg [30:0] count; reg [30:0] count1;
reg key1, key2, key3,key4;
always @(posedge sys_sclk)
begin
if(count= begin count=0; clk1hz =~ clk1hz ;end
else count= count+1;
end
always @(posedge sys_sclk)
begin
if(count1==100000) begin count1=0; clk =~ clk ;end
else count1= count1+1;
end
a
原创力文档

文档评论(0)