Title:Count clock
Create a set of counters suitable for use as a 12-hour clock (with am/pm indicator). Your counters are clocked by a fast-running clk, with a pulse on ena whenever your clock should increment (i.e., once per second).
reset resets the clock to 12:00 AM. pm is 0 for AM and 1 for PM. hh, mm, and ss are two BCD (Binary-Coded Decimal) digits each for hours (01-12), minutes (00-59), and seconds (00-59). Reset has higher priority than enable, and can occur even when not enabled.
The following timing diagram shows the rollover behaviour from 11:59:59 AM to 12:00:00 PM and the synchronous reset and enable behaviour.
题目的意思就是创建一个十二小时的时钟,2位BCD码(8位宽)hh、mm、ss分别表示时分秒,pm则表示上午、下午(当pm=0便是上午,pm=1表示下午),然后同步复位reset=1’b1使能,将时钟重置为12:00:00,同时使能位ena=1’b1表示时钟的运行,而且reset优先级大于ena。
时序图如下:
Module Declaration
module top_module(
用Verilog实现12_hour_clock(HDLbits的Count clock题)
于 2022-05-11 22:40:46 首次发布