




已阅读5页,还剩1页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
作品功能如下:1、倒计时秒表具有置数功能,在相应按键作用下,可将倒计时的初始值设置在09999.999范围内,计到0时自动停止。2、秒表计时范围09999.999秒,精度到ms。3、LCD实时显示秒表计时值。4、系统时钟采用实验板上提供的50MHz时钟信号源。5、设计成同步电路模式。模块一:分频(1ms)参见文件夹中的cout_1ms.v)module cout_1ms(clk,rst,clock);input rst,clk;output clock;reg clock;integer i;always (posedge clk or negedge rst) beginif(rst) clock=0;elsebegin i=i+1; if(i=12500) begin clock=clock; i=1; endendendendmodule 模块二:置数按键控制(参见文件夹中的ce.v)module ce(set,seth,dain,outcome1,outcome2,outcome3,outcome4,outcome5,outcome6,outcome7);input set,seth;input4:1 dain;output4:1 outcome1=9,outcome2=9,outcome3=9,outcome4=9,outcome5=9,outcome6=9,outcome7=9;reg4:1 outcome1,outcome2,outcome3,outcome4,outcome5,outcome6,outcome7;integer i=1,j=1; always(posedge set)if(seth)begincasez(i)1:outcome1=dain;2:outcome2=dain;3:outcome3=dain;4:outcome4=dain;5:outcome5=dain;6:outcome6=dain;7:outcome7=dain;endcasei=i+1;if(i=7)i=1;endelse i=1;endmodule set的第一个脉冲对第七个9置数,通过拨码置数,可调范围09.set的第二个脉冲对第六个9置数,通过拨码置数,可调范围09.set的第三个脉冲对第五个9置数,通过拨码置数,可调范围09.set的第四个脉冲对第四个9置数,通过拨码置数,可调范围09.set的第五个脉冲对第三个9置数,通过拨码置数,可调范围09.set的第六个脉冲对第二个9置数,通过拨码置数,可调范围09.set的第七个脉冲对第一个9置数,通过拨码置数,可调范围09.模块三:实现99999990的倒计数(参见文件夹中的counter_8gate.v)module counter_8gate(clk,rst,seth,en,stop,data1,data2,data3,data4,data5,data6,data7,outcome1,outcome2,outcome3,outcome4,outcome5,outcome6,outcome7);input clk,rst,en,stop,seth;input4:1 data1,data2,data3,data4,data5,data6,data7;output4:1 outcome1=9,outcome2=9,outcome3=9,outcome4=9,outcome5=9,outcome6=9,outcome7=9;reg4:1 outcome1,outcome2,outcome3,outcome4,outcome5,outcome6,outcome7;integer i=1,j=1; reg1:0 key_reg;wire key_en;assign key_en=key_reg0 & key_reg1;always (posedge clk or negedge rst)if(rst) key_reg=2b00;else key_reg1) begin outcome1=outcome1-1; j=2; if(outcome1=4b1111) begin outcome2=outcome2-1; outcome1=9; if(outcome2=4b1111) begin outcome3=outcome3-1; outcome2=9; if(outcome3=4b1111) begin outcome4=outcome4-1; outcome3=9; if(outcome4=4b1111) begin outcome5=outcome5-1; outcome1=4; if(outcome5=4b1111) begin outcome6=outcome6-1; outcome5=9; if(outcome6=4b1111) begin outcome7=outcome7-1; outcome6=9; if(outcome7=4b1111) outcome7=9; end end end end end end end else if(seth) begin outcome1=data1; outcome2=data2; outcome3=data3; outcome4=data4; outcome5=data5; outcome6=data6; outcome7=data7; endendalways(negedge stop)beginoutcome1=outcome1;outcome2=outcome2;outcome3=outcome3;outcome4=outcome4;outcome5=outcome5;outcom
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025金华义乌市属国有企业4月招聘78人模拟试卷及答案详解(考点梳理)
- 2025包头白云鄂博矿区就业困难人员公益性岗位招聘考前自测高频考点模拟试题完整参考答案详解
- 2025年4月四川成都体育学院考核招聘编制内辅导员9人考前自测高频考点模拟试题附答案详解(典型题)
- 2025湖南长沙宁乡市中医医院公开招聘编外聘用人员20人考前自测高频考点模拟试题有答案详解
- 2025湖南省怀化学院高层次人才公开招聘100人考前自测高频考点模拟试题有答案详解
- 2025广东省蕉岭县招聘卫生类急需紧缺人才5人考前自测高频考点模拟试题及参考答案详解一套
- 2025江苏大学附属医院招聘编外工作人员15人(二)模拟试卷及完整答案详解
- 2025年上海新上铁实业发展集团有限公司合肥分公司招聘1人考前自测高频考点模拟试题及答案详解(名校卷)
- 2025贵州安顺市平坝区社会保险事业局招聘公益性岗位人员2人考前自测高频考点模拟试题及答案详解(新)
- 2025金华市技师学院公开招聘高层次人才2人考前自测高频考点模拟试题附答案详解(突破训练)
- 《高龄卧床高危静脉血栓栓塞症防治中国专家共识》解读
- 高一上学期《早读是需要激情的!》主题班会课件
- 顶板在线监测管理制度
- 我国公务员制度中存在的问题及对策
- 智能无人船在水下地形测量中的应用
- 《小狗钱钱》完整版
- 《酒类鉴赏威士忌》课件
- 各种奶茶配方资料
- 八年级语文下册-专题08-语言表达与运用-(中考真题演练)(原卷版)
- 《机械制图识图培训》课件
- 物流班组长年终总结
评论
0/150
提交评论