Everything Is Bits
A computer stores all information using just two states: on and off, represented as 0 and 1. A single digit is a bit, and eight bits make a byte.
What a bit pattern means depends entirely on its interpretation. The exact same byte can be the decimal number , the letter in ASCII, or part of an image.
| Binary | Powers | Decimal |
|---|---|---|
Binary is base-2, where positions are powers of . An -bit value gives combinations; an 8-bit byte holds values ( to ).
Common pitfall: Assuming a bit pattern has an inherent meaning. Always check how data is interpreted.
Hex, Text, and Formulas
Because long binary strings are clumsy, programmers use hexadecimal (base 16, digits – and –). Each hex digit packs 4 bits, so one byte equals two hex digits.
Text uses numeric mapping: ASCII uses 7 bits for 128 English characters, while Unicode extends this globally to cover every writing system.
The decimal value of any binary sequence is calculated by summing each bit multiplied by its position's power of 2:
Symbol Guide:
- : The resulting decimal number
- : Total number of bits
- : The bit value ( or ) at position
- : The power of 2 for position