Vector Replication
📌 Introduction
module top_module (
input [7:0] in,
output [31:0] out );
assign out = { {24{in[7]}}, in[7:0]};
endmodule
Notice that 24{in[7]}
must be wrapped in {}
because of its vector return.
🧑💻 Code Example
module top_module (
input a, b, c, d, e,
output [24:0] out );
assign out = ~, {5{b}}, {5{c}}, {5{d}}, {5{e}} } ^ {5{a, b, c, d, e}};
endmodule