Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
17246 Discussions

Multiplication by constant

Altera_Forum
Honored Contributor II
2,077 Views

Hi all. Just found out that Quartus does not instantiate hard block multiplier if multiplication is done by a constant. Even if i define multstyle = "dsp", why?

0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
865 Views

 

--- Quote Start ---  

Hi all. Just found out that Quartus does not instantiate hard block multiplier if multiplication is done by a constant. Even if i define multstyle = "dsp", why? 

--- Quote End ---  

 

 

what value is your constant?
0 Kudos
Altera_Forum
Honored Contributor II
865 Views

With a constant there are some sizable reductions that can be done during synthesis to make it more palatable in logic. That being said, if you have a DSP block available, why not use it. Perhaps try keeping the constant, e.g. 

 

(* keep *) wire mult_const; 

assign mult_const = 16'ha9a9; 

 

I'm guessing something like that will get it to synthesize a DSP.
0 Kudos
Altera_Forum
Honored Contributor II
865 Views

If the constant value is 2^n, then the result is simply a bitshift. 

 

Similarly, if it has just a couple of bits set, it may be easier just to create an adder.
0 Kudos
Altera_Forum
Honored Contributor II
865 Views

Thanx for fast reply, however it was a simple typo, so now synthesis multstyle works fine :). So not to create one more thread, ill ask here, for example i need to partially connect some modules output (let it be 8 most significant bits of 16). The straightforward solution is: 

mult mult_inst( .a(a_8bit), .b(b_8bit), .res(c_16bit) ); assign c_8bit = c_16bit 

May there be more elegant approach (without this intermediate wire) ?
0 Kudos
Reply