Forum Discussion

ARitt4's avatar
ARitt4
Icon for New Contributor rankNew Contributor
4 years ago

ALTMULT_ADD subtract direction

I'm trying to figure out one detail of the Quartus ALTMULT_ADD megafunction. It is set up with two pairs of inputs, dataa_0, datab_0, dataa_1 and datab_1. I understand that it multiplies dataa_0 * datab_0, multiplies dataa_1 * datab_1 and then either adds or subtracts the products based on the addnsub1 input. When it's adding, no problem but when it's subtracting, is the subtraction:

(dataa_0 * datab_0) - (dataa_1 * datab_1)

or is it

(dataa_1 * datab_1) - (dataa_0 * datab_0)

That is, which direction is the subtraction of the input products? I've been through the ug_lpm_alt_mfug.pdf writeup about six times and I haven't seen anywhere that it defines the direction of the subtraction. Obviously, it matters (a lot) to the result.

2 Replies

  • CheepinC_altera's avatar
    CheepinC_altera
    Icon for Regular Contributor rankRegular Contributor

    Hi,


    As I understand it, you have some inquiries related to the subtraction of the altmult_add. For your information, as I tested with simulation, the following should be the right operation:


    (dataa_1 * datab_1) - (dataa_0 * datab_0)


    You may run a Modelsim simulation with your design to verify as well. Thank you.


  • CheepinC_altera's avatar
    CheepinC_altera
    Icon for Regular Contributor rankRegular Contributor

    Hi,


    I believe the initial inquiry has been addressed. This thread will be transitioned to community support. If you have a new question, feel free to open a new thread to get the support from Intel experts. Otherwise, the community users will continue to help you on this thread. Thank you.