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 ...
随机推荐
- shell,bash,zsh,console,terminal到底是什么意思,它们之间又是什么关系?
原文链接 终端(terminal,或者叫物理终端):是一种设备,不是一个程序,一般说的就是能提供命令行用户界面的设备,典型的是屏幕和键盘,或其他的一些物理终端.虚拟终端:屏幕和键盘只是一个终端,可能不 ...
- Linux驱动调试-根据oops的栈信息,确定函数调用过程
上章链接入口: http://www.cnblogs.com/lifexy/p/8006748.html 在上章里,我们分析了oops的PC值在哪个函数出错的,那如何通过栈信息来查看出错函数的整个调用 ...
- 第四届河南省ACM SUBSTRING 字符串处理
SUBSTRING 时间限制: 1 Sec 内存限制: 128 MB 提交: 17 解决: 5 [提交][状态][讨论版] 题目描述 You are given a string input. Y ...
- nginx使用ssl模块配置支持HTTPS访问【解决ssl错误】
默认情况下ssl模块并未被安装,如果要使用该模块则需要在编译nginx时指定–with-http_ssl_module参数. 需求:做一个网站域名为 www.localhost.cn 要求通过http ...
- centOS 搭建pipelineDB docs
#下载docs git clone https://github.com/pipelinedb/docs.git #安装python-sphinx &python-dev yum instal ...
- kubernetes nginx ingress 使用记录
前言 ingress是一种可以暴露k8s集群内部service的方式,用户编辑配置文件定义一个ingress资源即可实现外部网络访问内网service. ingress controller是来管理所 ...
- java web学习笔记 servlet
关于java web web.xml中一般配置的都是与servlet先关的可以配置servlet filter listener context-param用来配置web应用的启动参数,可用通过Ser ...
- UAC
UAC and Security Shield Icon UAC in Wiki User Account Control (UAC) is a technology and security inf ...
- 关于Mac终端故障一直出现 [进程已完毕]
终端已打开就出现以下信息.无法输入不论什么的命令 Last login: Mon Aug 18 10:00:36 on ttys000 [进程已完毕] 原因:不知谁改动了 终端->偏好设置-&g ...
- Oracle中主键、外键、索引、序列、唯一性约束的创建
1.主键的创建 方法一:直接在sql语句中声明字段主键约束 create table table_name (id type[length] constraint pk_name primary ke ...