This topic covers the fundamental representation and storage of data within computer systems, including primitive data types and binary arithmetic. It expl
Topic Synopsis
This topic covers the fundamental representation and storage of data within computer systems, including primitive data types and binary arithmetic. It explores how integers, real numbers, and characters are represented, manipulated, and converted between different bases, alongside the use of bitwise operations and character sets.
Key Concepts & Core Principles
- Primitive data types: integer (whole numbers), real/float (numbers with decimal points), Boolean (true/false), character (single letter or symbol), string (sequence of characters).
- Composite data types: arrays (fixed-size collection of same type), records (collection of different types), lists (dynamic-size collection).
- Type casting: converting one data type to another, e.g., int('5') converts string to integer. Implicit casting happens automatically (e.g., int + float → float), while explicit casting requires programmer intervention.
- Range and precision: integers have a fixed range (e.g., -2^31 to 2^31-1 for 32-bit), floats have limited precision (e.g., 7 decimal digits for single precision). Overflow occurs when a value exceeds the range.
- Mutable vs immutable: strings in Python are immutable (cannot be changed after creation), while lists are mutable. This affects how data is handled in memory.
Exam Tips & Revision Strategies
- Always show your working for binary arithmetic and base conversions to gain method marks
- Double-check the sign of the result when performing two's complement arithmetic
- Practice normalising floating point numbers until the process is automatic
- Remember that Unicode is a superset of ASCII
Common Misconceptions & Mistakes to Avoid
- Confusing sign and magnitude with two's complement representation
- Incorrectly normalising floating point numbers (e.g., failing to ensure the mantissa starts with 0.1 or 1.0 depending on the convention)
- Errors in binary subtraction when borrowing
- Misinterpreting bitwise shift operations (logical vs arithmetic shifts)
Examiner Marking Points
- Representation of positive integers in binary
- Use of sign and magnitude and two's complement for negative numbers
- Binary addition and subtraction
- Conversion between binary, hexadecimal, and denary
- Representation and normalisation of floating point numbers
- Floating point arithmetic (addition and subtraction)
- Bitwise manipulation using shifts and masks (AND, OR, XOR)
- Understanding of ASCII and Unicode character sets