HDLBits答案汇总(持续更新)⽬录
Vectors
铿锵拼音
Vectors in more detals
Vector part lect
hint: 赋值的左右两侧都可以对⽮量进⾏部分选择。
Bitewi operators
Hint:
按位布尔运算符:&,|,^,~
逻辑布尔运算符:&&,||,!
four input gates
hint: ⽮量的按位布尔运算在⽮量前加上布尔运算符即可。方程的由来
Vector concatenation operations
虾子的做法大全Hint: 位宽必须进⾏标注,11必须标为 2'd11,才可以。分号;必须是英⽂状态下的,⽽不是;中⽂状态下的。
module top_module (
input [4:0] a, b, c, d, e, f,
新手钓鱼output [7:0] w, x, y, z );
assign {w[7:0]} = {a[4:0], b[4:2]};
assign {x[7:0]} = {b[1:0], c[4:0], d[4]};
assign {y[7:0]} = {d[3:0], e[4:1]};
1968年属相
淘宝网简介assign {z[7:0]} = {e[0], f[4:0], 2'b11};
时光荏苒是什么意思啊//cond way
//assign {w, x, y, z} = {a, b, c, d, e, f, 2'b11};
endmodule
Replication operators
Hint: sign bit 符号位进⾏扩展保留,其他位保持不变即可。
module top_module (
input [7:0] in,
output [31:0] out );
assign out = {{24{in[7]}}, in [7:0]};
//cond way
羊鸦仁//assign out = {{24{in[7]}}, in};
endmodule
More replication
hint:结合⽮量的按位布尔运算,连接符{},复制操作,3种操作复合。