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 ...
随机推荐
- Java面向对象编程基础
一.Java面向对象编程基础 1.什么是对象?Object 什么都是对象! 只要是客观存在的具体事物,都是对象(汽车.小强.事件.任务.按钮.字体) 2.为什么需要面向对象? 面向对象能够像分析现实生 ...
- Java快速扫盲指南
文章转自:https://segmentfault.com/a/1190000004817465#articleHeader22 JDK,JRE和 JVM 的区别 JVM:java 虚拟机,负责将编译 ...
- Swarm 如何存储数据?- 每天5分钟玩转 Docker 容器技术(103)
service 的容器副本会 scale up/down,会 failover,会在不同的主机上创建和销毁,这就引出一个问题,如果 service 有要管理的数据,那么这些数据应该如何存放呢? 选项一 ...
- 51Nod--1011最大公约数GCD
1011 最大公约数GCD 基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题 收藏 关注 输入2个正整数A,B,求A与B的最大公约数. Input 2个数A,B,中间用 ...
- 异常处理第三讲,SEH(结构化异常处理),异常展开问题
异常处理第三讲,SEH(结构化异常处理),异常展开问题 作者:IBinary出处:http://www.cnblogs.com/iBinary/版权所有,欢迎保留原文链接进行转载:) 不知道昨天有木有 ...
- EntityFrameworkCore v1.1.1 问题汇总
随着宇宙第一IDE的最新版本发布[2017/3/7],AspNetCore 和EntityFrameworkCore(团队)都发布了最新的代码. 不过在我看来,这些到还不是最重要的.最重要的是dotn ...
- laravel 对查询结果的二次筛选
假设有表Scores 里面有 id,math,english等字段,现在要求按总分(数据库没有这个字段)来排序或者筛选,用having()方法就可以很方便解决这个问题. $scores = Score ...
- vue项目的骨架及常用组件介绍
vue项目基础结构 一个vue的项目,我觉得最小的子集其实就是{vue,vue-router,component},vue作为基础库,为我们提供双向绑定等功能.vue-router连接不同的" ...
- LeetCode139:Word Break
Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separa ...
- 联通假4G欺骗消费者!
之前预约了联通4G升级,官网说从4月18日開始到5月1月生效.4月18日到5月1日之间10010会联系预约用户更改套餐.24号收到联通业务员打来电话,明白告知:联通4G仅仅是套餐是4G的.网络还是3G ...