Forum Discussion

PShar32's avatar
PShar32
Icon for Occasional Contributor rankOccasional Contributor
3 years ago
Solved

Nios II, floating point hardware.

Hi,

Hi, I want to perform some huge multiplications in nios 2 processor,

I learned that unlike ‘nios 2 e’ , nios 2 fast says it does hardware based multiplication,
so adding floating point hardware is worthless or it will further reduce computation time ?

  • Hi @PShar32 ,

    Do you have any further update or concern?

    Let me know if there's any.

    Thanks,

    Best Regards,

    Sheng

    p/s: If any answer from the community or Intel Support are helpful, please feel free to give best answer or rate 4/5 survey.

6 Replies

    • PShar32's avatar
      PShar32
      Icon for Occasional Contributor rankOccasional Contributor

      Hello,

      thank you, for your reply,

      also the link you suggests to make multiplication in assembly code. I am writing in c++, how will I write those functions ? (Mul r1, r2, r3)??

      Is there any other means to make the “ 64 bit double precision “ multiplication more faster, in nios II. .?

      //

  • ShengN_altera's avatar
    ShengN_altera
    Icon for Super Contributor rankSuper Contributor

    Hi @PShar32 ,

    If you're using C++, then you can just ignore the assembler code. The performance table in this link https://www.intel.com/content/www/us/en/docs/programmable/683836/current/multiply-and-divide-performance-83984.html also applicable to C++ arithmetic operators.

    As for performance, the Nios II/f will be the fastest among the Nios II. Can check the Arithmetic Instructions tab (image):

    The best performance for Multiply Extended (64-bit double precision) is 1 cycle if set Multiply Implementation: 1 32-bit multiplier.

    Based on the link above,

    However, if an instruction depends on the result of an earlier instruction, then the processor stalls through any result latency cycles until the result is ready.

    If there is dependency between the results and operands for back-to-back instructions, there will be extra 2 Result Latency Cycles. In that case, that'll be a total of 3 cycles (1 cycle + 2 cycles).

    Thanks,

    Best regards,

    Sheng

    p/s: If any answer from the community or Intel Support are helpful, please feel free to give best answer or rate 4/5 survey.

  • PShar32's avatar
    PShar32
    Icon for Occasional Contributor rankOccasional Contributor

    Thankyou for the reply,

    As I understand, you are suggesting me as i don't need anything else to perform high speed 64 bit multiplication as NIOS II/f already has hardware multipliers and extended multipliers/

    But I can further improve the speed if my multiplication variables does not depend upon previous operation.

    right ?

    Pratik

  • ShengN_altera's avatar
    ShengN_altera
    Icon for Super Contributor rankSuper Contributor

    Hi,


    Yes. Multiplication variables does not depend upon previous operation will definitely increase the speed.


    Thanks,

    Best Regards,

    Sheng


    p/s: If any answer from the community or Intel Support are helpful, please feel free to give best answer or rate 4/5 survey.


  • ShengN_altera's avatar
    ShengN_altera
    Icon for Super Contributor rankSuper Contributor

    Hi @PShar32 ,

    Do you have any further update or concern?

    Let me know if there's any.

    Thanks,

    Best Regards,

    Sheng

    p/s: If any answer from the community or Intel Support are helpful, please feel free to give best answer or rate 4/5 survey.