Verilog (一) assignment

Verilog

case-sensitive, all keywords are lowercase

1  continuous assignment

assign  data_left  =  data_right;  // right drive left(net)

例 1)  mux

assign  data_out  =  select ? data_in1 : data_in0;

2  procedural assignment

1)  blocking ("=")

execute sequential

2)  nonblocking ("<=")

read (right)  -> schedule (left) ->  execute (<=)

例 2)  synchronizer

reg  [1:0]  data_sync;

always @ (posedge clk or posedge rst)
begin
  if (rst)
        data_sync  <=  2‘b00;
  else
        data_sync  <= {data_sync[0], data_in};
end

assign  data_out  =  data_sync[1];

synchronizer

synchronizer

时间: 2024-08-28 13:57:10

Verilog (一) assignment的相关文章

Quartus II 中 Verilog 常见警告/错误汇总

Verilog 常见错误汇总 1.Found clock-sensitive change during active clock edge at time <time> on register "<name>" 原因:vector source file中时钟敏感信号(如:数据,允许端,清零,同步加载等)在时钟的边缘同时变化.而时钟敏感信号是不能在时钟边沿变化的.其后果为导致结果不正确. 措施:编辑vector source file 2.Verilog HD

蛋疼的 qii 神马警告才是需要注意的警告?(由于警告引起的截然不同的运行结果)

移植了一份程序,之前工程是Cyclone II 后来换成 Cyclone IV E EP4CE10E22C8 用到的资源:pll,sdram,vga 移植办法: 1.更改工程配置,重新选择ic 2.重新分配管脚 3.编译下载至目标板 4.运行ok 以下是这个项目的一些重要信息 再看看警告 如此蛋疼的警告,虽然28个但是确实不影响使用 再看看运行结果,确实不错,没有问题,唯一的问题,就是需要多次复位才能正常 再看看这一堆蛋疼的垃圾文件,都是无用,看着让人心烦.果断删除 删除后结果 重新编译:发现有

verilog behavioral modeling--procedural continous assignment(不用)

assign / deassgin force /release the procedural continuous assignments(using keywords assign and force) are procedural statements that allow expressions to be driven continously onto variables or nets. 1. net_lvalue = expression  in force statement n

Verilog 基础回顾 (一)

Verilog 大小写敏感, 且所有关键字都是小写 1  寄存器 register = storage,是数据存储单元的抽象,可视为能够存储数值的变量 (variable that can hold value) 关键字 reg; 缺省值 x; 2  网络连接 net = connection, 表示寄存器之间的连接,只能采用连续赋值 (must be driven continuously) 关键字 wire; 缺省值 z; 例 1)  D 触发器 (同步复位) module dff(clk,

Verilog之delay的两种用法(inter/intra)

verilog语言中有两种延迟方式:inter-delay和intra-delay,关于inter和intra.这两个英文前缀都有“内部,之间”的意思,但又有所不同.inter表达不同事物之间,intra表达同类事物之间,两者具体的含义请细细体会:).以阻塞式赋值为例(block assignment): 1.inter-delay的表达式为:  #delay-value a=b+c: 先说说阻塞式赋值语句执行的一般过程: block assignment方程的RHS先估值(evaluation

Verilog Tips and Interview Questions

Verilog Interiew Quetions Collection :  What is the difference between $display and $monitor and $write and $strobe? What is the difference between code-compiled simulator and normal simulator? What is the difference between wire and reg? What is the

Verilog 之 LFSR伪随机数 (转载)

转载:http://blog.csdn.net/hengzo/article/details/49689725 The linear feedback shift register is implemented as a series of Flip-Flops inside of an FPGA that are wired together as a shift register. Several taps off of the shift register chain are used a

verilog 2001中的一些新语法

比较有用的:1,generate语句,但需注意,generate-for中变量范围是已知的确定值, generate-case,generate-if语句中变量都必须是固定的, generate必须跟endgenerate 中间begin加块名. 2,算术左移右移 3,有符号数,其实就是两个变量位宽不一致做运算的时候,低位宽的补齐位宽的方式与以前发生了变化,原来是用零补齐,现在看最高位如果是1就以1补齐,如果是0,就以0补齐. 4,多维向量,并且可以取向量的任意一位. 1.Verilog-200

基于UVM的verilog验证

Abstract 本文介绍UVM框架,并以crc7为例进行UVM的验证,最后指出常见的UVM验证开发有哪些坑,以及怎么避免. Introduction 本例使用环境:ModelSim 10.2c,UVM-1.1d,Quartus II 13.1(64 bit),器件库MAX V 1. UVM介绍 对UVM结构熟悉的读者可跳过本节. 叫UVM“框架”可能并不确切(只是便于理解,可类比软件界的“框架”).UVM全称为通用验证方法论.在硬件开发过程中,验证是十分重要的环节.可以说,左手开发,右手验证.