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的更多相关文章

  1. CIC 抽取滤波器 Verilog Code

    采用流水线结构的CIC 抽取滤波器结构如下: // 三级CIC抽取器实例:cic3_decimator.V module cic3_decimator(clk, x_in, y_out); param ...

  2. Verilog Tips and Interview Questions

    Verilog Interiew Quetions Collection :  What is the difference between $display and $monitor and $wr ...

  3. verilog流水线加法器

    四位加法器 两级加法实现 verilog code module pipeliningadder( output reg [3:0] s, output reg co, input [3:0] a, ...

  4. verilog 实现加法器

    半加器 如果不考虑来自低位的进位将两个1二进制数相加,称为半加. 实现半加运算的逻辑电路称为半加器. 真值表 逻辑表达式和 \begin{align}\notag s = a{b}' + {a}'b ...

  5. verilog FAQ(zz)

    1. What is the race condition in verilog? Ans :The situation when two expressions are allowed to exe ...

  6. 基于脚本的modelsim自动化仿真笔记

    这里记录一下基于脚本的modelsim自动化仿真的一些知识和模板,以后忘记了可以到这里查找.转载请标明出处:http://www.cnblogs.com/IClearner/ . 一.基本介绍 这里介 ...

  7. $clog2(转)

    (转http://www.xilinx.com/support/answers/44586.html) 13.2 Verilog $clog2 function implemented imprope ...

  8. dda的fpga实现(转载)

    The general approach using DDAs will be to simulate a system of first-order differential equations, ...

  9. 推荐 的FPGA设计经验(4) 时钟和寄存器控制架构特性使用

    Use Clock and Register-Control Architectural Features FPGAs provide device-wide clocks and register ...

随机推荐

  1. 分享一小坑(与swagger有关),以后碰到了可以快速规避

     ---------------------------------------------------------------------------------踩坑过程:①webapi的某acti ...

  2. iOS 处理socket粘包问题

    1.什么是粘包? 粘包通常出现在TCP的协议里面,对于UDP来说是不会出现粘包状况的,之所以出现这种状况的原因,涉及到一种名为Nagle的算法. Nagle算法通过减少必须发送的封包的数量,提高网络应 ...

  3. pipelineDB初体验

    官网:http://www.pipelinedb.com/ pipelineDB是基于postgres的stream数据库.完全兼容pg的东西. 由于产品需要解决性能这块瓶颈,老大让试试这款基于流计算 ...

  4. 【HNOI2002】营业额统计

    https://www.luogu.org/problem/show?pid=2234 用Treap维护,每次查询这个数的前驱与后继哪个和它差值更小. 由于查询一个数时在Treap走出的路径必定经过它 ...

  5. c++用类写栈和队列的简单基本操作(实验)

    继续更文.这次用类来写栈和队列,都是用数组模拟的: 以下是栈和队列的定义: 然后分别是栈和队列的类: 完整代码贴上: 栈 //使用类来定义栈 class ZHAN { public: STACK s; ...

  6. 怎样将word文件转化为Latex文件:word-to-latex-2.56具体解释

    首先推荐大家读一读这篇博文:http://blog.csdn.net/ibingow/article/details/8613556 --------------------------------- ...

  7. “command line option syntax error,Type command/?for help

    VS2010安装WDT时出现"command line option syntax error.Type command/?for help错误 解决:可能是由于你的安装源文件所在的路径中有 ...

  8. SYSAUX表空间使用率高问题处理

    SYSAUX表空间做为SYSTEM表空间的辅助表空间,主要存放EM相关的内容以及表统计信息,AWR快照,审计信息等,而假设SYSAUX表空间在默认条件下你假设不做不论什么配置,随着时间的推移.会膨胀的 ...

  9. timestamp时间戳的应用(微信小程序开发也一样)

    在微信小程序开发时发现一个timestamp的时间戳的变量 比如获取微信运动步数时候 timestamp是如何形成的在JS中 是这么形成的 var timestamp = Date.parse(new ...

  10. Java项目中使用Redis缓存案例

    缓存的目的是为了提高系统的性能,缓存中的数据主要有两种: 1.热点数据.我们将经常访问到的数据放在缓存中,降低数据库I/O,同时因为缓存的数据的高速查询,加快整个系统的响应速度,也在一定程度上提高并发 ...