Converting ASCII to Binary Explained

Aug 10, 2024

ASCII Code and Binary Conversion

Overview

  • ASCII stands for American Standard Code for Information Interchange.
  • Focus on converting text to binary using an ASCII table.

Conversion of the Word "blue" to Binary

  1. Create a Table:
    | Letter | Decimal Value | Binary Value |
    |--------|---------------|---------------|
    | B | 66 | 1000010 |
    | l | 108 | 1101100 |
    | u | 117 | 1110101 |
    | e | 101 | 1100101 |

Letter Breakdown

  • B (Capital):
    • Decimal: 66
    • Binary Conversion:
      • 64 + 2 = 66
      • Binary: 1000010
  • l (Lowercase):
    • Decimal: 108
    • Binary Conversion:
      • 64 + 32 + 8 + 4 = 108
      • Binary: 1101100
  • u:
    • Decimal: 117
    • Binary Conversion:
      • 64 + 32 + 16 + 4 + 1 = 117
      • Binary: 1110101
  • e:
    • Decimal: 101
    • Binary Conversion:
      • 64 + 32 + 4 + 1 = 101
      • Binary: 1100101

Final Binary for "blue"

  • B: 1000010
  • l: 1101100
  • u: 1110101
  • e: 1100101

Reverse Conversion: Binary to Word

  1. Example Binary Codes:
    • Code 1: 1001100
      • 64 + 8 + 4 = 76
      • Corresponds to: L
    • Code 2: 01100101
      • 64 + 32 + 4 + 1 = 101
      • Corresponds to: e
    • Code 3: 01101101
      • 64 + 32 + 8 + 4 + 1 = 109
      • Corresponds to: m
    • Code 4: 01101111
      • 64 + 32 + 8 + 4 + 2 + 1 = 111
      • Corresponds to: o
    • Code 5: 01101110
      • 64 + 32 + 8 + 4 + 2 = 110
      • Corresponds to: n

Resulting Word

  • The binary codes correspond to the word "lemon".

Conclusion

  • Understanding ASCII is crucial for converting between text and binary codes.