View Single Post
Jan14-12, 07:31 AM
P: 47
Sorry for the unclear question. let say it like:
I got 3 digital;A, B and C. A is input which is 011. B and C are the define value in the code which is 010 and 110. I need to compare A with B and C to see how many bit are matched. First, compare A with B of their first bit from left to right.
0 compare with 0---> bitmatch=1
1 compare with 1 ---> bitmatch=1
1 compare with 0 ---> bitmatch=0
In this part, i have to do the "bit shifting" ; B's first bit compare with A's first bit. Then B's second bit compare with A's second bit.
My question is how can i do the bit shifting?