Reputation: 41
I am a beginner in verilog.
Almost of all examples for concatenation are as the following.
wire [3:0] result;
reg a, b, c, d;
result = {a, b, c, d};
Is the following possible, too?
wire [3:0] result;
wire a, b, c, d;
{a, b, c, d} = result;
Upvotes: 4
Views: 4218
Reputation:
The LHS(left hand side) of assignments do allow concatenations.
module mod1;
wire [3:0] result;
wire a, b, c, d;
reg e,f,g,h;
{a, b, c, d} = result; //Invalid, not in procedural construct
assign {a, b, c, d} = result; //Valid
assign {a,{b,c},d} = result; //Valid
initial
{e, f, g, h} = result; //Valid
endmodule
Upvotes: 6