Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

nios2 float numbers.

PShar32
New Contributor I
279 Views

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

0 Kudos
1 Solution
EricMunYew_C_Intel
Moderator
224 Views

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.


View solution in original post

4 Replies
EricMunYew_C_Intel
Moderator
259 Views

Have you included floating point hardware 2 FPH2 in your Nios system. It is required to deal with floating value. 

You can refer to below.

https://www.intel.com/content/dam/www/programmable/us/en/pdfs/literature/ug/ug_nios2_custom_instruct...


PShar32
New Contributor I
238 Views

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
Moderator
225 Views

You are right.


EricMunYew_C_Intel
Moderator
225 Views

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.


Reply