AQA A-Level Computer Science: Data Representation
6 exam-style questions with full mark schemes and model answers. Write your own answer and the AI examiner marks it against the mark scheme.
A processor uses 8-bit registers. Answer each part, showing your working.
(a) The denary value 214 is to be stored.
- (i) Convert 214 to 8-bit unsigned binary. [1]
- (ii) Convert your answer to (i) to hexadecimal. [1]
- (iii) Convert the hexadecimal value
9Cto denary. [1]
(b) The two 8-bit unsigned values 10110101 and 01011010 are added together. Perform the binary addition, state the 8-bit value that is actually stored in the register, and explain how the processor knows that the result is incorrect. [3]
(c) The register now holds signed integers in two's complement.
- (i) Represent −45 in 8-bit two's complement. [2]
- (ii) State the range of denary values that an 8-bit two's complement register can hold. [1]
(d) The value 26 (00011010) undergoes a logical shift left of 1 place, and separately the two's complement value −40 (11011000) undergoes an arithmetic shift right of 1 place. Give the resulting bit pattern in each case and state the arithmetic effect of each shift. [3]
A computer stores real numbers in floating point using a 6-bit two's complement mantissa (1 sign bit + 5 fraction bits, with the binary point immediately after the sign bit) and a 4-bit two's complement exponent.
(a) A floating-point number is stored with mantissa 010110 and exponent 0011. Convert this number to denary, showing the value of the exponent, the value of the mantissa, and the final result. [4]
(b) Represent the denary value −3.5 in this format. Your mantissa must be normalised. Show all your working, including the normalisation and the two's complement negation, and state the final mantissa and exponent. [5]
An uncompressed bitmap image has the following properties.
| Property | Value |
|---|---|
| Width | 1024 pixels |
| Height | 768 pixels |
| Colour depth | 24 bits per pixel |
(a) Calculate the size of the uncompressed image, giving your answer in mebibytes (MiB). Show your working in clear steps (bits, then bytes, then MiB). [4]
(b) State how many distinct colours a colour depth of 24 bits per pixel can represent, and explain briefly why. [2]
A status byte holds the value 11001010. Each part below applies a bitwise mask to this same original byte. For each part, give the resulting 8-bit pattern and name the effect on the masked bits.
(a) 11001010 AND 00001111. [2]
(b) 11001010 OR 11110000. [1]
(c) 11001010 XOR 00001111. [2]
(a) Explain the difference between lossy and lossless compression, and give one example of data for which each is appropriate. [2]
(b) One row of a two-colour bitmap (W = white, B = black) is shown below.
WWWWWWWWWWWWBBBBWWWWWWWWWWWW
Show how run-length encoding (RLE) compresses this row, and state whether RLE is lossy or lossless. [2]
(a) State how many bits there are in a nibble and how many bits there are in a byte. [1]
(b) A file is exactly 3 MiB in size. Calculate its size in bytes. [1]
(c) Explain the difference between a kilobyte (kB) and a kibibyte (KiB). [1]