Syllabus: AS Level Computer Science
Paper 1
Theory Fundamentals
1Information representation
2Communication
3Hardware
4Processor fundamentals
6Security, privacy and data integrity
7Ethics and ownership
Paper 2
Fundamental Problem-solving and Programming Skills
9Algorithm design and problem-solving
10Data types and structures
11Programming
1.1 Free
Data representation
Number systems, binary, hexadecimal, BCD, two's complement and character sets.
Representing numbers
Computers store everything as binary. For whole numbers you can use:
- Unsigned binary for numbers that are never negative.
- Two's complement for positive and negative numbers.
Two's complement in three steps
To write -13 in 8 bits:
- 1Write +13 in binary:
00001101 - 2Invert every bit:
11110010 - 3Add 1:
11110011
So -13 is 11110011.
Binary coded decimal (BCD)
Each denary digit is stored in its own 4-bit group. The number 259 becomes:
0010 0101 1001
2 5 9BCD is easy to read and display but uses more bits than pure binary.
Check yourself
- 1Write -20 in 8-bit two's complement.
- 2Write 4071 in BCD.
Answers: 1) 11101100 2) 0100 0000 0111 0001