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. Qwidget布局操作之QGridLayout(网格布局)

    QMainWindow并没有setLayout()函数,因此不能使用setLayout()函数来设置layout,需要使用间接的方法. 需要做的只是先定义一个QWidget对象,然后使用QMainWi ...

  2. MySQL 关于case when结合group by用时的写法举例

    原表是个员工档案,共583人,但case when结合group by用时,写法不同,其出来的结果也不同 例1: select distinct a.Branch,case when kultur = ...

  3. 【git】如何ignore一个文件的更改又保留其初始版本

    参考: https://compiledsuccessfully.dev/git-skip-worktree/ https://stackoverflow.com/questions/9794931/ ...

  4. MySQL高级学习笔记(七):MySql主从复制

    文章目录 复制的基本原理 slave会从master读取binlog来进行数据同步 三步骤+原理图 复制的基本原则 复制的最大问题 一主一从常见配置 mysql版本一致且后台以服务运行(双方能够pin ...

  5. UVA

    A network is composed of N computers connected by N - 1 communication links such that any two comput ...

  6. jmeter beanshell 变量传递

    如果写成这样会报错: ${__BeanShell(${__threadNum}*2,ToatlAmount)}; ${__BeanShell(${__Random(1,99999,)},DayNum) ...

  7. zabbix--External checks 外部命令检测

    概述zabbix server 运行脚本或者二进制文件来执行外部检测,外部检测不需要在被监控端运行任何 agentditem key 语法如下: 参数 定义 script shell 脚本或者二进制文 ...

  8. 第二十五天 慵懒的投射在JDBC上的暖阳 —Hibernate的使用(四)

    版权声明:本文为博主原创文章.未经博主同意不得转载. https://blog.csdn.net/zwszws/article/details/28493209            6月4日.晴天. ...

  9. 判断url

    //判断url地址 isUrl(str){ let reg = /[0-9a-zA-z]+.(html|htm|shtml|jsp|asp|php|com|cn|net|com.cn|org)$/; ...

  10. Spring学习笔记(9)——注入参数

    集合类型属性 1.Set类型 private Set<String> sets=new HashSet<String>(); //我们需要给它添加set方法 public Se ...