项目场景:
From a 1000 Hz clock, derive a 1 Hz signal, called OneHertz, that could be used to drive an Enable signal for a set of hour/minute/second counters to create a digital wall clock. Since we want the clock to count once per second, the OneHertz signal must be asserted for exactly one cycle each second. Build the frequency divider using modulo-10 (BCD) counters and as few other gates as possible. Also output the enable signals from each of the BCD counters you use (c_enable[0] for the fastest counter, c_enable[2] for the slowest).
The following BCD counter is provided for you. Enable must be high for the counter to run. Reset is synchronous and set high to force the counter to zero. All counters in your circuit must directly use the same 1000 Hz signal.
module bcdcount (
input clk,
input reset,
input enable,
output reg [3:0] Q
);`---
问题描述
从一个1000hz的时钟,派生一个1hz的信号,称为OneHertz,它可以用于驱动一组小时/分钟/秒计数器的Enable信号,以创建一个数字挂钟。因为我们希望时钟每秒计算一次,所以OneHertz信号必须每秒精确地断言一个周期。使用模10 (BCD)计数器和尽可能少的其他门来构建分频器。还要从您使用的每个BCD计数器输出启用信号(c_enable[0]用于最快的计数器,c_enable[2]用于最慢的计数器)。
以下BCD计数器为您提供。Enable值必须高,计数器才能运行。复位是同步的,设置高可以强制计数器归零。电路中的所有计数器必须直接使用相同的1000hz信号。
原因分析:
(c_enable[0]用于最快的计数器,c_enable[2]用于最慢的计数器)表明c_enable[0]是秒计数器的使能信号,c_enable[1]是分钟计数器的使能信号,c_enable[2]是小时计数器的使能信号。但大家请注意题目Counter1000,别被前面误导。其实就是一个个位到十位再到百位的进位而已。
注意事项:
always@()里面的敏感变量为,意思是说敏感变量由综合器根据always里面的输入变量自动添加,也就是所有变量都是敏感列表,不用自己考虑。一般always@(*)是指里面的语句是组合逻辑的。*代替了敏感变量。而always@(posedge clk)为时序逻辑,在考虑逻辑运算的同时还要考虑延时。
参考信息:
1.always@后面内容是敏感变量,always@()里面的敏感变量为,意思是说敏感变量由综合

本文介绍如何从1kHz时钟信号派生出精确的1Hz信号,用于驱动数字时钟的小时、分钟和秒计数器。通过使用模10 BCD计数器和必要的逻辑门实现这一目标,同时确保所有计数器都直接使用相同的1kHz输入信号。
最低0.47元/天 解锁文章
392

被折叠的 条评论
为什么被折叠?



