cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Adventurer
Adventurer
326 Views
Registered: ‎09-11-2019

Can ap_int<512> be used during calculation to store a big number which may overflow in type unsigned int ?

Jump to solution

I know data type ap_int can be used during reading and writing memory but I want to know if it can also be used during normal calculation in the compute units as a substitute of int or unsigned int. If not, what data type can I use to store a big number which may larger than the maximum of the data type unsigned int ?

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Xilinx Employee
Xilinx Employee
317 Views
Registered: ‎06-04-2018

Hi @lygw ,

you can use ap_int<datawidth_size> for you design.

Please refer the following design for reference : 

https://github.com/Xilinx/Vitis_Accel_Examples/blob/master/cpp_kernels/wide_mem_rw/src/vadd.cpp

Thanks,

Vishnu

-------------------------------------------------------------------------
Don't forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------

View solution in original post

4 Replies
Highlighted
Xilinx Employee
Xilinx Employee
318 Views
Registered: ‎06-04-2018

Hi @lygw ,

you can use ap_int<datawidth_size> for you design.

Please refer the following design for reference : 

https://github.com/Xilinx/Vitis_Accel_Examples/blob/master/cpp_kernels/wide_mem_rw/src/vadd.cpp

Thanks,

Vishnu

-------------------------------------------------------------------------
Don't forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------

View solution in original post

Highlighted
Moderator
Moderator
311 Views
Registered: ‎11-04-2010

In default, you can change the bit types to ap_int<N> or ap_uint<N>, where N is a bit-size from 1 to 1024.

Is it enough for you?

-------------------------------------------------------------------------
Don't forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
Highlighted
Adventurer
Adventurer
236 Views
Registered: ‎09-11-2019

I got it! Thank you for your help!

0 Kudos
Highlighted
Adventurer
Adventurer
235 Views
Registered: ‎09-11-2019

It's enough! Thank you for your explanation!

0 Kudos