当前位置:网站首页>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
边栏推荐
- 367. 有效的完全平方数(入门必会)
- Laravel's problem
- leetcode 222. Number of nodes of a complete binary tree (required)
- 动态管理内存的通讯录实现
- 通过Dao投票STI的销毁,SeekTiger真正做到由社区驱动
- Thinkphp5.0模型操作使用page进行分页
- The installation software prompts that the program input point adddlldirectory cannot be located in the dynamic link library kernel32 DLL (download address at the end of the text)
- Dqn theoretical basis and code implementation [pytoch + cartpole-v0]
- RuntimeError_ Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor)
- Agent mode - power node of station B
猜你喜欢

机器学习库Scikit-Learn(线性模型、岭回归、插入一列数据(insert)、提取所需列、向量机(SVM)、聚类)

波士顿房价分析作业总结

通过OpenHarmony兼容性测评,大师兄开发板与丰富教培资源已ready

Simple usage and interface introduction of labelme

374. 猜数字大小(入门 必会)

About 1000base-t1 1000Base-TX and 100base-t1

神经网络学习笔记2.2 ——用Matlab写一个简单的卷积神将网络图像分类器

STM32串口发送和接收多个数据教程基于气体传感器实战

10. Redis interview FAQ

一种鲁棒变形卷积神经网络图像去噪
随机推荐
洛谷每日三题之第四天
Install Net prompt "cannot establish a certificate chain to trust the root authority" (simple method with download address)
KubeCon + CloudNativeCon Europe 2022
Using gatekeeper to restrict kubernetes to create specific types of resources
HRNet
波士顿房价分析作业总结
Leetcode: subsequence problem in dynamic programming
一种鲁棒变形卷积神经网络图像去噪
Shell script receives and returns parameters
Configure high availability using virtual ip+kept
2.9.2 digital type processing and convenient methods of ext JS
Analysis and processing of male and female voice signals based on MATLAB
leetcode162. 寻找峰值
Number of supported question banks and examination question banks of swiftui examination question bank project (tutorial includes source code)
sublime基本操作
基于Pandoc与VSCode的 LaTeX环境配置
Chengxin University envi_ The second week of IDL experiment content: extract aod+ in all MODIS aerosol products for detailed analysis
Zabbix6.0 monitoring vcenter7.0
module_ Basic principle of init function
Machine learning library scikit learn (linear model, ridge regression, insert a column of data, extract the required column, vector machine (SVM), clustering)