Quote:
I cannot figure out how to use binary numbers without having to convert them to decimal first
|
All numbers are stored as binary values inside your computer, therefore a "conversion to decimal" is only a way of thinking about numbers, and not a real conversion to decimal.
I suggest that you get used to working with the hexadecimal representation instead of decimal or binary.
Why use Hex?
http://www.cs.ualberta.ca/~casey/c101/101notes/hex.html
Decimal to Hex table
http://www.jaworski.com/htmlbook/dec-hex.htm
C/C++ has all the operators you need to do bit level operations without resorting to inline asm code.
Arithmetic + Binary plus (add)
- Binary minus (subtract)
* Multiply
/ Divide
% Remainder (modulus)
Bitwise << Shift left
>> Shift right
& Bitwise AND
^ Bitwise XOR (exclusive OR)
| Bitwise inclusive OR
Logical && Logical AND
|| Logical OR
Assignment = Assignment
*= Assign product
/= Assign quotient
%= Assign remainder (modulus)
+= Assign sum
-= Assign difference
<<= Assign left shift
>>= Assign right shift
&= Assign bitwise AND
^= Assign bitwise XOR
|= Assign bitwise OR
Relational < Less than
> Greater than
<= Less than or equal to
>= Greater than or equal to
== Equal to
!= Not equal to