🔢

Binary and Decimal Conversion Basics

Jun 11, 2025

Overview

This lecture introduces the fundamentals of binary and decimal conversions, focusing on their importance in IP subnetting and practical calculations.

Binary Number System Basics

  • Binary uses only two digits: 0 and 1.
  • Each binary digit is called a "bit."
  • Eight bits together make a "byte" or "octet" (8-bits).

Binary to Decimal Conversion

  • Create a conversion chart with powers of two: 1, 2, 4, 8, 16, 32, 64, 128 (for 8 bits).
  • Align the binary number with the conversion chart from right to left.
  • For every binary '1', add the corresponding chart value; for '0', add nothing.
  • Example: 00000010 in binary = 2 in decimal.
  • Example: 10000010 in binary = 128 + 2 = 130 in decimal.
  • Example: 11111111 in binary = 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255 in decimal.

Decimal to Binary Conversion

  • Use the conversion chart and start with the highest value less than or equal to the decimal number.
  • Place a '1' where the chart value fits and subtract; '0' where it doesn't.
  • Example: 154 decimal = 10011010 in binary.
  • Process: Check each power of two in order, filling in bits with 1 or 0.

Calculating Possible Values with Bits

  • Number of possible values with n bits is 2^n.
  • 2 bits: 4 outcomes (00, 01, 10, 11) = 0, 1, 2, 3 decimal.
  • 3 bits: 8 outcomes; 4 bits: 16; 5 bits: 32; 6 bits: 64; 7 bits: 128; etc.
  • Each increase in bit count doubles the number of possible values.

Key Terms & Definitions

  • Bit — a single binary digit, 0 or 1.
  • Byte/Octet — a group of 8 bits.
  • Binary — a base-2 numbering system using only 0 and 1.
  • Decimal — a base-10 numbering system using digits 0–9.
  • Conversion Chart — a table of powers of 2 used to convert binary to decimal and vice versa.

Action Items / Next Steps

  • Practice converting numbers between binary and decimal using the conversion chart.
  • Prepare for the next section on IP subnetting using these binary conversion skills.