ZIMFundi
Sign inJoin free

Topic 1 of 8 · Form 5

Data representation

Binary, denary, hexadecimal and binary-coded decimal (BCD). 1 kibibyte (KiB) = 1 024 bytes; 1 kilobyte (kB) = 1 000 bytes.

Notes for this topic 1 file, in order

Create a free account to download PDFs.

  1. PDFData representation – Computer Science notes (ZIMSEC A Level)47.5 KB

Number systems

Binary, denary, hexadecimal and binary-coded decimal (BCD). 1 kibibyte (KiB) = 1 024 bytes; 1 kilobyte (kB) = 1 000 bytes.

Negative numbers: two's complement

To find −x in 8 bits, write x in binary, invert all bits and add 1. The most significant bit has place value −128. Range in 8 bits: −128 to +127.

Worked example: Represent −45 in 8-bit two's complement.

45 = 00101101 → invert 11010010 → add 1 → 11010011

Binary arithmetic and overflow

Overflow occurs when a result is too large for the bits available (e.g. two positive numbers giving a negative two's complement result).

Floating point

A number = mantissa × 2^exponent, both in two's complement. Normalised positive mantissas start 01, negative 10, giving maximum precision. More mantissa bits give precision; more exponent bits give range.

Worked example: Mantissa 0.1010000 and exponent 0011 (8-bit mantissa, 4-bit exponent). Find the denary value.

Mantissa = 0.5 + 0.125 = 0.625; exponent = 3 → 0.625 × 2³ = 5

Characters, images and sound

ASCII (7/8 bits) and Unicode; bitmap file size = width × height × colour depth; sound file size = sample rate × bit depth × duration × channels.

Compression

Lossless (run-length encoding, Huffman coding) and lossy (JPEG, MP3).

Exam tip: In two's complement, check your answer by adding the place values, remembering the MSB is negative.

Check yourself

  1. Convert 11110110 (two's complement) to denary.
  2. A 1 024 × 768 image uses 24-bit colour. Find its size in bytes.
  3. Why are floating-point numbers normalised?
Show answers
  1. −128 + 64 + 32 + 16 + 4 + 2 = −10
  2. 1 024 × 768 × 3 = 2 359 296 bytes (2.25 MiB)
  3. To give the maximum precision for a given number of bits and a unique representation.
Next topicComputer architecture and the fetch–execute cycle

Questions about this topic (0)

No questions about this topic yet.