Data Representation in Computer Systems - Bits, Data Types, and Operations

Overview of Data Representation

  • Data representation in computer systems defines how information—including numbers, characters, images, and audio—is encoded, stored, and processed using digital electronic circuitry.

  • Core topics covered in this module include:

    • Bits, data types, and computer operations.

    • Signed integer representations, specifically Two's complement.

    • Base conversions across standard computing bases (binary, decimal, octal, and hexadecimal).

Part-1 Topic Overview

Bits, Bytes, and Data Storage Units

  • Bits (Binary Digits):

    • A bit is the fundamental, smallest unit of digital information in computing systems.

    • A single bit can hold only one of two possible binary states:

    • 00: Off, false, low, or no signal present.

    • 11: On, true, high, or active signal present.

    • Hardware Physical Representations:

    • Electrical Voltage: Low voltage vs. high voltage.

    • Magnetic State: North polarity vs. south polarity on magnetic storage media.

    • Optical Light: Light OFF vs. light ON in fiber-optic communications.

    • Conceptual Analogies:

    • Light Bulb: Light OFF represents 00; Light ON represents 11.

    • Coin Flip: Heads represents 00; Tails represents 11.

  • Bytes:

    • A byte is a standardized sequence of 88 bits (1 byte=8 bits1\,\text{byte} = 8\,\text{bits}).

    • An 8-bit byte can represent 28=2562^8 = 256 distinct values.

    • Unsigned Interpretation (Non-negative numbers only):

    • Numeric Range: 0→2550 \rightarrow 255

    • Minimum Value: 000000002=01000000000_2 = 0_{10}

    • Maximum Value: 111111112=2551011111111_2 = 255_{10}

    • Signed Interpretation (Using Two's Complement):

    • Numeric Range: −128→+127-128 \rightarrow +127

    • Minimum Value: 100000002=−1281010000000_2 = -128_{10}

    • Maximum Value: 011111112=+1271001111111_2 = +127_{10}

    • Conversion Examples for 8-Bit Storage:

    • Decimal 6565 in 8-bit unsigned binary: Repeated division by 22 yields 01000001201000001_2 (which also corresponds to the ASCII code for the letter 'A').

    • Decimal 200200 in 8-bit unsigned binary: Repeated division by 22 yields 11001000211001000_2

    • Decimal −5-5 in 8-bit signed binary (Two's Complement):

      1. Write positive value +5+5 in binary: 00000101200000101_2

      2. Invert all bits (One's Complement): 11111010211111010_2

      3. Add 11 to the result: 11111011211111011_2 (represents −510-5_{10})

  • Larger Storage Units:

    • Digital storage scales exponentially in powers of 22 (210=10242^{10} = 1024):

    • 1 Kilobyte (KB)=1024 bytes1\,\text{Kilobyte (KB)} = 1024\,\text{bytes}

    • 1 Megabyte (MB)=1024 KB=1,048,576 bytes1\,\text{Megabyte (MB)} = 1024\,\text{KB} = 1,048,576\,\text{bytes}

    • 1 Gigabyte (GB)=1024 MB=1,073,741,824 bytes1\,\text{Gigabyte (GB)} = 1024\,\text{MB} = 1,073,741,824\,\text{bytes}

    • 1 Terabyte (TB)=1024 GB1\,\text{Terabyte (TB)} = 1024\,\text{GB}

    • Real-World Data Size Benchmarks:

    • Plain Text Character (e.g., 'A'): 1 byte1\,\text{byte} in ASCII.

    • Short Word (e.g., `