Skip to main content
EnglandComputer ScienceSyllabus dot point

How are positive and negative whole numbers represented in binary, and how do we convert between binary, denary and hexadecimal?

Number systems: binary, denary and hexadecimal conversion, representing negative numbers with sign and magnitude and two's complement, binary addition and subtraction, fixed-point binary fractions, and the use of hexadecimal and bitwise masks.

An OCR H446 answer on number systems: converting between binary, denary and hexadecimal, representing negative numbers with sign and magnitude and two's complement, binary addition and subtraction, fixed-point binary fractions, and the use of hexadecimal and bitwise masks.

Generated by Claude Opus 4.814 min answer

Reviewed by: AI editorial process; not yet individually human-reviewed

Have a quick question? Jump to the Q&A page

Jump to a section
  1. What this dot point is asking
  2. The answer
  3. Examples in context
  4. Try this

What this dot point is asking

OCR wants fluent conversion between binary, denary and hexadecimal, representation of negative numbers in sign and magnitude and two's complement, binary addition and subtraction, fixed-point binary fractions, and the use of hexadecimal and bitwise masks. This is a calculation-heavy dot point assessed without a calculator.

The answer

Binary, denary and hexadecimal

Representing negative numbers

Binary arithmetic, fixed point and masks

Examples in context

Memory addresses and colour values are written in hexadecimal because it is compact (the colour #FF8000 is three bytes). Two's complement is used inside every processor so one adder circuit can do both addition and subtraction. Bitwise masks set or read individual flag bits in a status register or in file permissions. Fixed-point representation appears where a known range and precision are needed cheaply. OCR links this to floating-point representation and to the logic circuits (adders) that perform the arithmetic.

Try this

Q1. Convert 1011 00111011\,0011 to denary. [1 mark]

  • Cue. 128+32+16+2+1=179128 + 32 + 16 + 2 + 1 = 179.

Q2. Represent −9-9 in 8-bit two's complement. [2 marks]

  • Cue. +9=0000 1001+9 = 0000\,1001; invert to 1111 01101111\,0110; add 1 to get 1111 01111111\,0111.

Q3. Convert the denary number 9090 to hexadecimal. [1 mark]

  • Cue. 90=0101 1010→5A90 = 0101\,1010 \to 5\text{A} (or 90÷16=590 \div 16 = 5 remainder 10=A10 = \text{A}).

Exam-style practice questions

Practice questions written in the style of OCR exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.

OCR 20195 marksUsing 8-bit two's complement, represent −20-20 in binary, and add it to the 8-bit two's complement representation of +35+35, showing your working and interpreting the result.
Show worked answer →

Represent −20-20 (up to 3): start with +20=0001 0100+20 = 0001\,0100. Invert all bits: 1110 10111110\,1011. Add 1: 1110 11001110\,1100. So −20=1110 1100-20 = 1110\,1100.

+35=0010 0011+35 = 0010\,0011.

Add (up to 2):

  0010 0011   (+35)
+ 1110 1100   (-20)
-----------
  0000 1111   (carry out of the 8th bit is discarded)

The 8-bit result is 0000 1111=+150000\,1111 = +15, which is correct since 35+(−20)=1535 + (-20) = 15. Markers reward the correct two's complement of −20-20 (invert and add 1), the binary addition, and discarding the final carry to read +15+15.

OCR 20214 marksConvert the hexadecimal number 2F\text{2F} to denary, and the denary number 206206 to hexadecimal, showing your method.
Show worked answer →

Hex to denary (2 marks): 2F\text{2F} has digits 22 and F\text{F} (=15=15). Value =2×16+15=32+15=47= 2 \times 16 + 15 = 32 + 15 = 47.

Denary to hex (2 marks): 206÷16=12206 \div 16 = 12 remainder 1414. 12=C12 = \text{C} and 14=E14 = \text{E}, so reading the quotient then remainder gives CE\text{CE}. Check: 12×16+14=192+14=20612 \times 16 + 14 = 192 + 14 = 206. Markers reward the place-value method for hex to denary and the divide-by-16 (or four-bit grouping) method for denary to hex, with correct letter digits.

Related dot points

Sources & how we know this