Bit Manipulation
Posted: Fri Aug 22, 2008 7:48 am
I want to extract single bit data from the two bit data. How to do that? I have written a following code which is assigning two bit data to the varibles Left & Right. But I wanted it to be single bit data. only then my rest of the code will work as I wanted.
Left = New AND 0x0A ( New is two bit variable from that I want to extract the left bit and assign to the Varaible Left)
Right = Old AND 0x01 ( Old is two bit variable from that I want to extract the right bit and assign to the Varaible Right)
Direction.Return = Left XOR Right
Could you please suggest me how to do that?
Regards
Kumaran
Left = New AND 0x0A ( New is two bit variable from that I want to extract the left bit and assign to the Varaible Left)
Right = Old AND 0x01 ( Old is two bit variable from that I want to extract the right bit and assign to the Varaible Right)
Direction.Return = Left XOR Right
Could you please suggest me how to do that?
Regards
Kumaran