Frm: IEEE Std 1364™-2001, IEEE Standard Verilog® Hardware Description Language

The continuous assignment statement shall place a continuous assignment on a net data type. The net may be explicitly declared, or may inherit an implicit declaration in accordance with the implicit declarations rules defined in 3.5.

Assignments on nets shall be continuous and automatic. This means that whenever an operand in the righthand side expression changes value, the whole right-hand side shall be evaluated and if the new value is different from the previous value, then the new value shall be assigned to the left-hand side.

Example:

Example 1—The following is an example of a continuous assignment to a net that has been previously declared:

wire mynet ;
assign (strong1, pull0) mynet = enable ;

Example 2—The following is an example of the use of a continuous assignment to model a 4-bit adder with carry. The assignment could not be specified directly in the declaration of the nets because it requires a concatenation on the left-hand side.

module adder (sum_out, carry_out, carry_in, ina, inb);
output [:] sum_out;
output carry_out;
input [:] ina, inb;
input carry_in;
wire carry_out, carry_in;
wire [:] sum_out, ina, inb;
assign {carry_out, sum_out} = ina + inb + carry_in;
endmodule

Example 3—The following example describes a module with one 16-bit output bus. It selects between one of four input busses and connects the selected bus to the output bus.

module select_bus(busout, bus0, bus1, bus2, bus3, enable, s);
parameter n = ;
parameter Zee = ’bz;
output [:n] busout;
input [:n] bus0, bus1, bus2, bus3;
input enable;
input [:] s;
tri [:n] data; // net declaration
// net declaration with continuous assignment
tri [:n] busout = enable ? data : Zee;
// assignment statement with four continuous assignments
assign
data = (s == ) ? bus0 : Zee,
data = (s == ) ? bus1 : Zee,
data = (s == ) ? bus2 : Zee,
data = (s == ) ? bus3 : Zee;
endmodule

The following sequence of events is experienced during simulation of this example:

a) The value of s, a bus selector input variable, is checked in the assign statement. Based on the value of s, the net data receives the data from one of the four input buses.

b) The setting of data net triggers the continuous assignment in the net declaration for busout. If enable is set, the contents of data are assigned to busout; if enable is 0, the contents of Zee are assigned to busout.

6.1.2 The continuous assignment statement的更多相关文章

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

    assign / deassgin force /release the procedural continuous assignments(using keywords assign and for ...

  2. verilog FAQ(zz)

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

  3. 9.3.1 The assign and deassign procedural statements

    IEEE Std 1364™-2001, IEEE Standard Verilog® Hardware Description Language The assign procedural cont ...

  4. Verilog (一) assignment, register and net

    Verilog 区分大小写, 且所有关键字都是小写 1  register = storage keyword reg; default x; variable that can hold value ...

  5. 非阻塞赋值(Non-blocking Assignment)是个伪需求

    https://mp.weixin.qq.com/s/mH84421WDGRb7cuU5FEFIQ Verilog的赋值很是复杂,包括: 1. Continuous assignment; 2. Pr ...

  6. Immediate assertion

    Imemdiate assertion可以放在任何procedural statement中, assertion被执行判断,当这个procedural code被执行的时候.其他时间是不会被执行的. ...

  7. Verilog Tips and Interview Questions

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

  8. verilog语法实例学习(4)

    Verilog模块 Verilog中代码描述的电路叫模块,模块具有以下的结构: module module_name[ (portname {, portname})]; //端口列表 [parame ...

  9. R2—《R in Nutshell》 读书笔记(连载)

    R in Nutshell 前言 例子(nutshell包) 本书中的例子包括在nutshell的R包中,使用数据,需加载nutshell包 install.packages("nutshe ...

随机推荐

  1. HDU 6625 three arrays 求两个序列异或最小值的排列(一个可以推广的正解

    目录 题意: 解析 原题描述 字典树动态求Mex @(hdu 6625求两个序列异或最小值的排列) 题意: \(T(100)\)组,每组两个长度为\(n(100000)\)的排列,你可以将\(a[]\ ...

  2. HTML-参考手册: 画布

    ylbtech-HTML-参考手册: 画布 1.返回顶部 1. HTML5 <canvas> 参考手册 描述 HTML5 <canvas> 标签用于绘制图像(通过脚本,通常是 ...

  3. HTML5: HTML5 服务器发送事件(Server-Sent Events)

    ylbtech-HTML5: HTML5 服务器发送事件(Server-Sent Events) 1.返回顶部 1. HTML5 服务器发送事件(Server-Sent Events) HTML5 服 ...

  4. 【消息中间件】kafka

    一.kafka整体架构 kafka是一个发布订阅模式的消息队列,生产者和消费者是多对多的关系,将发送者与接收者真正解耦: 生产者将消息发送到broker: 消费者采用拉(pull)模式订阅并消费消息: ...

  5. java.lang -> Object

    java.lang -> Object 是什么 Object 类是类层次结构的根,是 Java 中唯一一个没有父类的类,Java 中所有对象包括数组都继承了 Object 类中的方法. 重要方法 ...

  6. python操作DB2数据库

    #!/usr/bin/env python# -*- coding:utf-8 -*- ########################## excute python2.7.13# sudo pip ...

  7. CF1239

    然后ZUTTER_打的第一场div1以没敢交题 完!美!结!束!!! A 没有发现性质就找规律海星 我们可以算出一列的贡献:\(g[i][0]\)表示上两个不同,\(g[i][1]\)表示上两个相同就 ...

  8. 在知乎上看到的几个关于C的奇淫技巧

    有一个鲜为人知的运算符叫”趋向于”, 写作“-->”.比如说如果要实现一个倒数的程序,我们可以定义一个变量x,然后让它趋向与0: 输出: 然后我们把 "x-->0" 换 ...

  9. 小程序图片在安卓上拉伸的问题&导航&返回首页

      今天提了一个bug,有几张图片在安卓上面加载会先变大拉伸再恢复正常 出现这样的问题应该是用widthFix造成的 具体原因还不是很清楚,因为都是本地图片,所以我就直接把高也设置好就暂时没有这个问题 ...

  10. tcpdump - 转储网络上的数据流

    总览 (SYNOPSIS) tcpdump [ -adeflnNOpqStvx ] [ -c count ] [ -F file ] [ -i interface ] [ -r file ] [ -s ...