AS and A Level OCR AS/A Level Computer Science
Data types (1.4.1)
Navigate to resources by choosing units within one of the unit groups shown below.
Introduction
Overview
Delivery guides are designed to represent a body of knowledge about teaching a particular topic and contain:
- Content: A clear outline of the content covered by the delivery guide;
- Thinking Conceptually: Expert guidance on the key concepts involved, common difficulties students may have, approaches to teaching that can help students understand these concepts and how this topic links conceptually to other areas of the subject;
- Thinking Contextually: A range of suggested teaching activities using a variety of themes so that different activities can be selected which best suit particular classes, learning styles or teaching approaches.
Curriculum content
Overview
a) Primitive data types, integer, real/floating point, character, string and Boolean
b) Represent positive integers in binary.
c) Use of Sign and Magnitude and Two’s Complement to represent negative numbers in binary.
d) Addition and subtraction of binary integers.
e) Represent positive integers in hexadecimal
f) Convert positive integers between Binary Hexadecimal and denary
g) Representation and normalisation of floating point numbers in binary.
h) Floating point arithmetic, positive and negative numbers, addition and subtraction.
i) Bitwise manipulation and masks: shifts, combining with AND, OR, and XOR.
j) How character sets (ASCII and UNICODE) are used to represent text.
Numbers and Binary addition
Thinking conceptually
Overview
Data types are the fundamental building block of understanding about how data is stored in a computer program.
It is important that students have an appreciation of how the computer stores data and carries out calculations even though these may not be used in many day-to-day programming activities and can therefore even be considered esoteric. Some might say it is important that you draw this line as to not put off students from entering the field after study as it is one of the more ‘dry’ parts of the course content. A good proportion of those in industry who ‘code’ might never touch binary, let alone bitwise operators.
Common misconceptions or difficulties students may have
Students usually have issues with treating numbers in a different way than they are normally used to, but this is something that students must overcome. There are mathematical components such as addition, multiplication and using exponents that students should have a solid grasp of before starting this part of the course. Students’ learning and understanding will benefit through having worked-through examples to reference and lots of practice. Parallels could be drawn between these and puzzles such as Sudoku in that they require you to have lots of practice to become versed in doing the calculations and complete them with speed.
It also must be noted that the subject matter isn’t particularly relatable to real life and so can seem quite abstract and dull at times. It would be a good idea to weave in and out of this topic with something that is a bit less taxing on the mind. It might, for example, be a good idea to cover a topic like 1.5.2 Moral and Ethical Issues at the same time, so that this topic has chance to sink in and helps to maintain student interest.
This may also give some time to get exemplar questions completed for homework or as lesson starters/plenaries to help students remember, and if students have any large problems with it from a mathematical perspective and need any additional help.
Conceptual links to other areas of the specification – useful ways to approach this topic to set students up for topics later in the course.
Other areas of the specification that would link to Data Types are 1.4.2 Data Structures and 1.4.3 Boolean Algebra. It would be advised that this topic is taught first as it covers primitive data types.
This topic also has a direct link to the programming element and so if possible, it would be good to teach points a) and j) using an actual programming language such as:
- Python
- C family of languages (for example C# C+ etc.)
- Java
- Visual Basic
- Delphi.
Thinking contextually
Overview
ACTIVITIES
Unless the learner has studied Computer Science before, it is unlikely that they have come across many of the data types present since we are unlikely to encounter them outside the realm of the subject area.
It is suggested that:
- Lots of examples are given
- Perhaps get students to make up their own examples as this can make the process seem more real and meaningful
- Where possible using an actual programming language to demonstrate examples such as points a) and j) would make it more practical and therefore meaningful for students.
Denary to Hex conversion jigsaw
This activity works best in pairs or groups of 3. It addresses misconceptions and provides practice of converting Denary to Hex.
Cut out the 24 triangular jigsaw pieces for each group.
The group task is to match sides to create a hexagon from the triangular pieces.
Use matching pairs to further consolidate concepts, for example: 38 = 26h and 61 = 3Dh
Ask students how many possible sets of numbers they can find.
Furthermore students could find ASCII equivalents (see 'ASCII Table' resource).
Further jigsaws can be created yourself using freely available Tarsia software (see 'Further jigsaws' resource).
Bitwise manipulation activity
Each member of the class should be given one of the unfilled worksheets.
The students should fill in these worksheets using what they have learnt about bitwise manipulation and shifting in order to consolidate their learning.
Binary numbers
Binary numbers game
Acknowledgements
Overview
OCR’s resources are provided to support the teaching of OCR specifications, but in no way constitute an endorsed teaching method that is required by the Board and the decision to use them lies with the individual teacher. Whilst every effort is made to ensure the accuracy of the content, OCR cannot be held responsible for any errors or omissions within these resources. We update our resources on a regular basis, so please check the OCR website to ensure you have the most up to date version.
© OCR 2015 - This resource may be freely copied and distributed, as long as the OCR logo and this message remain intact and OCR is acknowledged as the originator of this work.