当前位置:网站首页>[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 .
边栏推荐
- IO stream file
- [Stanford Jiwang cs144 project] lab4: tcpconnection
- What is the difference between TCP and UDP?
- Wx is used in wechat applet Showtoast() for interface interaction
- [webrtc] M98 screen and window acquisition
- buuctf misc USB
- misc ez_ usb
- 【webrtc】m98 screen和window采集
- 智联+影音,AITO问界M7想干翻的不止理想One
- What are the positions of communication equipment manufacturers?
猜你喜欢

LeetCode 40:组合总和 II

2022焊工(初级)判断题及在线模拟考试

nacos

Hands on deep learning (IV) -- convolutional neural network CNN

2022茶艺师(初级)考试题模拟考试题库及在线模拟考试

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

【数学笔记】弧度

【p2p】本地抓包

leetcode:105. Constructing binary trees from preorder and inorder traversal sequences

Most elements
随机推荐
科技云报道:从Robot到Cobot,人机共融正在开创一个时代
【经验分享】如何为visio扩展云服务图标
Route jump in wechat applet
Tongda injection 0day
C语言航班订票系统
Technology cloud report: from robot to Cobot, human-computer integration is creating an era
pytest+allure+jenkins環境--填坑完畢
Weibo publishing cases
【webrtc】m98 screen和window采集
Zhilian + AV, AITO asked M7 to do more than ideal one
2022焊工(初级)判断题及在线模拟考试
Info | webrtc M97 update
Cnopendata geographical distribution data of religious places in China
@component(““)
大视频文件的缓冲播放原理以及实现
[UVM practice] Chapter 2: a simple UVM verification platform (2) only driver verification platform
Mysql高低版本切换需要修改的配置5-8(此处以aicode为例)
开源生态|打造活力开源社区,共建开源新生态!
[Stanford Jiwang cs144 project] lab3: tcpsender
[webrtc] m98 Screen and Window Collection