Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

problem in sending and receiving data to a fixed point IP core.

Status
Not open for further replies.

sai_shashi

Junior Member level 3
Joined
Jan 20, 2017
Messages
25
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
240
HI there,
I have a simple fixed-point adder written in HLS. I exported it as an IP core with Axi-lite 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?
u32.PNGans.PNG
 

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
 

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?
 

data_t and u32 are both 32-bit numbers, also standard float type, by the way. You can send any 32-bit entity as u32 parameter, using common C type casting methods.
 

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 11|00 0111 1011
(the "|" is just to visualize where the dicimal point is.)

Klaus
 

So i need to convert fixed to binary and send, is it?
 

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 01|00
now multiply it with decimal 7 and get decimal 35 = 0b 1000 11|00

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
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top