NO

Author Topic: Some help with bit shifting  (Read 2797 times)

smelf1

  • Guest
Some help with bit shifting
« on: April 09, 2008, 05:13:44 PM »
Hi,

How can i wri a program to read a 16 digit number and convert it to hex then do the bit shifting.
Eg say i enter 1234567890abcdef, 1 = 0001 etc.

I have a table
static const int transform_table[56] = {

   57, 49, 41, 33, 25, 17,  9,  1, 58, 50, 42, 34, 26, 18,
   10,  2, 59, 51, 43, 35, 27, 19, 11,  3, 60, 52, 44, 36,
   63, 55, 47, 39, 31, 23, 15,  7, 62, 54, 46, 38, 30, 22,
   14,  6, 61, 53, 45, 37, 29, 21, 13,  5, 28, 20, 12,  4

};

How do i get the first entered number the 1 to swap with the 57th binary digit of the entered number?