Verilog HDL(HDLBits)
Verilog Language Basic
06-Vector-向量拼接
module top_module (
input [4:0] a, b, c, d, e, f,
output [7:0] w, x, y, z );//
// assign { ... } = { ... } 将input的6条5位宽的wire线拼接在一起一条30个位宽的线,并且输出到由4条8个位宽拼接成一条32位的线
assign {w[7:0],x[7:0],y[7:0],z[7:0]} = {a[4:0],b[4:0],c[4:0],d[4:0],e[4:0],f[4:0],2'b11};
//化简版
assign{w,x,y,z} = {a,b,c,d,e,f,2'b11};
endmodule