Computer Science IGCSE Chapter 1 Notes
Computer Science IGCSE Chapter 1 Notes
Eg. 4810
1000 100 10 1
Number 4 8 1 0
4810 = (4*1000) + (8*100) + (1*10) + (1*0)
Binary System
Computer use Binary System
Binary System is a base 2 system with only two digit (bit) 0 or 1.
For Example : 1011
In Binary, the place value = (2n) where n is increased from right to left
23 22 21 20
Place Value
8 4 2 1
Number 1 0 1 1
Converting Binary to Denary
Example1 : Find the equivalent denary number of 10101101
Place value 27 26 25 24 23 22 21 20
128 64 32 16 8 4 2 1
1 0 1 0 1 1 0 1
128 + 32 + 8+ 4+ 1=173
10101101=173
Converting Binary to Denary
Example1 : Find the equivalent Denary number of 1100
8 4 2 1
1 1 0 0
8 + 4 = 12
1100 = 12
Converting Denary to Binary (Method 1)
Example1 : Find the equivalent Binary number of 69
27 26 25 24 23 22 21 20
128 64 32 16 8 4 2 1
0 1 0 0 0 1 0 1
69 – 64 = 5
5 - 4= 1
1 - 1= 0
69 = 01000101
Converting Denary to Binary (Method 1)
Example1 : Find the equivalent Binary number of 213
Place 27 26 25 24 23 22 21 20
Value
128 64 32 16 8 4 2 1
1 1 0 1 0 1 0 1
213 – 128 = 85
85 - 64= 21
21 - 16= 5
5- 4 = 1
1 - 1= 0
213 = 11010101
Converting Decimal to Binary (Method 2)
For example : Find the equivalent Binary number of 69
2 69 R
2 34 1
2 17 0
2 8 1
2 4 0 Bottom to up
2 2 0
2 1 0
0 1
2 213 R
2 106 1
2 53 0
2 26 1
2 13 0 Bottom to up
2 6 1
2 3 0
2 1 1
0 1
If the download speed for internet is 32 megabit per second, how long
would it take to download a 40 MB file (in second)?
32 megabit= 4MB
4MB = 1 sec
40MB = 10 sec
Usage of Binary number
Register
Is a group of bit
1 0 1 1 0 1 0 1
Can store data, instruction and address.
When computers (or microprocessors) are used to control devices
(such as robots), registers are used as part of the control system.
Example
The following example describes how registers can be used in controlling a simple
device. A robot vacuum cleaner has three wheels, A, B and C. A rotates on a
spindle to allow for direction changes B and C are fixed to revolve around their
axles to provide only forward and backward movement, and have an electric motor
attached:
An 8-bit register is used to control the movement of the robot vacuum cleaner:
If the register contains 1 0 1 0 0 1 0 1
‘motor B is ON and motor C is ON
and both motors are turning to produce
Backward motion’.
The vacuum cleaner is moving Backword
Hexadecimal System (hex)
Hexadecimal is another number system used by computers.
Hexadecimal is a base 16 system with digits
0,1,2,3,4,5,6,7,8,9, A(=10), B (=11), C (=12), D (=13), E (=14),
F (=15)
In Hexadecimal, the place value is power of 16 (16n) in which the
power(n) is increased from right to left
For Example : 1A9
1 1 1 1
F=15=1111
Binary used 4 bit to represent hexadecimal
Hexadecimal can be used to write large binary number is just a few
digit which makes it easier to read, write and understand.
Hexadecimal
HEXA Denary Binary HEXA Denary Binary
0 0 0000 A 10 1010
1 1 0001 B 11 1011
8421
2 2 0010 C 12 1100
3 3 0011 D 13 1101
8421 8421
4 4 0100 E 14 1110
5 5 0101 F 15 1111
6 6 0110
7 7 0111
8 8 1000
9 9 1010
Converting binary to Hexadecimal
For Example 1:
101111100001
Split this into 4 bit group
11 14 1
B E 1
I01I11100001= BE1
Converting binary to Hexadecimal
For Example 2: 10000111111101
2 1 F D
45A=010001011010
Converting Hexadecimal to Binary
For Example 1:
2BF
2 B F
8421 8421 8421
0010 1011 1111
2BF=001010111111
Converting Hexadecimal to Decimal
For Example : 45A
162 161 160
4 5 A
45A= 1114
multiply each digit by its place
value
Add the totals together
Converting Hexadecimal to Decimal
For Example : 2BF
162 161 160
2 B F
2BF= 703
multiply each digit by its place
value
Add the totals together
Exercise
1. Find the hexadecimal number of 1 1 0 0 0 0 1 1
2. Find the binary number of B F 0
Converting Decimal to Hexadecimal
16 162 R Hexa
16 10 2 2
Bottom to up
0 10 A
16 2004 R Hexa
16 125 4 4
16 7 13 D Bottom to up
0 7 7