电子EDA复习资料(五邑大学)实验.docVIP

  • 181
  • 0
  • 约7.44千字
  • 约 9页
  • 2017-11-13 发布于浙江
  • 举报
一、3-8译码器和模13BCD码计数器 1、功能仿真和时序仿真有何不同?为什么? 答:功能仿真只是考虑了元件的理想功能,时序仿真考虑到实际元件的信号延时、输入/输出时间延时、触发器的建立/保持时间等等 二、数字跑表 图1 模100BCD码计数器原理图 图1 模100BCD码计数器原理图 图3 数字跑表原理框图 1、什么是同步清零和异步清零? 同步清零就是异清零清零端。 二进制计数器:按二进制数运算规律进行计数的电路称作二进制计数器当按下按键时,这个过程都是:接触-断开-接触-断开前面10至20毫秒就是抖动状态,是不稳定状态 软件解决方法是扫描到第一次按键闭合后,延时10毫秒左右再去检测,编一个键盘扫描子程序就行。module fre_ctrl(clk,rst,count_en,count_clr,lpad); input clk,rst;output count_en,count_clr,load;reg count_en,load; always @(posedge clk) begin if(rst) begin count_en=0; load=1;end else begin count_en=~count_en; load=~count_en; end end assign count_clr=~clkload; endmodule 2、count10计数模块 Count10是一个带有计数使能输入端(en)和异步清零端(clr)的模为10的计数模块。当en为高电平时开始计数,为低电平时停止计数。Clr为异步清零端,当它为高电平时,计数器输出为零。6位数字频率计计数子模块用Verilog HDL语言描述如下: module count10(out,cout,en,clr,clk); input en,clr,clk; output[3:0] out; output cout; reg[3:0] out; always @(posedge clk or posedge clr) begin if(clr) out=0; else if(en) begin if(out==9) out=0; else out=out+1; end end assign cout=((out==9)en)?1:0; endmodule 3、24位锁存器模块latch_24用Verilog HDL语言描述如下: module latch_24(qo,din,load); input load;input[15:0] din; output[15:0] q0; reg[15:0] q0; always @(posedge load) begin q0=din; end endmodule 4、数字频率计原理图如下: 1、设计的频率计有测量误差吗?误差是多少?如何减少误差? 答:有测量误差。误差是正负一个周期。可以提高测量时间来减少测量误差。 锁存器锁存信号为什么采用上升沿? 答:因为下降沿不能作为锁存信号。 原理图输入设计方便还是Verilog HDL输入设计方便?为什么? 答:在设计小规模电路时用原理图输入设计方法比较方便,容易理解、设计准确、仿真准 确但在设计规模较大的数字系时,Verilog HDL输入设计显然比较方便。 四、英语字母显示电路 将模16计数器和1个4~7译码器的Verilog HDL语言合而为一的Verilog HDL语言: module count16(clr,clk,a,b,c,d,e,f,g,w); input clr,clk; output a,b,c,d,e,f,g,w; reg[3:0] out; reg a,b,c,d,e,f,g; always @(posedge clk or posedge clr) begin if(clr) out=0; else begin if(out==15) out=0; else out=out+1; end end always @(out) begin case(out) 4d0:{a,b,c,d,e,f,g}=7b1111110; 4d1:{a,b,c,d,e,f,g}=7b0110000; 4d2:{a,b,c,d,e,f,g}=7b1101101; 4d3:{a,b,c,d,e,f,g}=7b1111001; 4d4:{a,b,c,d,e,f,g}=7b0110011; 4d5:{a,b,c,d,e,f,g}=7b1011011; 4d6

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档