A1.2.1

Describe the principal methods of representing data

Computers store all data in binary using 0 and 1 . Different data types use different encodings .

2 min read268 words
  • Computers store all data in binary using 0 and 1.
  • Different data types use different encodings.

Integers

  • Whole numbers use binary place value.
  • Each bit position = a power of 2.
  • Example: 10110101₂ = 181₁₀

Negative integers

  • Usually use two’s complement — efficiently stores positive and negative values.
  • In an 8-bit system:
    • 00000101 = +5
    • 11111011 = -5

Real numbers

Numbers with fractional parts can use:

  • Fixed-point representation
    • Fixed bits for integer and fractional parts.
    • Simple but limited range/precision.
  • Floating-point representation
    • Stores a number using sign, exponent, and mantissa/significand.
    • Allows a very wide range.
    • May introduce rounding errors.

Text

Each character is stored using a binary code. Common systems:

  • ASCII
    • Originally 7 bits.
    • Suitable for English letters, digits, symbols.
  • Unicode
    • Supports a much larger character set across languages.
    • Commonly implemented using UTF-8 or UTF-16.

Images

  • Images represented as pixels; each pixel stores a colour value.
  • Storage depends on:
    • Resolution — number of pixels.
    • Colour depth — bits per pixel.
  • Examples:
    • 1-bit: each pixel is black or white.
    • 8-bit: 256 possible values.
    • 24-bit: 8 bits each for red, green, blue.

Sound

  • Sound represented by sampling an analogue wave at regular intervals.
  • Each sample is quantized and stored in binary.
  • Quality depends on:
    • Sampling rate — samples per second.
    • Bit depth — bits per sample.

Boolean data

  • Stores only two possible states:
    • true / false
    • 1 / 0
    • on / off
  • Heavily used in logic circuits and programming conditions.

Start typing to search all published objectives.