I am trying to multiply signed numbers on a Nexys A7-100T FPGA development board with VHDL.
See Reference manual webpage link for the FPGA board hardware information.
Also see this link (begins page 78) for Vivado's Vivado design synthesis guide user VGDL guide which shows how to use the hardware multiplier logic.
I know this will work for unsigned numbers but can this be used for signed numbers with some additional logic / code?
I also have looked at the complex multiplier within this document however I am totally unfamiliar with the concept behind it?
How do people use the multiplier hardware to multiply signed numbers?
Best Answer
The Vivado synthesiser is smart. You have to declare the operands as
signed
. If the operands are unsigned, explicitly type cast all of them tosigned
and then simply multiply using*
. It should infer a signed DSP multiplier on synthesis.If it's not inferring automatically (can be due to multiple reasons), then you may have to use
USE_DSP
attribute to force the synthesiser to map the multiplication logic to DSP slice.Page 61, Vivado Synthesis Guide