+ Post New Thread
Results 1 to 7 of 7

13th April 2017, 05:57 #1
 Join Date
 Jan 2017
 Posts
 25
 Helped
 0 / 0
 Points
 334
 Level
 3
problem in sending and receiving data to a fixed point IP core.
HI there,
I have a simple fixedpoint adder written in HLS. I exported it as an IP core with Axilite interface. After completing the design in IP integrator i have written an SDK C++ app.
But the functions that are generated for sending inputs show me that, i need to send u32 Data. But my design is for fixed point.
Can i not send any other datatype like signed or float to IP core other than u32 data.? It looks to me very strange.
Can someone tell me how to deal with it?
How do i send my fixed point data types to fixed point IP core?

13th April 2017, 05:57

13th April 2017, 10:27 #2
Awards:
 Join Date
 Apr 2014
 Posts
 11,694
 Helped
 2712 / 2712
 Points
 57,436
 Level
 58
Re: problem in sending and receiving data to a fixed point IP core.
Hi,
fixed point .... you decide
* if you mean fixed point binary or fixed point decimal
* if it is signed or not
* how many integer bits/digits you use
* and how many fractional bits/digits you use.
Where are these informations?
Klaus

13th April 2017, 10:35 #3
 Join Date
 Jan 2017
 Posts
 25
 Helped
 0 / 0
 Points
 334
 Level
 3
Re: problem in sending and receiving data to a fixed point IP core.
Hi thanks for reply.
I am going to use fixed point decimal. Here is how i have defined my fixed point data:
typedef ap_fixed<22,10> data_t;
data_t a=55.12;
data_t b=21.32;
data_t c=32.12;
can you tell me how i can send it to IP core which only takes u32 data types?

13th April 2017, 10:35

13th April 2017, 11:02 #4
 Join Date
 Jan 2008
 Location
 Bochum, Germany
 Posts
 41,879
 Helped
 12748 / 12748
 Points
 241,298
 Level
 100
Re: problem in sending and receiving data to a fixed point IP core.
data_t and u32 are both 32bit numbers, also standard float type, by the way. You can send any 32bit entity as u32 parameter, using common C type casting methods.

13th April 2017, 11:26 #5
Awards:
 Join Date
 Apr 2014
 Posts
 11,694
 Helped
 2712 / 2712
 Points
 57,436
 Level
 58
Re: problem in sending and receiving data to a fixed point IP core.
Hi,
I assume it is fixed point binary, not decimal.
the decimal value "55.12" is represented in
* integer: "55" = "0b 00 0000 0000 0000 0011 0111"
* fractional: "0.12" = 0b 00 0111 1011"
(calculated as 0.12 * 2^10 = 123 (rounded), the "10" of 2^10 comes from the 10 bits fractional resolution)
so the total 32 bit binary number is: 0b 0000 0000 0000 0000 1101 1100 0111 1011
(the "" is just to visualize where the dicimal point is.)
Klaus

13th April 2017, 11:34 #6
 Join Date
 Jan 2017
 Posts
 25
 Helped
 0 / 0
 Points
 334
 Level
 3
Re: problem in sending and receiving data to a fixed point IP core.
So i need to convert fixed to binary and send, is it?

13th April 2017, 11:34

13th April 2017, 12:38 #7
Awards:
 Join Date
 Apr 2014
 Posts
 11,694
 Helped
 2712 / 2712
 Points
 57,436
 Level
 58
Re: problem in sending and receiving data to a fixed point IP core.
Hi,
if it already is in fixed_binary then you donīt need a conversion to binary.
It is just a problem of definition. But 32 bits will be 32 bits.
***
example:
Unsigned integer 8 bits: letīs say the decimal value is "5" > 0b 0000 0101
now multiply it with decimal 7 and get decimal 35 = 0b 0010 0011
***
now say you define the value as 6.2 unsigned fixed binary.
then decimal "5" is represented as 0b 0001 0100
now multiply it with decimal 7 and get decimal 35 = 0b 1000 1100
now focus on the binary value 0b 0001 0100 (formerly seen as decimal "5", but now see it as usual integer binary) then it represents the decimal value "20"
now multiply it with decimal 7 and get the decimal value of 140 = 0b 1000 1100
Did you recognize that the binary values (input and result) remain the same ... and the difference is only in your mind, because you decided it to be 6.2 fixed binary?
Klaus
+ Post New Thread
Please login