Binary
Binary is the base-2 numeral system, using only 0 and 1, and is the foundation of internal data representation in all digital electronic computers.
Purpose
It maps directly onto the two voltage levels of digital circuits (high/low), letting hardware implement arithmetic and storage with simple logic gates.
Mechanism
Each binary digit is one bit, expanded by powers of 2^n. A byte is 8 bits. Negative numbers use two's complement, and fractions use floating-point formats (IEEE 754).
Use cases
- Low-level bit operations and masking
- Bitmap and Bloom filter storage
- Bit-field parsing in network protocols
- Teaching and algorithm visualization
Examples
- Input
42Output0010101042 = 32 + 8 + 2
Common errors
- Mixing up signed and unsigned interpretation
- Make the type and interpretation context explicit
Related terms
Hexadecimal
Hexadecimal (hex) is the base-16 numeral system, using 0-9 and A-F for 0-15; it is one of the most common radix notations in computing. GLOSSARY
Octal
Octal is the base-8 numeral system, using digits 0-7, where each digit corresponds to 3 binary bits; it was widely used on early computers. GLOSSARY
Base16
Base16 is hexadecimal encoding: every 4 bits map to one hexadecimal character (0-9, A-F), making it the simplest member of the Base family defined by RFC 4648. GLOSSARY
Endianness
Endianness is the byte ordering of multi-byte values in memory: big-endian stores the most significant byte first, little-endian the least significant byte first. GLOSSARY