Verilog code
1、计数,用于对精度不高的计数
- always @(posedge clk or negedge rst_n)
- begin
- if(!rst_n)
- div_cnt <= 'd0;
- else
- div_cnt <= div_cnt + 'b1;
- end
- assign div_clk = div_cnt[]; //div_cnt < 100
2、检测边沿
- //--------------------------------
- //Funtion : detect start pos
- always @(posedge clk or negedge rst_n)
- begin
- if(!rst_n)
- pos_arr <= 'd0;
- else
- pos_arr <= {pos_arr[:] ,estart };
- end
- assign start = pos_arr[] & ~pos_arr[]
3、声明的不同最好在注释上面体现出来,而不是在变量名
- //localparam BAUD_END = 5207 ; //9600bps
- localparam BAUD_END = ; //115200bps
4、组合数据,少使用了寄存器资源
- always @(posedge clk_24m or negedge rst_n)
- begin
- if(!rst_n)
- ov7670_data_out <= 'd0;
- else if(cnt_byte == 'b1)
- ov7670_data_out <= {ov7670_data_out[:] , ov7670_data};
- else
- ov7670_data_out <= {ov7670_data , 'd0};
- end
。。。。待续
Verilog code的更多相关文章
- CIC 抽取滤波器 Verilog Code
采用流水线结构的CIC 抽取滤波器结构如下: // 三级CIC抽取器实例:cic3_decimator.V module cic3_decimator(clk, x_in, y_out); param ...
- Verilog Tips and Interview Questions
Verilog Interiew Quetions Collection : What is the difference between $display and $monitor and $wr ...
- verilog流水线加法器
四位加法器 两级加法实现 verilog code module pipeliningadder( output reg [3:0] s, output reg co, input [3:0] a, ...
- verilog 实现加法器
半加器 如果不考虑来自低位的进位将两个1二进制数相加,称为半加. 实现半加运算的逻辑电路称为半加器. 真值表 逻辑表达式和 \begin{align}\notag s = a{b}' + {a}'b ...
- verilog FAQ(zz)
1. What is the race condition in verilog? Ans :The situation when two expressions are allowed to exe ...
- 基于脚本的modelsim自动化仿真笔记
这里记录一下基于脚本的modelsim自动化仿真的一些知识和模板,以后忘记了可以到这里查找.转载请标明出处:http://www.cnblogs.com/IClearner/ . 一.基本介绍 这里介 ...
- $clog2(转)
(转http://www.xilinx.com/support/answers/44586.html) 13.2 Verilog $clog2 function implemented imprope ...
- dda的fpga实现(转载)
The general approach using DDAs will be to simulate a system of first-order differential equations, ...
- 推荐 的FPGA设计经验(4) 时钟和寄存器控制架构特性使用
Use Clock and Register-Control Architectural Features FPGAs provide device-wide clocks and register ...
随机推荐
- Android开发过程中使用弱引用解决内存泄露的习惯
Java虽然有垃圾回收,但是仍然存在内存泄露,比如静态变量.缓存或其他长生命周期的对象引用了其他对象,这些被引用的对象就会长期不能被GC释放,导致内存泄露. 弱引用(WeakReference)是解决 ...
- 可靠的、可扩展的、可维护的数据系统 ------《Designing Data-Intensive Applications》读书笔记1
坦白说也是机缘巧合,在硕士生阶段进入分布式系统领域学习.无论是大规模存储或计算,其核心也是运用分布式技术利用并行性来解决数据密集型应用的需求.最近开始在啃这本<Designing Data-In ...
- HITCON-Training-master 部分 Writeup(12月11更新)
HITCON-Training-master Writeup 0x01.lab3 首先checksec一下,发现连NX保护都没开,结合题目提示ret2sc,确定可以使用shellcode得到权限. I ...
- Akka(42): Http:身份验证 - authentication, autorization and use of raw headers
当我们把Akka-http作为数据库数据交换工具时,数据是以Source[ROW,_]形式存放在Entity里的.很多时候除数据之外我们可能需要进行一些附加的信息传递如对数据的具体处理方式等.我们可以 ...
- PHP运算符优先级 运算符分类
运算符 运算符是可以通过给出的一或多个值(用编程行话来说,表达式)来产生另一个值(因而整个结构成为一个表达式)的东西. 运算符可按照其能接受几个值来分组.一元运算符只能接受一个值,例如 !(逻辑取反运 ...
- WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
在 mkfs.ext4 /dev/sda2 格式化硬盘空间时,可能出现这种错误. had this situation at office where I was told to re-partiti ...
- EularProject 43: 带条件约束的排列组合挑选问题
Sub-string divisibility Problem 43 The number, 1406357289, is a 0 to 9 pandigital number because it ...
- canvas图形函数
function drawStar(cobj,x, y, radius1, radius2, num, drawType, color) {//参数:画笔,圆心X.圆心Y,半径1,半径2,形状边,实心 ...
- Druid数据库连接池源码分析
上一篇文章重点介绍了一下Java的Future模式,最后意淫了一个数据库连接池的场景.本想通过Future模式来防止,当多个线程同时获取数据库连接时各自都生成一个,造成资源浪费.但是忽略了一个根本的功 ...
- Spring MVC如何测试Controller(使用springmvc mock测试)
在springmvc中一般的测试用例都是测试service层,今天我来演示下如何使用springmvc mock直接测试controller层代码. 1.什么是mock测试? mock测试就是在测试过 ...