Tuesday, August 19, 2025

C04 The Digital Language of Ones and Zeros


How Computers Store and Represent Data

Dr Sudheendra S G summarizes the core concepts   which explains how computers represent various forms of data using binary code.

I. The Fundamental Principle: Binary Representation

At its core, computer science relies on a binary system, meaning all information is broken down into two fundamental values: "1" (ON, True, Electricity flowing) and "0" (OFF, False, No electricity). This seemingly limited system is powerful enough to represent "any number," as stated in the source.

Key Idea: Computers "think in binary."

II. Representing Numbers in Binary

Similar to our decimal (base-10) system, binary (base-2) uses place values based on powers of its base.

  • Decimal: Uses digits 0-9, with place values of ones, tens, hundreds (e.g., 263 = 2×100 + 6×10 + 3×1).
  • Binary: Uses digits 0 or 1, with place values of ones, twos, fours, eights, etc. (e.g., "101 = 1×4 + 0×2 + 1×1 = 5 in decimal").

Arithmetic operations, such as addition, work similarly in binary to how they do in decimal, with "carrying over" when a sum exceeds the base. For example, in binary, "1+1 = 2, but since binary has no “2,” we write 10."

Key Terms:

  • Bit: Each individual "1" or "0" is called a bit.
  • Byte: Eight bits grouped together form a byte. A byte can represent 256 different values (0 to 255).

III. The Evolution of Data Capacity

The capacity of computers to store and process information is directly related to the number of bits they can handle simultaneously.

  • Early Systems: "8-bit games or 8-bit graphics" were common, limiting systems to "only store 256 colors at once."
  • Modern Systems:32-bit systems: Can represent "over 4 billion different numbers."
  • 64-bit systems: Can represent "About 9.2 quintillion," a number "bigger than Earth’s population many times over."

IV. Representing Complex Numbers

Beyond simple positive integers, computers have methods for representing negative and fractional numbers:

  • Negative Numbers: The "first bit is used as a sign bit — 0 for positive, 1 for negative." This allows 32-bit numbers to range approximately "±2 billion."
  • Decimal/Fractional Numbers (Floating Point): Computers use a system similar to scientific notation. For example, "625.9 = 0.6259 × 10³." Computers store the sign, the exponent, and the "fraction (called the significand)" to represent very small or very large numbers with decimals.

V. From Numbers to Text: Character Encoding

Since computers only understand numbers, text characters are assigned numerical codes.

  • ASCII (American Standard Code for Information Interchange) - 1963:
  • An early 7-bit system, representing "128 symbols (letters, digits, punctuation)."
  • Example: "lowercase ‘a’ = 97, uppercase ‘A’ = 65."
  • Limitation: Primarily designed for English, leading to "mojibake — scrambled text" when dealing with other languages due to incompatible "national codes."
  • Unicode - 1992 (The Solution):
  • Uses "16 bits or more," significantly expanding character capacity.
  • Can represent "over 120,000 characters — every language, math symbols, and even emojis! 🤯"
  • Benefit: Ensures "text looks right everywhere," regardless of language or system.

VI. Beyond Text: Multimedia as Bits

The concept of representing everything digitally extends to various forms of multimedia:

  • Music files (MP3s)
  • Photos (JPEGs)
  • Videos (MP4s)

All these complex data types are "just bits too! Long sequences of 1s and 0s carefully encoded into formats." This underlying binary representation is what allows devices to store and share digital content seamlessly.

Conclusion:

The fundamental takeaway is that "the entire digital universe is built from nothing but 1s and 0s!" Whether it's "numbers in your bank account, the text in a WhatsApp message, or the emojis in your Instagram post — it’s all just bits!" Computers leverage "math, logic, and clever encoding" to translate the diverse world of information into this simple binary language.

 


No comments: