Forum Discussion

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

nios2 float numbers.

hi,

I am using intel cyclone V DE1 soc board, I have made a system of nios2, shared onchip memory and HPS, the NIOS2 processor wirtes a float variable in onchip memory and a python program in HPS tries to read that..!!
but the problem is i am not able to understand how nios2 formats the float variable before storing it in memory.
---------
example :: I am trying to write float 353924.531250 but when i read it it shows 0x00056684.

""it is definately not formating in IEEE 754 as document says". please explain the conversion, how 353924.531250 becomes 0x00056684 ?

regards

------------

Pratik Sharma

  • Since this thread had been answered, we shall close this thread. If you still need further assistance, you are welcome to post a response within 15days or open a new thread, some one will be right with you. After 15 days, this thread will be transitioned to community support. The community users will be able to help you with your follow-up questions.


4 Replies

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

    Hi,

    Thank you for the rely. If .... I just add Floating point hardware 2 (FPH2) along with my nios2 and perform multiplication and division like in general, it will be able to produce result faster then a normal NIOS2 without Floting point hardware.
    and store the float values in IEEE-754 format in registers ..!!
    right..?

    regards

    -------

    Pratik

  • EricMunYew_C_Intel's avatar
    EricMunYew_C_Intel
    Icon for Frequent Contributor rankFrequent Contributor

    Since this thread had been answered, we shall close this thread. If you still need further assistance, you are welcome to post a response within 15days or open a new thread, some one will be right with you. After 15 days, this thread will be transitioned to community support. The community users will be able to help you with your follow-up questions.