其他分享
首页 > 其他分享> > HDLBits刷题全记录(二)

HDLBits刷题全记录(二)

作者:互联网

文章目录

Procedures

在本节开始之前先将常用语句进行划分,分为可综合性和不可综合性两种,简单来说,可综合性即是可以构成硬件电路的语句,而不可综合性即是只能用来仿真的语句。

类别语句可综合性
过程语句initial
always
语句块begin-end
fork-join
赋值语句assign
= , <=
条件语句if - else
case, casez, casex
循环语句forever
repeat
while
for
编译向导语句'define
'include
'ifdef, 'else, 'endif

Always blocks(combinaitonal)

Always blocks(clocked)

问题示意图(转自HDLBits)

If statement

问题示意图(转自HDLBits)

If statement latches

问题示意图(转自HDLBits)

Case statement

Priority encoder

Priority encoder with casez

Avoiding latches

More Verilog Features

Conditional ternary operator

Reduction operators

Reduction : Even wider gates

Combinational for-loop: Vector reversal 2

Combinational for-loop: 255-bit population count

Generate for-loop: 100-bit binary adder2

Generate for-loop: 100-digit BCD adder

标签:语句,begin,end,HDLBits,全记录,output,input,out,刷题
来源: https://blog.csdn.net/weixin_39677048/article/details/120731444