Skip to content
Marlbridge

Flashcards · 2210 · Topic 1

Data representation flashcards

16 cards on Topic 1. Pick a subtopic or study them all.

Study mode needs JavaScript. Every card is listed below, so you can still cover the answers and test yourself.

All 16 cards

For a quick read-through or printing. Cover the right-hand side to test yourself.

Topic 1: Data representation

How do you convert a denary number to binary by division?
Divide by 2 repeatedly, writing down each remainder, until you reach 0. Read the remainders from the bottom upwards.
Why is hexadecimal used rather than binary?
It is far more compact, and each hex digit maps to exactly four binary digits, so conversion is simple and human error is less likely. Used for memory addresses, MAC addresses, colour codes and error codes.
Convert denary 205 to hexadecimal
205 = 128 + 64 + 8 + 4 + 1 = 11001101. Split into nibbles from the right: 1100 = C and 1101 = D, so 205 = CD.
What is overflow?
The result of a calculation is too large for the number of bits allocated, so the stored value is incorrect. In 8 bits the largest unsigned value is 255.
What does a binary shift of n places do?
A left shift of n places multiplies by 2ⁿ; a right shift of n places divides by 2ⁿ, discarding any remainder. Bits shifted out are lost and zeros are shifted in.
What is the range of an 8-bit two's complement integer?
-128 to +127. The most significant bit has a place value of -128; a leading 1 means the number is negative.
Convert -45 to 8-bit two's complement
+45 = 00101101. Invert every bit: 11010010. Add 1: 11010011. Check: -128 + 64 + 16 + 2 + 1 = -45.
Convert the two's complement number 11101100 to denary
Add the place values, using -128 for the first bit: -128 + 64 + 32 + 8 + 4 = -20.
ASCII vs Unicode
ASCII uses 7 bits (128 characters); extended ASCII uses 8 bits (256). Unicode can use up to 32 bits per character to cover a very wide range of the world's scripts, so text files are larger.
Why was Unicode introduced?
ASCII could not represent non-Latin writing systems such as Arabic, Chinese or Urdu, so a larger character set was needed.
Resolution and colour depth of a bitmap image
Resolution: the number of pixels. Colour depth: bits per pixel; n bits give 2ⁿ colours. Higher values give better quality but larger files.
Sample rate and bit depth of a sound file
Sample rate: samples per second (Hz). Bit depth (sample resolution): bits per sample. Raising either records the wave more accurately but increases file size.
An image is 800 × 600 pixels with 24-bit colour. What is its file size in MiB?
800 × 600 × 24 = 11,520,000 bits ÷ 8 = 1,440,000 bytes ÷ 1024 = 1406.25 KiB ÷ 1024 ≈ 1.37 MiB.
List the 2210 storage units from bit to exbibyte
Bit, nibble (4 bits), byte (8 bits), KiB, MiB, GiB, TiB, PiB, EiB. From the kibibyte (1024 bytes) up, each unit is 1024 times the one before.
When must lossless compression be used, and what does lossy compression do?
Lossless is needed where every bit matters (text, program files, spreadsheets), as the original is fully recovered. Lossy permanently removes data, e.g. by reducing resolution, colour depth or sample rate; used for images, audio, video.
Can run-length encoding make a file larger?
Yes. RLE stores each run as a value and a count, so on noisy or photographic data with few repeated adjacent values it can produce a file larger than the original.