Revise Computingrevisecomputing.co.uk
Free student revisionSee questionsFor schoolsSchool enquiry
Free revisionSee questionsFor schoolsSchool enquiry
Knowledge/A Level/H446/01 Computer systems/Data Types/Convert positive integers between binary…

Convert positive integers between binary, hexadecimal and denary

Convert positive integers between binary hexadecimal and denary

1.4.1 Data Types

Data Types — Note 6 of 10

Candidates should be able to convert denary numbers to hexadecimal and vice-versa and from binary to hexadecimal and vice-versa

What you need to know

You need to convert confidently between binary, hexadecimal and denary in any direction. Binary and hex convert directly using nibbles; denary conversions use place values.

What to know

  • Binary to hex: split into nibbles from the RIGHT, padding with leading zeros, and convert each nibble. 10111101 = 1011 1101 = BD.
  • Hex to binary: convert each hex digit into a 4-bit nibble. 3F = 0011 1111.
  • Hex to denary: multiply each digit by its place value. BD = 11 × 16 + 13 = 189.
  • Denary to hex: divide by 16; the whole-number result is the first digit and the remainder is the second. 189 ÷ 16 = 11 remainder 13, so BD.
  • Alternatively, convert denary to binary first, then binary to hex.

Exam technique

  • Tip:Check your answer by converting it back the other way.
  • Mistake:Splitting binary into nibbles from the LEFT when the number of bits is not a multiple of 4.
← Previous noteRepresent positive integers in hexadecimal1.4.1 Data TypesNext note →Representation and normalisation of floating point numbers in binary1.4.1 Data Types

Back to Data Types

Data Types

Note 6 of 10

  1. 1Primitive data types: integer, real/floating point, character, string and Boolean
  2. 2Represent positive integers in binary
  3. 3Sign and magnitude and two's complement to represent negative numbers
  4. 4Addition and subtraction of binary integers
  5. 5Represent positive integers in hexadecimal
  6. 6Convert positive integers between binary, hexadecimal and denary
  7. 7Representation and normalisation of floating point numbers in binary
  8. 8Floating point arithmetic: addition and subtraction
  9. 9Bitwise manipulation and masks: shifts, combining with AND, OR and XOR
  10. 10How character sets (ASCII and UNICODE) are used to represent text
Topic overview