06-02-2018 08:11 AM
Hello everyone. First of all thank you for your attention. I have a problem with the DSP48 in the chip xc7a100tcsg324-1 (active) of the ARTIX-7 family, that is, I would like to make three multiplications, more precisely, a multiplication between STD_LOGIC_VECTOR (7 downto 0) and a constant. The problem arises in that the constants are three, each one of which must be multiplied by one STD_LOGIC_VECTOR (7 downto 0), but I noticed reading the datasheet of the DSP that it is not possible to do it with a single DSP48. HELP?
06-02-2018 11:47 AM - edited 06-03-2018 06:20 AM
Well, first of all, you haven't said how big your constants are.. Vivado is capable of implementing a signal X constant multiplication either using the DSP48 or using lookup tables and adders.
Having said that, to implement a multiplier in VHDL you should be using the numeric_std package and defining your signals as "signed" or "unsigned" before multiplying them.. And remember, you can only multiply "signed" X "signed" or "unsigned" X "unsigned", but NOT "signed" X "unsigned".
Just write a little code and you'll see that Vivado will most likely generate the DSP48's as expected. If not, you can use attributes to force the usage.
06-03-2018 05:59 AM - edited 06-03-2018 06:04 AM
Oooops i forgot the size of the costants,there are three constants, one from 7 bits, one from 8 and one from 5, which are multiplied by the three 8-bit vectors I was talking about. Basically it is a conversion from RGB to gray. For the combinatorial part I used four DSPs, ie three for the multiplications and one to add the three products and then obtain the gray pixel.
I work only with unsigned values,I already know how the LUTs work in broad terms and for this reason I prefer to use the DSPs, but use four DSP for only one pixel color conversion i think is bad idea.