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.
Reviewed by: AI editorial process; not yet individually human-reviewed
Have a quick question? Jump to the Q&A page
Jump to a section
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 to denary. [1 mark]
- Cue. .
Q2. Represent in 8-bit two's complement. [2 marks]
- Cue. ; invert to ; add 1 to get .
Q3. Convert the denary number to hexadecimal. [1 mark]
- Cue. (or remainder ).
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 in binary, and add it to the 8-bit two's complement representation of , showing your working and interpreting the result.Show worked answer →
Represent (up to 3): start with . Invert all bits: . Add 1: . So .
.
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 , which is correct since . Markers reward the correct two's complement of (invert and add 1), the binary addition, and discarding the final carry to read .
OCR 20214 marksConvert the hexadecimal number to denary, and the denary number to hexadecimal, showing your method.Show worked answer →
Hex to denary (2 marks): has digits and (). Value .
Denary to hex (2 marks): remainder . and , so reading the quotient then remainder gives . Check: . 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
- Floating-point representation of real numbers using a mantissa and an exponent (both in two's complement), normalisation of a floating-point number, and the trade-off between range and precision.
An OCR H446 answer on floating-point representation: storing real numbers with a mantissa and an exponent in two's complement, how to normalise a floating-point number, and the trade-off between range and precision when bits are divided between mantissa and exponent.
- Logic gates (AND, OR, NOT, XOR, NAND, NOR) and their truth tables, constructing and interpreting truth tables, and simplifying Boolean expressions using the laws of Boolean algebra including De Morgan's laws, distribution, association and commutation, and Karnaugh maps.
An OCR H446 answer on Boolean algebra and logic: the logic gates (AND, OR, NOT, XOR, NAND, NOR) and their truth tables, constructing truth tables for an expression, and simplifying Boolean expressions using the laws of Boolean algebra, De Morgan's laws and Karnaugh maps.
- Logic circuits built from gates: the half adder and full adder for binary addition, and the D-type flip-flop as a single-bit memory element, including their truth tables and Boolean expressions.
An OCR H446 answer on logic circuits: the half adder and full adder that perform binary addition (with their sum and carry expressions and truth tables), and the D-type flip-flop that stores a single bit, including how these combine to build arithmetic and memory.
- Primitive data types (integer, real/float, Boolean, character, string) and how text is represented using character sets such as ASCII and Unicode, including the size and range implications of each type.
An OCR H446 answer on primitive data types and text representation: the integer, real, Boolean, character and string types and their storage, and how characters are represented in binary using character sets such as ASCII and Unicode, with their size and range implications.
- Data structures: arrays, records, tuples and lists, the stack and queue abstract data types and their operations, linked lists, trees and graphs, and hash tables, including how each is used and its advantages.
An OCR H446 answer on data structures: arrays, records, tuples and lists, the stack and queue abstract data types with their operations, linked lists, trees, graphs and hash tables, including how each is used and its advantages and disadvantages.