电子表verilog

本文详细介绍了如何使用Verilog硬件描述语言设计并实现一个电子表的功能,包括时间显示、定时器设置等模块,同时探讨了时序逻辑和组合逻辑在设计中的应用。
摘要由CSDN通过智能技术生成
  1 //电子表的设计包括正常计时模块,LED显示模块,定时报警模块,校时模块,秒表模块。
  2 //(1)正常计时模块clock
  3 module clock(clk,rst,clock_en,second,minute,hour);
  4 input clk,rst,clock_en;
  5 output[5:0]second,minute,hour;
  6 reg[5:0]second,minute,hour;
  7 always@(posedge clk or negedge rst or posedge clock_en)
  8 if(!rst)
  9 begin
 10 second<=0;  minute<=0;  hour<=0;
 11 end
 12 else if(clock_en)
 13 begin
 14 if(second==59)
 15    begin
 16    minute<=minute+1;
 17    second<=0;
 18    end
 19 else if(minute==59)
 20    begin
 21    hour<=hour+1;
 22    minute<=0;
 23     end
 24 else if(hour==23)
 25    hour<=0;
 26 else
 27 second<=second+1;
 28 end
 29 endmodule
30 //(2)LED显示模块LED_display 31 module LED_display(data,high,low); 32 input[5:0]data; 33 output[7:0]high,low; 34 reg[7:0]high,low; 35 reg[3:0]out_h,out_l; 36 always@(data) 37 begin 38 out_h<=data/10; 39 out_l<=data; 40 end 41 always@(out_l) 42 case(out_l) 43 4'b0000:low<=8'b00000000; 44 4'b0001:low<=8'b01100000; 45 4'b0010:low<=8'b11011010; 46 4'b0011:low<=8'b11110010; 47 4'b0100:low<=8'b01100110; 48 4'b0101:low<=8'b10110110; 49 4'b0110:low<=8'b10111110; 50 4'b0111:low<=8'b11100000; 51 4'b1000:low<=8'b11111110; 52 4'b1001:low<=8'b11110110; 53 default:low<=8'b00000000; 54 endcase 55 56 always@(out_h) 57 case(out_h) 58 4'b0000:high<=8'b00000000; 59 4'b0001:high<=8'b01100000; 60 4'b0010:high<=8'b11011010; 61
摘 要:Verilog是广泛应用的硬件描述语言,可以用在硬件设计流程的建模、综合和模拟等多个阶段。随着硬件设计规模的不断扩大,应用硬件描述语言进行描述的CPLD结构,成为设计专用集成电路和其他集成电路的主流。通过应用Verilog HDL对多功能电子钟的设计,达到对Verilog HDL的理解,同时对CPLD器件进行简要了解。 本文的研究内容包括: 对Altera公司Flex 10K系列的EPF10K 10简要介绍,Altera公司软件Max+plusⅡ简要介绍和应用Verilog HDL对多功能电子钟进行设计。 关键词:多功能电子钟;硬件描述语言 Abstract:Verilog is the most widely used hardware description language.It can be used to the modeling, synthesis, and simulation stages of the hardware system design flow. With the scale of hardware design continually enlarging, describing the CPLD with HDL become the mainstream of designing ASIC and other IC.To comprehend Verilog HDL and get some knowledge of CPLD device, we design a block with several functions with Verilog HDL. This thesis is about to discuss the above there aspects: Introduce the EPF10K 10 of Flex 10K series producted by Altera Corporation simply. the software Max+plusⅡ,Design the block with several functions with Verilog HDL. Keywords: block with several functions; hardware description language ******************************************* 目  录 1 引言 2 1.1课题的背景、目的 2 1.2 课题设计环境 2 2 EPF10K 10相关说明及VERILOG HDL简介 2 2.1 EPF10K 10相关说明 2 2.2 VERILOG HDL硬件描述语言简介 4 3应用VERILOG HDL描述的多功能电子钟 5 3.1功能描述 5 3.2 源程序 6 3.3模块仿真 13 4 应用VERILOG HDL描述的多功能电子钟功能模块及仿真 15 4.1 计时模块 15 4.2 闹铃设置模块 17 4.3 校时模块 19 4.4 秒表功能模块 22 4.5 整点报时模块 25 4.6 闹铃屏蔽及响铃功能 27 4.7 秒表提示铃声功能 28 5结束语 30 6致谢 30 参考文献 31
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值