当前位置:网站首页>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;
end
Parallel 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
边栏推荐
- oracle 关闭回收站
- Installing PWA application in Google Chrome browser will display more description information
- 基于Matlab的男女声音信号分析与处理
- Theoretical basis of doubledqn and its code implementation [pytoch + pendulum-v0]
- Chapter I Introduction
- Local storage localstorage ⽤ method details
- [C language errata] error in getting array length in function
- QT OpenGL moves 3D objects with mouse and keyboard (set camera)
- KubeCon + CloudNativeCon Europe 2022
- Latex environment configuration based on pandoc and vscode
猜你喜欢
GoogLeNet
上班摸鱼打卡模拟器微信小程序源码
leetcode:50. Pow(x, n)
Theoretical basis of double Q-learning and its code implementation [pendulum-v0]
Chapter 4 用户数据分析
10. Redis interview FAQ
通过Dao投票STI的销毁,SeekTiger真正做到由社区驱动
central limit theorem
论文阅读:U-Net++: Redesigning Skip Connections to Exploit Multiscale Features in Image Segmentation
Matlab在线性代数中的应用
随机推荐
Backup kubernetes backup etcd data
如何将Excel中的数据粘贴到cxGrid中
Latex environment configuration based on pandoc and vscode
HRNet
Es6 notes d'étude - station B Xiao Ma Ge
MySQL master-slave setup
二分查找(leetcode704.很简单必会的)
web语义化(强调标签-em-斜体)(重点强调标签-strong-粗体)(自定义列表:dl、dt、dd)
Oracle queries the host name and the corresponding IP address
mysql创建项目研发账号
sublime基本操作
本地存储localStorage⽤法详解
Powertor500t reports an error 0x01806803
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)
KubeCon + CloudNativeCon Europe 2022
一种鲁棒变形卷积神经网络图像去噪
Unity using Sqlite
Paper reading: u-net++: redesigning skip connections to exploit multiscale features in image segmentation
Leetcode: subsequence problem in dynamic programming
Use RZ, SZ commands to upload and download files through xshell7