verilog实例(四)

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

1

vga驱动

实验原理:VGA的显示效果取决于输入的RGB的值,R,G,B的值是通过不同的引脚接入的,逐行扫描是扫描从屏幕左上角一点开始,从左像右逐点扫描,每扫描完一行,电子束回到屏幕的左边下一行的起始位置,在这期间,CRT对电子束进行消隐,每行结束时,用行同步信号进行同步;当扫描完所有的行,形成一帧,用场同步信号进行场同步,并使扫描回到屏幕左上方,同时进行场消隐,开始下一帧。

Experimentalprinciple:VGAdisplayeffectdepsontheinputoftheRGBvalues,R,G,Bvalueisthroughdifferentpinaccess,progressivescanistoscanfromleftuppercornerofthescreen,pointbypointscanning,fromleftasrightaftereachscanline,electronbeambacktotheleftofthescreentothenextlineofthestartingposition,duringthisperiod,theCRTtoblankingofelectronbeam,attheofeachrow,Synchronizationwithlinesynchronizationsignal;Whenalllineshavebeenscanned,aframeisformed,thefieldsyncsignalisusedforfieldsync,andthescanisreturnedtotheupperleftofthescreen,andthefieldblankingisperformedtostartthenextframe.

核心代码:

Thecorecode:

波形:

wave:

2

数据接收端

实验原理:通过三个寄存器来判断上升沿和下降沿,当请求信号的上升沿出现时就开始启动接收数据当检测到下降沿时就接收数据完成,然后发送一个高脉冲给数据的发送端表示数据接收完毕。

Experimentalprinciple:,,thedataisreceived,andthenahighpulseissenttotheserofdatatoindicatethatthedataisreceived.

RTL电路图:

RTLcircuitdiagram:

核心代码:

Thecorecode:

波形:

wave:

3

UART发送12位数据

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

Usethestatemachinetoswitchthestate,usetheshiftregistertoreceivefull8bitsofdataonthere-sflagbits,andstartreceivingagain.

核心代码:

Thecorecode:

波形:

wave:

参考资料:

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

百度

翻译:谷歌翻译

发布于 2024-12-14
161
目录

    推荐阅读