OCR A-Level Computer Science Computer systems (01), June 2025: Question 3

14 marks · Medium difficulty · Calculation

Perform conversions between binary, denary, and hexadecimal, explain the effect of a binary right shift, perform floating-point binary subtraction, and apply a bitwise AND mask.

Practise this question

Question

Question 3 consists of four parts:
(a) Number conversions: (i) denary 189 to 8-bit binary [1 mark], (ii) denary 189 to hexadecimal [1 mark], and (iii) hexadecimal E4 to denary [1 mark].
(b) Explain the effect of a right shift of three places on a positive binary number [2 marks].
(c) Perform floating-point binary subtraction: 011010 0011 minus 010010 0010, where both use a 6-bit mantissa and 4-bit exponent, providing working space and lines for final 6-bit mantissa and 4-bit exponent [6 marks].
(d) (i) Calculate the result of applying a bitwise AND mask of 1010 1110 to the byte 1010 0011 [2 marks], and (ii) state the purpose of the bitwise AND mask [1 mark].
Question text

(a)

(i) Convert the denary number 189 into an 8-bit binary number.

… [1]

(ii) Convert the denary number 189 into a hexadecimal value.

… [1]

(iii) Convert the hexadecimal value E4 into a denary number.

… [1]

(b) Explain the effect that a right shift of three places will have on a positive binary number.

… [2]

(c) Show the subtraction of these two floating point binary numbers.

Both numbers are stored in a normalised floating point format, using 6 bits for the mantissa and 4

for exponent.

You should show your result in the same format.

Show your working out.

011010 0011 – 010010 0010

Working space …

Final 6-bit mantissa …

Final 4-bit exponent …

[6]

(d)

(i) Show the result of applying a bitwise AND mask of 1010 1110 to the byte 1010 0011.

Byte 1010 0011

AND Mask 1010 1110

Result

[2]

(ii) State the purpose of the bitwise AND mask.

… [1]

Mark scheme

Show the mark scheme Mark scheme for Question 3:
3(a)(i) 1011 1101 [1 mark].
(a)(ii) BD [1 mark].
(a)(iii) 228 [1 mark].
(b) 1 mark each up to 2: Divides... by 8 or 2 cubed (Allow: multiplies by 2^-3 or 1/8 or 0.125).
(c) 6 marks total: Both exponents converted (0011 = 3, 0010 = 2), both mantissas shifted (0110.10, 010.010), align mantissas, binary subtraction giving 0100.010, correct mantissa 010001, correct exponent 0011.
(d)(i) 2 marks: Nibble 1 = 1010, Nibble 2 = 0010, giving Result 1010 0010.
(d)(ii) 1 mark: To extract/enable/disable bits in a value (Allow: To encrypt data).

Question Answer Mark Guidance

3 (a) (i) 1011 1101 1

(a) (ii) BD 1

(a) (iii) 228 1

(b) 1 mark for each to max 2 2 Allow: multiplies by 2-3 or ⅛ or 0.125 (1)

● Divides…

● …by 8 / 23

(c) 1 mark for each to max 6 6 Correct answer with valid binary working for

calculation = full marks.

● Both exponents converted

0011 = 3 Where denary working is clearly used to calculate

0010 = 2 the answer, do not allow MP4

● Both mantissas shifted

0110.10 Example of 2’s complement addition

010.010

● Align mantissas: Convert 2nd mantissa to 2’s comp e.g.:

0110.10 010.010 >> 101.11

010.010

● Binary subtraction: 0110.10 +

02 1101.11

0110.100 1 0100.01

0010.010 1111

0100.010

● Correct mantissa 010001

● Correct exponent 0011

(d) (i) 1 mark for each to max 2 2

● Nibble 1 - 1010

● Nibble 2 - 0010

Solution:

Byte 1010 0011

AND Mask 1010 1110

Result 1010 0010

(ii) 1 mark for: 1

● To extract/enable/disable bits in a value Allow: To encrypt data

How to answer it

Data Representation, Floating Point Arithmetic & Bitwise Masks

📌 WHAT THIS QUESTION TESTS

Core Component 01 / Unit 1.1: Data Representation & Bit Manipulation

  • Conversions between denary, 8-bit unsigned binary, and hexadecimal.
  • Mathematical impact of logical/arithmetic right bit shifts on positive integers.
  • Performing floating-point binary subtraction with sign and magnitude/two's complement mantissas, including exponent equalisation, mantissa subtraction, and renormalisation.
  • Applying a bitwise logical AND mask and understanding practical mask applications.
PART (a) • 3 MARKS TOTAL

Number Base Conversions

(i) Denary 189 to Binary | (ii) Denary 189 to Hex | (iii) Hex E4 to Denary

✅ Correct Answers

  • (i): 1011 1101 [1 mark]
  • (ii): BD [1 mark]
  • (iii): 228 [1 mark]

📐 Step-by-Step Conversion

(i) 189 to Binary (place values: 128, 64, 32, 16, 8, 4, 2, 1):
189 = 128 + 32 + 16 + 8 + 4 + 1
Bits: 1 0 1 1 1 1 0 1
(ii) 189 to Hexadecimal via 4-bit nibbles:
Left nibble: 1011 = 8 + 2 + 1 = 11 → B
Right nibble: 1101 = 8 + 4 + 1 = 13 → D
Result = BD
(iii) Hex E4 to Denary:
E = 14 (value in 16s column) → 14 × 16 = 224
4 = 4 (value in 1s column) → 4 × 1 = 4
Total = 224 + 4 = 228

❌ Common Errors

  • Miscounting hex values: confusing B (11) and D (13) with C (12) or E (14). Remember: A=10, B=11, C=12, D=13, E=14, F=15.
  • Writing a 7-bit answer for (i) instead of an 8-bit binary byte.

🧠 Exam Technique Shortcut

Always convert denary to hex by going through binary first! Splitting an 8-bit binary number into two 4-bit nibbles is far less prone to arithmetic mistakes than performing division by 16.

PART (b) • 2 MARKS

Binary Shifts

Explain the effect of a right shift of three places on a positive binary number

✅ Correct Answer

A right shift of 3 places will:

  • Divides the number [1 mark]
  • ...by 8 (or 2³) [1 mark]
Alternative allowed: "Multiplies by 2⁻³", "multiplies by 1/8", or "multiplies by 0.125" [1 mark max if stated as multiplication].

💡 Key Knowledge

Each single shift to the right divides an integer value by 2 (integer division / truncation if bits are discarded):

  • 1 place right = ÷ 2 (2¹)
  • 2 places right = ÷ 4 (2²)
  • 3 places right = ÷ 8 (2³)
  • n places right = ÷ 2ⁿ

❌ Common Errors & Examiner Insight

  • Missing the power: Stating "divides by 3" or "divides by 6" instead of 2³ = 8. Shifts are exponential powers of 2, not linear multiplications!
  • Vague answers: Saying "the number gets smaller" gains zero marks. You must state the exact mathematical operation ("divides") and the factor ("8" or "2³").
PART (c) • 6 MARKS

Floating-Point Binary Subtraction

011010 0011 − 010010 0010 (6-bit mantissa, 4-bit exponent)

📐 Step-by-Step Calculation (The Full 6-Mark Workflow)

Step 1: Decode Exponents and Mantissas [MP1]
Both numbers have an assumed binary point between the 1st and 2nd bits of the mantissa:
  • Number 1: Mantissa = 0.11010 , Exponent = 0011 = +3
  • Number 2: Mantissa = 0.10010 , Exponent = 0010 = +2
Step 2: Equalise Exponents (Align Mantissas) [MP2 & MP3]
To perform subtraction directly, both numbers must share the same exponent. We scale Number 2 up to exponent 0011 (+3) by shifting its mantissa 1 place right:
  • Number 1: 0.11010 × 2³
  • Number 2: 0.01001 × 2³ (shifted right by 1 place; 0 shifted off the end)
Alternative method accepted by mark scheme: Shift binary points to absolute denary/fixed point ( 0110.10 and 0010.010 ).
Step 3: Binary Subtraction [MP4]
Subtract the aligned mantissas (or use Two's Complement addition):
 0 . 1 1 0 1 0(Number 1)
−0 . 0 1 0 0 1(Number 2 aligned)
=0 . 1 0 0 0 1(Difference)
(Check via denary: Number 1 = 6.5, Number 2 = 2.25; 6.5 − 2.25 = 4.25. 0.10001₂ × 2³ = 4.25. Correct!)
Step 4: Check Normalisation & Final Format [MP5 & MP6]
A positive floating-point number is normalised if it begins with 01 .
  • The resulting mantissa 010001 begins with 01 , so it is already normalised!
  • No shifting needed, so the exponent stays 0011 (+3).

✅ Final Answer

Final 6-bit mantissa: 010001 [1 mark]

Final 4-bit exponent: 0011 [1 mark]

🧠 Mark Scheme & Method Warning

Strict Examiner Rule: Where denary working is clearly used to calculate the answer instead of showing binary arithmetic working, MP4 is NOT awarded.

Always show binary column subtraction or two's complement addition clearly in the working space!

PART (d) • 3 MARKS TOTAL

Bitwise Logic Masks

(i) Apply bitwise AND mask | (ii) Purpose of AND mask

📐 (i) Applying the AND Mask

An AND operation outputs 1 only when both bits are 1:

Byte:10100011
AND Mask:10101110
Result:10100010
  • Nibble 1: 1010 [1 mark]
  • Nibble 2: 0010 [1 mark]

✅ (ii) Purpose of Bitwise AND Mask

Purpose:

  • To extract, enable, disable, or clear specific bits in a register/value. [1 mark]
Guidance: "To encrypt data" is also allowed by the mark scheme.

💡 How Bitwise Masks Work in Practice

  • AND with 0: Clears / disables the bit (forces it to 0).
  • AND with 1: Preserves / extracts the bit (leaves it unchanged: 0 AND 1 = 0; 1 AND 1 = 1).
  • Common use cases: Checking if an interrupt flag is set, reading specific sensor pins, or extracting individual RGB colour channels.

❌ Common Misconceptions

  • Confusing AND with OR or XOR: OR masks are used to set bits to 1; XOR masks are used to invert/flip bits.
  • Mixing up bit positions when copying down nibbles. Always line the bits up vertically before applying the logic gate rules.

Topics

1.4 Data types, data structures and algorithms · 1.4.1 Data Types

Question and mark scheme from the OCR A-Level Computer Science examination, Computer systems (01), June 2025. QuestionVault is an independent revision resource; questions remain the copyright of the awarding body.