当前位置:网站首页>[VHDL parallel statement execution]
[VHDL parallel statement execution]
2022-07-07 07:53:00 【Both delicious and fun_】
VHDL A way to judge the rising edge of a signal
General detection clock rising edge
Method 1 :rising_edge Is a very strict rising edge , Must be from 0 To 1 ,
Method 2 :(clk’event and clk=‘1’) It can be downloaded from X To 1
Both ways are well understood
/
problem
Because of the recent contact FPGA, Study VHDL Language , Encountered a problem that beginners may encounter
clk10khz_d1 <= clk10khz;
clk10khz_d2 <= clk10khz_d1;
if key_cs='1' and clk10khz_d1='1' and clk10khz_d2='0' then --( Judge the rising edge )
.......
end if;
See here ,clk10khz The value of clk10khz_d1 , clk10khz_d1 The value of clk10khz_d2,
thus clk10khz ,clk10khz_b1 ,clk10khz_b2 It shouldn't be the same ? Is it wrong ?
Later, I saw a lot of code to detect the rising edge , It's all like this , There's no explanation .
In fact, that is Nonblocking assignment and Block assignment The difference between , Senior VHDL Players will feel that this problem is too basic .
What is non blocking assignment ?
The non blocking assignment operator uses the less than or equal sign ( namely <=) Express .
For calculating the non blocking assignment character at the beginning of the assignment operation time RHS expression , Update at the end of the assignment operation time LHS. When calculating non blocking assignment RHS Expressions and updates LHS period , Other statements , Including other non blocking assignment statements can be calculated at the same time RHS Expressions and updates LHS. Nonblocking assignment allows other statements to operate at the same time .
The non blocking assignment is determined by the clock beat , When the clock rises , Execute the assignment statement , And then begin-end All assignment statements between are assigned to the left of the assignment statement at the same time , Be careful : yes begin—end All statements between , Do it together , And a clock executes only once .
The results of two different assignment methods are different , Nonblocking assignment b<=a;c<=b; Two statements are executed at the same time , And block assignment b=a;c=b; Two statements are executed first b=a After execution c=b.
Why can we detect the rising edge ?
Know what is non blocking assignment , Then it is easy to understand the method of detecting the rising edge
clk10khz_d1 <= clk10khz;
clk10khz_d2 <= clk10khz_d1;
Execute two sentences together , hypothesis clk10khz Status as …01… ( On the rising edge )
At low levels clk10khz_d1 , clk10khz_d2 Are endowed with 0 ,
Along the rising edge , When executing two sentences at the same time clk10khz_d2 still Before being clk10khz_d1 The stored value is assigned to 0;
here clk10khz Rise to 1 , clk10khz_d1 To be an assignment 1.
Thus through clk10khz_d1='1' and clk10khz_d2='0 The rising edge of the detection signal .
That is to say, the order of two assignment statements is not important , The reverse result is the same .
边栏推荐
- Common validation comments
- 【斯坦福计网CS144项目】Lab3: TCPSender
- Codeforces Global Round 19
- [2022 ciscn] replay of preliminary web topics
- 微博发布案例
- IO流 file
- leetcode:105. 从前序与中序遍历序列构造二叉树
- After 95, Alibaba P7 published the payroll: it's really fragrant to make up this
- 今日现货白银操作建议
- Solve could not find or load the QT platform plugin "xcb" in "
猜你喜欢

Common validation comments
![[SUCTF 2019]Game](/img/9c/362117a4bf3a1435ececa288112dfc.png)
[SUCTF 2019]Game

resource 创建包方式

Jenkins remote build project timeout problem

探索干货篇!Apifox 建设思路

What are the positions of communication equipment manufacturers?

UWB learning 1

2022-07-06:以下go语言代码是否会panic?A:会;B:不会。 package main import “C“ func main() { var ch chan struct

Linux server development, SQL statements, indexes, views, stored procedures, triggers

Numbers that appear only once
随机推荐
解决could not find or load the Qt platform plugin “xcb“in ““.
IO流 file
Tianqing sends instructions to bypass the secondary verification
Leanote private cloud note building
知识点滴 - 关于苹果认证MFI
Linux server development, SQL statements, indexes, views, stored procedures, triggers
[Stanford Jiwang cs144 project] lab3: tcpsender
Numbers that appear only once
Jenkins remote build project timeout problem
【webrtc】m98 screen和window采集
nacos
大视频文件的缓冲播放原理以及实现
[2022 CISCN]初赛 web题目复现
Iterable、Collection、List 的常见方法签名以及含义
[UVM practice] Chapter 1: configuring the UVM environment (taking VCs as an example), run through the examples in the book
A bit of knowledge - about Apple Certified MFI
【obs】win-capture需要winrt
LeetCode 90:子集 II
2022制冷与空调设备运行操作复训题库及答案
UWB learning 1