Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / A question about binary

Author
Message
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 3rd Mar 2010 00:18
This feels like quite a n00by question so I shall ask it here...

Ok, So I have an 8bit binary number, how do I tell if an individual bit is 1 or 0?

I have looked, but I'm not sure what to call this? so I've not had any luck.

Thanks in advance.

Neuro Fuzzy
17
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 3rd Mar 2010 01:22 Edited at: 3rd Mar 2010 01:23
bitwise operators. Pretty annoying to use but... whatever.

>> right bitwise shift
1010101 >> 1 =
0101010

<<left bitwise shift
1010101 << 2 =
1010100

also, the and, or, and xor operators are bitwise.

101011 and
111100 =
101000

110000 or
000011 =
110011

110010 xor
011001 =
101011



[edit] bit truefalse condenses to:



=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 3rd Mar 2010 01:38
Thank you ever so much NeuroFuzzy

Login to post a reply

Server time is: 2024-09-28 14:19:48
Your offset time is: 2024-09-28 14:19:48