|
学CPLD已有一周时间了,有一问题一直没搞明白:究竟CPLD上电后会像单片机一样,自动复位吗?
比如:
module led_sh_liush(clk,rst_n,
led1,
led_liush);
input clk,rst_n;
output led1;
output[3:1]led_liush;
//---------------------------------------
//led1以40毫秒为周期闪烁
reg[22:1]cnt_sh;
reg led1;
always@(posedge clk or negedge rst_n)
begin
if(!rst_n) cnt_sh<=22'd0;
else if(cnt_sh==22'd4_000_000)
begin
cnt_sh<=22'd0;
led1<=~led1;
end
else cnt_sh<=cnt_sh+1'b1;
end
上电后,cnt_sh的值会是什么?(不按复位按扭)。请各位发表下意见,谢谢!! |
阿莫论坛20周年了!感谢大家的支持与爱护!!
知道什么是神吗?其实神本来也是人,只不过神做了人做不到的事情 所以才成了神。 (头文字D, 杜汶泽)
|