Binary Number System
- A bitwise operation operates on one or more bit patterns or binary numerals at the level of their individual bits. It is a fast, primitive action directly supported by the processor, and is used to manipulate values for comparisons and calculations. On simple low-cost processors, typically, bitwise operations are substantially faster than division, several times faster than multiplication, and sometimes significantly faster than addition. While modern processors usually perform addition and multiplication just as fast as bitwise operations due to their longer instruction pipelines and other architectural design choices, bitwise operations do commonly use less power/performance because of the reduced use of resources.
- Logical Gates
Tables to revwise things
- On off status
Binary-coded decimal
Jpeg best example of storing data
- Binary arithmetic
+ -
0 + 0 → 0
0 + 1 → 1
1 + 0 → 1
1 + 1 → 0, carry 1 (since 1 + 1 = 0 + 1 × binary 10)
- Subtraction works in much the same way:
0 − 0 → 0
0 − 1 → 1, borrow 1
1 − 0 → 1
1 − 1 → 0
- Signed and unsigned numbers representation
- Two's complement
- Finding binary of negative numbers
- Standard conversions hex, oct, dec -> bin bin -> hex, oct, dec
Fastest conversions hex->bin bin->hex oct->bin bin->oct
- Bitwise operators
http://en.wikipedia.org/wiki/Bitwise_operations_in_C
- Usages of binary number knowledge in programs
Masks
1 bit status
- Magic of binary usage (bitwise operators)
Swapping numbers
Finding out range of int
http://en.wikipedia.org/wiki/Bit_manipulation
http://en.wikipedia.org/wiki/XOR_swap_algorithm.