专业编程基础技术教程

网站首页 > 基础教程 正文

verilog实例(五) verilog技巧

ccvgpt 2024-10-31 12:44:32 基础教程 10 ℃

点击蓝字 · 关注我们

本文介绍一些verilog实现的数字电路的实例。如有错误,欢迎指出,感谢。

verilog实例(五) verilog技巧


1

24进制计数器

实验原理:使用两位数码管显示24进制计数器,每次只选择一位位选,然后在1khz-十几khz可以让人眼反应不过来,然后达到每次仿佛显示两位的效果,然后段选是在每个位选选通的时候就送入一个段选即可。

Experimental principle: the use of two digital tube display 24 base counter, each time only select a bit, and then in 1khz-ten KHZ can make the human eye can not react, and then achieve the effect of two display each time.


核心代码:

The core code:


波形:

wave:



2

同步FIFO

实验原理:FIFO分为同步和异步,这里介绍同步,FIFO存储器是系统的缓冲环节,其功能可以概括为对连续的数据流进行缓存,防止在进机和存储操作时丢失数据,数据集中起来进机和存储,可避免频繁的总线操作,减轻CPU的负担。

Experimental principle: FIFO is divided into synchronous and asynchronous, synchronization is introduced here, FIFO memory is the buffer link of the system, its function can be summarized as the continuous data flow cache, prevent the loss of data in the machine and storage operation, data centralized into the machine and storage, can avoid frequent bus operation, reduce the burden of CPU.

核心代码:

The core code:


波形:

wave:



3

UART发送12位数据

实验原理:使用状态机对状态进行切换,使用移位寄存器接收满了8位数据后就重新发送标志位,并重新开始接收。

Use the state machine to switch the state, use the shift register to receive full 8 bits of data on the re-send flag bits, and start receiving again.


核心代码:

The core code:


波形:

wave:



参考资料:

《FPGA/CPLD边学边练》吴厚航著

百度

翻译:谷歌翻译

最近发表
标签列表