Friday, 2024-03-29, 0:51 AM, your ip is 44.192.75.131
Welcome Guest | RSS

Main » 2011 » July » 16
here is the function code

unsigned char reverse_bit(unsigned char normalbit)
{
    uint8_t reversed;
    reversed = (((normalbit&0b00000001)>>0)<<7)|(((normalbit&0b00000010)>>1)<<6)|(((normalbit&0b00000100)>>2)<<5)|(((normalbit&0b00001000)>>3)<<4)|
               (((normalbit&0b00010000)>>4)<<3)|(((normalbit&0b00100000)>>5)<<2)|(((normalbit&0b01000000)>>6)<<1)|(((normalbit&0b10000000)>>7)<<0);
    return reversed;
}

this code will reverse bit from bit 7,6,5,4,3,2,1,0 into 0,1,2,3,4,5,6,7 or from bit 0,1,2,3,4,5,6,7 into 7,6,5,4,3,2,1,0.


for example :

//start here

unsigned char reverse_bit(unsigned char normalbit)
{
    uint8_t reversed;
    reversed = (((normalbit ... Read more »
Views: 42283 | Added by: rendy | Date: 2011-07-16

Site menu
What Time is it ?
Login To Unet
Search
Calendar
«  July 2011  »
SuMoTuWeThFrSa
     12
3456789
10111213141516
17181920212223
24252627282930
31
Statistics

Total online: 1
Guests: 1
Users: 0