当前位置:网站首页>Operator, assignment statement, structure description statement
Operator, assignment statement, structure description statement
2022-07-19 03:42:00 【Small diamond wind on Shituo mountain】
Logical operators
An operator (& | ~)
Logical operators (&& || !)
Relational operator
< > <= >=
Equality operators
==( be equal to ) !=( It's not equal to ) ===( be equal to ) !==( It's not equal to )
Reverse sign 、 Double equal sign 、 There must be no space between the three equal signs .
=== When operating , Compare the indefinite value and high resistance value of some bits , Only when it is exactly the same, the result is 1(1、1,0、0,x、x,z、z) Commonly used in case The discrimination of expression
== When operating , At least one x、z when , The result is x
Shift Operators
Move left n position a<<n Move right n position a>>n
Note that the operand is on the left ,n How many positions does the representative move , The vacated space is used 0 fill
Bit concatenation operator
Some bits of two or more signals are spliced together for operation , Signals without specified digits are not allowed in expressions
{a,b[3:0],4{w}} // When repeating an expression , Must be preceded by a constant expression
Reduction operator
Monocular operator , There are also and or not . It is an and or non recursive operation on a single operand , The final result is 1 The binary number of bits .
reg [3:0] B;
reg C;
C=&B; // Be similar to C=((B[0]&B[1])&B[2])&B[3]
Operator precedence

Assignment statements and block statements
Nonblocking assignment (b<=a)
- In the block , The assignment of the above statement cannot be immediately used by the following statement
- The assignment operation can be completed only after the end of the block , And the assigned variable value is obtained from the last assignment
- When writing integrable sequential logic modules , Is the most commonly used assignment method
In a serial statement , There is no priority for non blocking assignment statements , The first one will not affect the execution of the following statements , Each statement is executed in parallel ; Executing a non blocking assignment statement will first calculate the value of the right-hand expression , Then wait for the delay time to end , Then assign the calculated value to the variable on the left .
Block assignment (b=a )
- After the execution of the assignment statement , That's the end of it
- b The value of is changed immediately after the assignment statement is executed
- Using it in temporal logic will produce unexpected results
In a serial statement , Blocking assignment statements will be executed in order ; Each blocking assignment statement in the parallel statement is executed at the same time ; Blocking assignment evaluates the expression to the right of the equal sign , Then assign it to the left immediately
/* Nonblocking assignment can be seen as two steps , The first step is to calculate the value on the right , Update to the left after completion */
[email protected](posedge clk)
begin
b<=a;
c<=b; //c Original b value
end
Block statement
Combine multiple statements together , Make it look more like a statement in format .
Sequential block
begin_end, Identify statements executed sequentially .
- The statements in the block are executed sequentially
- The delay time of each statement is relative to the simulation time of the previous statement
- Until the last statement is executed , Program flow control just jumps out of the statement block
-> end_wave //-> Indicates trigger event end_wave Turn it over
begin: Block name // Block name , An identification name ,
In block declaration statements // Such as parameter declaration statement 、reg Type variables declare variables 、real Type variable declaration
sentence 1;
sentence 2;
sentence n;
endParallel blocks
fork_join, Identify statements executed in parallel .
- Block statements are executed at the same time
- The delay time of each statement in the block is relative to the simulation time when the program flow control enters the block
- Delay time is used to provide execution timing for assignment statements
- When sorted in chronological order after the last statement is executed or after a disable Statement execution , Program flow control jumps out of the program block
An in block declaration statement can be a parameter description statement 、reg、integer、real、time Type variable declaration statements and events (event) Statement of explanation .
Block name
- You can define local variables within a block
- You can allow blocks to be called by other statements , Such as disable
- Verilog All variables in are static , That is, all variables have only one unique storage address , So entering or leaving a block does not affect the value stored in the variable
( The block name provides a way to confirm the value of a variable at any simulation time )
Start time and end time
边栏推荐
- Es6 notes d'étude - station B Xiao Ma Ge
- HRNet
- SparkCore核心设计:RDD,220716,
- 如何将Excel中的数据粘贴到cxGrid中
- Detailed explanation of arrow function and this direction
- ES6 learning notes - brother Ma at station B
- MySQL master-slave setup
- KubeCon + CloudNativeCon Europe 2022
- Receiver operating curve
- 二分查找(leetcode704.很简单必会的)
猜你喜欢

Laravel's problem

一种鲁棒变形卷积神经网络图像去噪

MySQL master-slave setup

Rhce8 Learning Guide Chapter 1 installing rhel8.4
![[C语言勘误]数组长度的函数内获取方式错误](/img/3a/2de171251396ed1ffedf28ab221670.png)
[C语言勘误]数组长度的函数内获取方式错误

SwiftUI 考试题库项目之支持题库和考试题库数量(教程含源码)

Install Net prompt "cannot establish a certificate chain to trust the root authority" (simple method with download address)

How to read and write a single document based on MFC

Thinkphp5.0模型操作使用page进行分页

Analysis and processing of male and female voice signals based on MATLAB
随机推荐
Boston house price analysis assignment summary
通过OpenHarmony兼容性测评,大师兄开发板与丰富教培资源已ready
web语义化(强调标签-em-斜体)(重点强调标签-strong-粗体)(自定义列表:dl、dt、dd)
論文閱讀:U-Net++: Redesigning Skip Connections to Exploit Multiscale Features in Image Segmentation
爬虫学习(5):手把手教你爬虫requests实战演练
Qt OpenGL 通过鼠标和键盘移动三维物体(设置相机)
Unity using Sqlite
Rhce8 Learning Guide Chapter 1 installing rhel8.4
洛谷每日三题之第四天
Zabbix6.0 monitors Dell and IBM server hardware through Idrac and imm2
Gnome boxes virtual machine creation and installation
STM32串口发送和接收多个数据教程基于气体传感器实战
运算符、赋值语句、结构说明语句
KubeCon + CloudNativeCon Europe 2022
Note: light source selection and Application
Leetcode: dynamic programming [basic problem solving]
options has an unknown property ‘before‘
Oracle queries the maximum partition of non self growing partition
模块(block、module)的介绍
2.9.2 Ext JS的数字类型处理及便捷方法