Go Down

Topic: Encoding data using C++ (Read 415 times) previous topic - next topic

Singh Ji

hi

Does anyone knows how to encode higher bit data into smaller bit data...
for example. i have higher bit data as 1,0,1,1,0,1,..........32-bit data. How to encode this 32-bit data into for 8-bit data.
I know this is possible.

Can we implement it using HASH algorithm or some other?

Please reply as soon as possible.....

Graynomad

Quote
How to encode this 32-bit data into for 8-bit data.


Assuming you mean four 8-bit data.

Code: [Select]
8_bit_val_1 = 32_bit_val >> 24;
8_bit_val_2 = (32_bit_val >> 16) & 0xFF;
8_bit_val_3 = (32_bit_val >> 8) & 0xFF;
8_bit_val_4 = 32_bit_val & 0xFF;



______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy