A Level Computer Science · Topic guide

Data Types, Data Structures and Boolean Algebra

Data types, data structures and Boolean algebra is the A Level Computer Science topic covering how computers represent numbers, characters and logical values in binary, how data is organised into structures such as arrays, records, stacks and queues, and how Boolean expressions can be simplified using logic laws. It is a foundation topic of the Component 1 Computer Systems paper.

A LevelComponent 1: Computer SystemsOCR H446

Before you start

No specific prerequisites - this is a good place to start.

Method

  1. Convert between denary, binary and hexadecimal for unsigned integers, splitting binary into 4-bit nibbles to convert to hexadecimal quickly.
  2. Represent negative numbers in two's complement by inverting the bits of the positive value and adding 1, and add two's complement numbers by adding the bits and discarding any final carry.
  3. Represent floating point numbers using a normalised mantissa and exponent, and recognise how allocating more bits to each affects range and precision.
  4. Choose the correct abstract data type (array, record, stack, queue, linked list) for a given scenario, based on how the data needs to be accessed and ordered.
  5. Trace pseudocode that pushes, pops, enqueues or dequeues from a stack or queue, keeping careful track of any pointer (such as top, front or rear).
  6. Simplify Boolean expressions using truth tables and laws (e.g. De Morgan's laws) before implementing them as simplified logic circuits or IF conditions.

Worked example

Represent the denary number -58 as an 8-bit two's complement binary number. Show your working.

  1. Convert 58 to 8-bit unsigned binary: 58 = 32+16+8+2 = 00111010.
  2. Invert every bit: 00111010 becomes 11000101.
  3. Add 1 to the inverted result: 11000101 + 1 = 11000110.
  4. Final answer: -58 in 8-bit two's complement is 11000110.

Practice questions

Try each question, then tap to reveal the answer.

Exam-style questions

Written in the style of a A Level Computer Science exam paper, with a full mark scheme.

Q1[2 marks]

Convert the hexadecimal value 3C into an 8-bit binary number, and state its denary value.

Q2[4 marks]

Add the 8-bit two's complement numbers 01100100 and 00100000 in binary, showing your working, and state the resulting bit pattern. Explain whether overflow has occurred.

Q3[3 marks]

A vending machine's control logic should dispense a snack only if a coin has been inserted (hasCoin) and the item is in stock (inStock), unless the machine is in maintenance mode (maintenance), in which case it should never dispense. Write a single Boolean expression, using AND, OR and NOT, for 'dispense', and state its value when hasCoin = TRUE, inStock = TRUE and maintenance = TRUE.

Free printable worksheet

Want more practice on paper? Download the data types, data structures and boolean algebra worksheet pack - 15 pages of exam-style questions with a full mark scheme. No sign-up, no email wall - just the PDF, free for personal and classroom use.

Build a full practice pack.

This topic is one of hundreds in the library - pick the ones a student needs and generate a printable PDF in minutes.