当前位置:网站首页>[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 .
边栏推荐
- Redis technology leak detection and filling (II) - expired deletion strategy
- 测试周期被压缩?教你9个方法去应对
- [P2P] local packet capturing
- pytest+allure+jenkins環境--填坑完畢
- 2022茶艺师(初级)考试题模拟考试题库及在线模拟考试
- KBU1510-ASEMI电源专用15A整流桥KBU1510
- 大视频文件的缓冲播放原理以及实现
- Solution: could not find kf5 (missing: coreaddons dbusaddons doctools xmlgui)
- Button wizard collection learning - mineral medicine collection and running map
- misc ez_ usb
猜你喜欢
![[Stanford Jiwang cs144 project] lab4: tcpconnection](/img/fd/704d19287a12290f779cfc223c71c8.png)
[Stanford Jiwang cs144 project] lab4: tcpconnection

【斯坦福计网CS144项目】Lab3: TCPSender
![[experience sharing] how to expand the cloud service icon for Visio](/img/42/dba9f78f3fb2049dad8b343b0b36e5.png)
[experience sharing] how to expand the cloud service icon for Visio

PHP exports millions of data

Qt学习28 主窗口中的工具栏

Write CPU yourself -- Chapter 9 -- learning notes

Few-Shot Learning && Meta Learning:小样本学习原理和Siamese网络结构(一)
![[webrtc] m98 Screen and Window Collection](/img/b1/1ca13b6d3fdbf18ff5205ed5584eef.png)
[webrtc] m98 Screen and Window Collection
![[guess-ctf2019] fake compressed packets](/img/a2/7da2a789eb49fa0df256ab565d5f0e.png)
[guess-ctf2019] fake compressed packets

Explore Cassandra's decentralized distributed architecture
随机推荐
Cnopendata list data of Chinese colleges and Universities
[SUCTF 2019]Game
C语言通信行程卡后台系统
[UVM basics] summary of important knowledge points of "UVM practice" (continuous update...)
《动手学深度学习》(四) -- 卷积神经网络 CNN
LeetCode 40:组合总和 II
Pytest+allure+jenkins installation problem: pytest: error: unrecognized arguments: --alluredir
即刻报名|飞桨黑客马拉松第三期等你挑战
[CV] Wu Enda machine learning course notes | Chapter 8
Numbers that appear only once
Visualization Document Feb 12 16:42
Idea add class annotation template and method template
【斯坦福计网CS144项目】Lab4: TCPConnection
Regular e-commerce problems part1
Detailed explanation of Kalman filter for motion state estimation
2022-07-06: will the following go language codes be panic? A: Meeting; B: No. package main import “C“ func main() { var ch chan struct
Redis technology leak detection and filling (II) - expired deletion strategy
解决:Could NOT find KF5 (missing: CoreAddons DBusAddons DocTools XmlGui)
IO流 file
开源生态|打造活力开源社区,共建开源新生态!