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

Represent positive integers in binary

1.4.1 Data Types

Data Types — Note 2 of 10

Candidates should understand how and why computers store data as binary using switches, and that a binary number can have a variety of different interpretations depending on what is being stored (e.g. numeric, text, image, sound). Candidates should be able to convert positive whole numbers to binary and from binary to decimal/denary

What you need to know

Computers store all data in binary because their components (transistors) have two states. A binary number can represent a number, a character, part of an image or a sound sample: its meaning depends on how it is interpreted.

What to know

  • Computers use binary because their switches (transistors) have two states, on and off, which are reliable to distinguish.
  • The same bit pattern can represent different things (a number, text, part of an image or sound) depending on how it is interpreted.
  • Place values in 8 bits: 128 64 32 16 8 4 2 1.
  • Binary to denary: add the place values where there is a 1.
  • Denary to binary: working from the largest place value, put a 1 if it fits and subtract it, otherwise put 0.
  • With n bits, unsigned integers from 0 to 2^n - 1 can be represented.

Key terms

Binary

A base 2 number system using only the digits 0 and 1.

Exam technique

  • Tip:Write out the place value headings each time to avoid mistakes.
← Previous notePrimitive data types: integer, real/floating point, character, string and Boolean1.4.1 Data TypesNext note →Sign and magnitude and two's complement to represent negative numbers1.4.1 Data Types

Back to Data Types

Data Types

Note 2 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