Verilog HDL 学习笔记2-blocking and non-blocking assignment

本文介绍了Verilog HDL中blocking和non-blocking assignment的区别和使用,强调了在时序电路建模时使用非阻塞赋值、组合逻辑建模时使用阻塞赋值的原则,并提供了理解和避免冒险竞争现象的8个要点。通过理解仿真器的时间步(time step)处理,阐述了阻塞和非阻塞赋值的执行顺序,建议在编写状态机时将组合逻辑和时序逻辑分离到不同的always块中。
摘要由CSDN通过智能技术生成

2013年5月6日 10:42:38

Verilog HDL 学习笔记2-blocking and non-blocking assignment

---学习贵在总结,将学习的心得体会记录

  在学习verilog的过程中,碰到的第一块绊脚石就是data type中wire 和reg的使用,第二块就是blocking 和non-blocking assignment 的区别和使用。现将学习过程中的疑惑和自己的理解总结。

  照惯例,还是先将官方说明贴出来,verilog 2001关于blocking and non-blocking assignment 表述如下:

blocking assignment :A blocking procedural assignment statement shall be executed before the execution of the statements that follow it in a sequential block (see 9.8.1). A blocking procedural assignment statement shall not prevent the execution of statements that follow it in a parallel block (see 9.8.2).

这表明的是:在顺序块中(begin end)中,阻塞过程赋值语句会阻塞其后语句的执行。也就是说,在前面的语句执行完之前,后面的语句是不能被执行的。但是在并行块中不会阻塞(fork join 语句,一般用不到)

non-blocking  assignment :The non blocking procedural assignment allows assignment scheduling without blocking the procedural flow. The non blocking procedural assignment statement can be used whenever several variable assignments within the same time step can be made without regard to order or dependence upon each other.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值