# [General]How to efficiently convert 8 bit data into 64 bit data

Status
Not open for further replies.

#### sundar11

##### Member level 1
Hi everyone
In my MCU i need to convert a 8 bit hex value into 32 bit value. How can i do this, i tried some logic but it converts only 8 bit value into 16bit value. Any ideas regarding this would be helpful.

regards

sundar

#### horace1

think we need more information - what do you mean by hex value?
e.g. is the data stored in a byte and you wish to store it in 32 bits? assuming long int is 32 bits something along the lines of should work
Code:
signed char data=10;
long int x;
x=data;

#### sundar11

##### Member level 1
storing a 64 bit value in a variable is the idea, but unsigned long long int does not support it. it takes only upto 32 bit only.

#### horace1

storing a 64 bit value in a variable is the idea, but unsigned long long int does not support it. it takes only upto 32 bit only.

if you do a web search for "large integer math library" it will give you a number of links, e.g. the GNU Bignum library
https://gmplib.org/

Status
Not open for further replies.