Question about '{26{sumofproducts[30]}}'

Guest
Hi,

I am new to Verilog. I read the following code. I do not understand the '{26{sumofproducts[30]}}'. Could you explain it to me?

Thanks

...........
wire signed [30:0] sumofproducts; // sfix31_E7
wire signed [56:0] sumofproducts_cast; // sfix57_E7

assign sumofproducts_cast = $signed({{26{sumofproducts[30]}}, sumofproducts});
 
On Monday, 3 December 2012 14:40:40 UTC+1, rxj...@gmail.com wrote:
Hi,



I am new to Verilog. I read the following code. I do not understand the '{26{sumofproducts[30]}}'. Could you explain it to me?



Thanks



..........

wire signed [30:0] sumofproducts; // sfix31_E7

wire signed [56:0] sumofproducts_cast; // sfix57_E7



assign sumofproducts_cast = $signed({{26{sumofproducts[30]}}, sumofproducts});
Hi,
This is the repetition operator. For example

wire [7:0] my_wire = {8{1'b0)} ; // Repeat 1'b0 8 times and return vector

Ibn your example, it is sign extending sumofproducts to 57 bits by repeating the MSB 26 times.

Hope that's clear,

Steven
 

Welcome to EDABoard.com

Sponsor

Back
Top