1
votes

Can the power operator ** be used with arbitrarily large operands?

Ex:  
 reg [100:0] c;  
   reg [15:0] a;  
   reg [15:0] b;  
   c = a**b;  

Does there is some maximum limit on operand size?

1
Power operator '**' is supported only for the results that do not exceed the size of 'real' data type. The size of the real operator is 8 byte, this is the most common limit followed by eda vendorsEmman

1 Answers

2
votes

IEEE 1800-2012 doesn't mention any maximum size of operands.

But... different IDE might have some limitations in ** operator usage, e.g. it works only in case like 2**n or length of the operands is limited. However, there should be no limitations in simulations (e.g. Riviera-PRO allowed to simulate a**b operation, with a and b length equal to 150, without any warning).

When using power operator for synthesis, it's sythesizable as long as a=2. In that case the power operator simply "change" to shifter.