Data Representation and Logic Gates – OCR A Level Computer Science lessons (H446)
Thirteen Year 12 lessons on binary and hex, sign and magnitude, two's complement, shifts, bitwise masks, character sets and logic gates.
Students move from GCSE binary to signed integers, binary arithmetic with overflow, hexadecimal, bitwise shifts and masks, and character sets. They then define problems with Boolean logic, logic gate diagrams and truth tables, ready for Boolean algebra in Year 13.
Unit 12.3 is taught in Year 12, Autumn 2, and answers one big question: How can only 1s and 0s store every number and character?
What happens in each lesson:
Lesson 1, Binary, denary and hexadecimal conversions: Why do programmers write binary as hexadecimal? Main task: calculate the hexadecimal and denary values of the Wrenhome Sensors sensor ID 1011 0110 0011 1101, showing your working, and explain why the engineers write IDs in hexadecimal (6 marks).
Lesson 2, Sign and magnitude: How can a pattern of bits show a negative number? Main task: write the Wrenhome Sensors freezer readings −19 and +45 in 8-bit sign and magnitude, and explain two problems with using sign and magnitude for the company's temperature readings (6 marks).
Lesson 3, Two's complement: Why do almost all computers use two's complement? Main task: write the Wrenhome Sensors readings −37 and −128 in 8-bit two's complement, calculate the denary value of 1110 0110, and explain why the sensors store temperatures in two's complement (7 marks).
Lesson 4, Binary addition and overflow: What happens when an answer is too big for its bits? Main task: calculate the 8-bit unsigned sum of the Wrenhome Sensors motion counts 1011 0110 and 0110 1011, showing all carries, and explain what has happened to the result and its effect on the daily count (5 marks).
Lesson 5, Binary subtraction with two's complement: How can a processor subtract using only an adder? Main task: calculate 0101 1010 − 0010 0111 using two's complement addition, showing your working, to find the difference between two Wrenhome Sensors humidity readings, and check the answer in denary (5 marks).
Lesson 6, Logical and arithmetic shifts: How can moving bits multiply or divide a number? Main task: calculate the result of a logical right shift of 2 on the Wrenhome Sensors light reading 1101 0100 and of an arithmetic right shift of 2 on the two's complement temperature 1110 1000, and explain the effect of each shift on the value (6 marks).
Lesson 7, Bitwise masks: AND, OR and XOR: How can one byte report several things at once? Main task: write the mask and operation that isolates bit 1 (battery low) of a Wrenhome Sensors door sensor's status byte 0100 0011, then those that set bit 7 (tamper) and flip bit 0 (door open), giving each result (6 marks).
Lesson 8, Character sets: ASCII and Unicode: How does a computer store text in every language? Main task: compare ASCII and Unicode for the messages shown in Wrenhome Sensors's app, which is sold in the UK, Poland and Japan, and justify which the company should use (6 marks).
Lesson 9, Logic gates and truth tables: How do simple gates make every decision a computer takes? Main task: complete the truth tables for the six gates, and identify which single gate Wrenhome Sensors should use to sound a buzzer when exactly one of two window sensors reports open (6 marks).
Lesson 10, Logic gate diagrams with three inputs: How do you turn a circuit into an expression and back? Main task: draw the logic circuit for Q = (A ∧ B) ∨ ¬C, which Wrenhome Sensors's hub uses to switch on the hall light (A motion, B dark, C owner at home), and complete its truth table (6 marks).
Lesson 11, Defining problems with Boolean logic: How do you turn a written rule into Boolean logic? Main task: write a Boolean expression for Wrenhome Sensors's alarm rule – sound the alarm (Q) when the system is armed (A) and either a door is opened (D) or motion is detected (M) – and prove it with a truth table (6 marks).
Lesson 12, Exam skills: calculation questions without a calculator: How do you earn every mark when a calculation goes wrong? Main task: calculate, showing your working, the 8-bit two's complement result of subtracting the Wrenhome Sensors reading 3A (hexadecimal) from 25 (hexadecimal), and give the answer in hexadecimal and denary (6 marks).
Lesson 13, Progress Check: 36 multiple-choice questions (homework or the start of the lesson) + a 40-mark written paper in the lesson (45 minutes)
- Misconceptions it tackles include
- “Hexadecimal takes up less memory than binary”; “In sign and magnitude, the MSB has a place value of 128”; “To make a negative two's complement number, flip the bits and stop”. Each is planned into a hinge question before the main task or an exit question, so you find out who still holds it.
- OCR H446 specification coverage
- 1.4.1 (a)–(f), (i), (j), primitive data types (taught in 12.2); positive integers in binary and hexadecimal; negative integers in sign and magnitude and two's complement; addition and subtraction of binary integers; conversion between binary, hexadecimal and denary; bitwise shifts and masks combined with AND, OR and XOR; how ASCII and Unicode represent text; 1.4.3 (a), (d), defining problems using Boolean logic; logic gate diagrams and truth tables (Boolean algebra, Karnaugh maps, adders and flip-flops follow in 13.3).
It builds on GCSE Computer Science data representation (binary, denary and hexadecimal, binary addition, overflow, logical shifts, ASCII and Unicode) and Boolean logic (AND, OR and NOT gates and truth tables); 12.1 Processors and Architecture (registers hold and buses carry binary patterns); and 12.2, where primitive data types, casting and Boolean conditions were taught. It leads on to 12.7 Assembly Language (machine code and hexadecimal), 12.11 Compression, Encryption and Hashing (XOR in the Vernam cipher, character sets and file size), 13.1 Floating point (a two's complement mantissa and exponent, normalising by shifting) and 13.3 Boolean Algebra and Logic Circuits (Karnaugh maps, adders and D-type flip-flops).
- Adapting it for your school
- Wrenhome Sensors is a fictional company. Swap it for any connected device students know, such as a fitness tracker or the school's heating system; the bit patterns stay the same. The unit needs only 12.1, but is placed after 12.2 so that casting and Boolean conditions are fresh: lessons 8 and 11 refer back to them. Classes confident with GCSE conversions can move quickly through lesson 1, but keep its two misconceptions about grouping bits and answering in the base asked. Every lesson is on paper, so the unit can be taught in any room. Calculators are not allowed in either H446 paper: keep them out of these lessons.
An independent resource written for OCR A Level Computer Science (H446). It is not endorsed by OCR or Cambridge University Press & Assessment. Programming project (NEA) lessons teach general skills on a made-up example project and give supervised time, within JCQ's rules on the help a centre may give.
What's included
- 13 lesson slide decks (PowerPoint)
- 13 lesson plans (Word)
- 13 worksheets, plus 12 support versions with scaffolds (Word)
- 1 exam-style paper with mark scheme (Word)
- Medium term plan with intent, key words, misconceptions and adaptive teaching notes (Word)
- Progress Check lesson to assess the unit
- Exam skills - calculation questions without a calculator - Quiz Quiz Trade Cards
- Department licence: every teacher in your department can use and adapt it
In this bundle
Worth £52 bought separately at £4 a lesson. The bundle saves you 13%.
More for A Level Computer Science
See allFifteen Year 12 lessons on registers, buses, the fetch–decode–execute cycle, performance, pipelining, CISC and RISC, GPUs and storage.
Free sample lessonSixteen Year 12 lessons on programming foundations: variables, selection, iteration, subroutines, parameters, files and computational thinking.
Free sample lessonFifteen Year 12 lessons on linear and binary search, bubble, insertion, merge and quick sort, and recursion, plus Bebras practice.
Free sample lessonWritten for the specifications named. Not endorsed by or affiliated with any exam board.