FPGA小技巧 - 缩减运算符
生活随笔
收集整理的這篇文章主要介紹了
FPGA小技巧 - 缩减运算符
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
reg[1:0] cnt_baud;
always@(posedge outClk0, negedge SysRst0)beginif(!SysRst0)begincnt_baud <= 2'b0;endelse if(&cnt_baud == 1'd1)begincnt_baud <= 2'd0;endelse begincnt_baud <= cnt_baud + 1'd1;end
end
縮減運算符:&
上面代碼出現&cnt_baud==1’d1 ,意思為1‘d1 == cnt_baud[0] & cnt_baud[1];
再比如:
reg [3:0] B; reg C; C = &B;相當于:
C =( (B[0]&B[1]) & B[2] ) & B[3];總結
以上是生活随笔為你收集整理的FPGA小技巧 - 缩减运算符的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 读书笔记(十五)--将才
- 下一篇: 小米抢购神器-开放源码