Understanding Binary

The language of digital electronics - how computers count, think, and communicate using only 0s and 1s.

Every computer, smartphone, calculator, and digital device speaks one fundamental language: binary. Understanding binary isn't just academic—it's the key to understanding how all digital electronics work. Binary is a number system that uses only two digits: 0 and 1. In electronics, these correspond to two voltage states: OFF (low voltage) and ON (high voltage). This simple two-state system is the foundation of all digital technology.

Objectives

  • Explain why computers use binary instead of decimal
  • Convert numbers between binary and decimal in both directions
  • Understand bits, bytes, nibbles, and larger data units
  • Perform binary addition with carries
  • Read and write hexadecimal as binary shorthand
  • Recognize how binary connects to digital logic circuits
  • Interpret binary representations of colors, characters, and addresses

Key Takeaways

  • Binary uses only 0 and 1 because electronic circuits reliably distinguish two voltage states
  • Place values are powers of 2: 1, 2, 4, 8, 16, 32, 64, 128, 256...
  • Binary → Decimal: Add place values where there's a 1
  • Decimal → Binary: Subtract powers of 2 or divide repeatedly by 2
  • 1 byte = 8 bits = 256 possible values (0 to 255)
  • Binary addition: 1 + 1 = 10 (carry the 1)
  • Hexadecimal groups 4 bits into one digit (0-9, A-F)
  • Two's complement uses the MSB as a sign bit for negative numbers

Applications

  • Computer Memory: RAM addresses and data are all binary. Memory sizes are powers of 2.
  • Digital Images: Each pixel's color is stored as binary RGB values (24 bits for true color).
  • Network Addresses: IP addresses are 32-bit (IPv4) or 128-bit (IPv6) binary numbers.
  • ASCII/Unicode: Text characters are binary codes. "A" = 01000001 in ASCII.
  • Digital Audio: Sound samples are binary values representing amplitude at each moment.
  • Microcontrollers: Arduino, ESP32, and other MCUs process everything as binary data.

Practice Problems

Problem 1: Convert 10101010₂ to decimal.

Problem 2: Convert 100₁₀ to binary.

Problem 3: Convert 0xAB to binary and decimal.

Problem 4: Add 01101₂ + 01011₂

Problem 5: How many different values can 10 bits represent?

Problem 6: What is the binary representation of the hex color #FF00FF (magenta)?