Computer Science Chapter 1 - Binary Systems and Hexadecimal
Computer Science Chapter 1 - Binary Systems and Hexadecimal
Binary System
11
Date: _________________________________
Lesson (1)
Hundred Ten
Thousands Hundreds Tens Ones
Thousands Thousands
100000 10000 1000 100 10 1
105 104 103 102 101 100
3 7 5
0 0 0
(300) (70) (5)
3 × 100 + 7 × 10 + 5 × 1 =
375 = 5 + 70 + 300
11
13-Take the same idea to create a binary system:
14-For the base 2: take the number: 01101
15-The smallest number in binary to start counting is 20.
… 27 26 25 24 23 22 21 20
… 128 64 32 16 8 4 2 1
0 1 1 0 1
So this is how it store in the storage unit, located in many bytes as follows:
0 1 1 0 1
Home Work
………………………………………………………………………………………………………………………………………………………………………………………………………
……………………………………………………………………………………….………………………………………………………………………………………
2- What are the symbols which used to display the data in the binary
system numbers?
………………………………………………………………………………………………………………………………………………………………………………………………………
……………………………………………………………………………………….………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………………………………………
……………………………………………………………………………………….………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………………………………………………………………
……………………………………………………………………………………….………………………………………………………………………………………
Date: _________________________________
Lesson (2)
11
Convert from Binary to Denary Numbers
Example (1):
Solution
0 1 1 0 1 0
25 X 0 + 24 X 1 + 23 X 1 + 22 X 0 + 21 X 1 + 20 X 0
0 × 32 + 1 × 16 + 1×8 + 0×4 + 1×2 + 0×1
32 × 0 + 16 × 1 + 8 × 1 + 4 × 0 + 2 × 1 + 1 × 0 =
26 = 0 + 16 + 8+ 0 + 2 + 0 =
Example (2):
11
Solution
1 0 1 0 1 1 1
2 X1 + 2 X0 + 2 X1 + 2 X0 + 2 X1 + 2 X1 + 2 X1
6 5 4 3 2 1 0
64 × 1 + 0 × 32 + 1 × 16 + 0 × 8 + 1 × 4 + 1 × 2 + 1 × 1
64 × 1 + 0 × 32 + 1 × 16 + 0 × 8 + 1 × 4 + 1 × 2 + 1 × 1 =
87 = 64 + 0 + 16 + 0 + 4 + 2 + 1 =
11
Class Work
0 0 1 1 0 0 1 1
……………………………………………………………………………………………………………………………………………………………
……………………………………………………………………………………………………………………………………………………………
……………………………………………………………………………………………………………………………………………………………
……………………………………………………………………………………………………………………………………………………………
b) 01111111
0 1 1 1 1 1 1 1
……………………………………………………………………………………………………………………………………………………………
……………………………………………………………………………………………………………………………………………………………
……………………………………………………………………………………………………………………………………………………………
……………………………………………………………………………………………………………………………………………………………
c) 10011001
1 0 0 1 1 0 0 1
……………………………………………………………………………………………………………………………………………………………
……………………………………………………………………………………………………………………………………………………………
……………………………………………………………………………………………………………………………………………………………
……………………………………………………………………………………………………………………………………………………………
11
Home Work
b) 11111111
c) 00001111
d) 10001111
e) 11110000
f) 01110000
g) 11101110
11
Date: _________________________________
Lesson (3)
Steps:
11
Example (1):
Solution
1- Create the table with 3 rows
… 24 23 22 21 20
4- Get the values for each digit location in binary in the second row
… 24 23 22 21 20
16 8 4 2 1
11
1- Take the range of your number 7, it's 4 – 8
… 24 23 22 21 20
16 8 4 2 1
2- Take the smallest number which is less than your given number 7 ..
it's 4
3- Write 1 in the digit table.
… 24 23 22 21 20
16 8 4 2 1
1
Remainder = 7 – 4 = 3
11
1- Take the new range of your new number 3, it's 2 – 4
… 24 23 22 21 20
16 8 4 2 1
1
2- Take the smallest number which is less than your new number 3 .. it's
2
3- Write 1 in the digit table.
… 24 23 22 21 20
16 8 4 2 1
1 1
Remainder = 3 – 2 = 1
11
1- Now take the new only number which is 1.
2- Write 1 in the digit table.
… 24 23 22 21 20
16 8 4 2 1
1 1 1
… 24 23 22 21 20
16 8 4 2 1
0 0 1 1 1
(7)10 = (111)2
11
Example (2):
Solution
5- Create the table with 3 rows
… 28 27 26 25 24 23 22 21 20
8- Get the values for each digit location in binary in the second row
… 28 27 26 25 24 23 22 21 20
512 128 64 32 16 8 4 2 1
11
9- Take the range of your number 87, it's 64 – 128
… 28 27 26 25 24 23 22 21 20
512 128 64 32 16 8 4 2 1
10- Take the smallest number which is less than your given number
87 .. it's 64
11- Write 1 in the digit table.
… 28 27 26 25 24 23 22 21 20
512 128 64 32 16 8 4 2 1
1
Remainder = 87 – 64 = 23
11
13- Now take the range of your new number 23, it's 16 – 32
… 28 27 26 25 24 23 22 21 20
512 128 64 32 16 8 4 2 1
1
14-Take the smallest number which is less than your new number 23 ..
it's 16
15- Write 1 in the digit table.
… 28 27 26 25 24 23 22 21 20
512 128 64 32 16 8 4 2 1
1 1
16- Get the remainder by:
Remainder = 23 – 16 = 7
11
1- Now take the range of your new number 7, it's 4 – 8
… 28 27 26 25 24 23 22 21 20
512 128 64 32 16 8 4 2 1
1 1 1
1. Take the smallest number which is less than your new number 7 .. it's
4
2. Write 1 in the digit table.
… 28 27 26 25 24 23 22 21 20
512 128 64 32 16 8 4 2 1
1 1 1
1- Get the remainder by:
Remainder = 7 – 4 = 3
11
2- Now take the range of your new number 3, it's 2 – 4
… 28 27 26 25 24 23 22 21 20
512 128 64 32 16 8 4 2 1
1 1 1
3. Take the smallest number which is less than your new number 3 .. it's
2
4. Write 1 in the digit table.
… 28 27 26 25 24 23 22 21 20
512 128 64 32 16 8 4 2 1
1 1 1 1
2- Get the remainder by:
Remainder = 3 – 2 = 1
… 28 27 26 25 24 23 22 21 20
512 128 64 32 16 8 4 2 1
1 1 1 1
5. Write 1 in the digit table.
… 28 27 26 25 24 23 22 21 20
512 128 64 32 16 8 4 2 1
1 1 1 1 1
… 28 27 26 25 24 23 22 21 20
512 128 64 32 16 8 4 2 1
11
1 0 1 0 1 1 1
6- Now your number is converted
( 87 )10 = ( 1010111 )2
11
Class work
41
… 28 27 26 25 24 23 22 21 20
… 512 128 64 32 16 8 4 2 1
67
… 28 27 26 25 24 23 22 21 20
… 512 128 64 32 16 8 4 2 1
86
… 28 27 26 25 24 23 22 21 20
… 512 128 64 32 16 8 4 2 1
11
Home work
100=
111=
127=
144=
189=
200=
255=
11
Date: _________________________________
Lesson (4)
Method 2: division by 2:
Steps:
Example (1): -
Convert the number 11 into binary?
11 = (1011)2
11
Example (2): -
Convert the number 107 into binary?
11
Class work
………………………………………………… 67 41
………………………………………………… ………………………………………………… …………………………………………………
………………………………………………… ………………………………………………… …………………………………………………
………………………………………………… ………………………………………………… …………………………………………………
………………………………………………… ………………………………………………… …………………………………………………
………………………………………………… ………………………………………………… …………………………………………………
………………………………………………… ………………………………………………… …………………………………………………
………………………………………………… ………………………………………………… …………………………………………………
………………………………………………… ………………………………………………… …………………………………………………
………………………………………………… ………………………………………………… …………………………………………………
……. ………………………………………………… …………………………………………………
…………………………………………… ………………………………………………… …………………………………………………
86 …
11
Home work
Date: _________________________________
Lesson (5)
11
Measurement of the size of computer Memories
11
Home Work
1- What is the Bit?
……………………………………………………………………………………………………………………………………………………………
……………………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………….
2- Define the byte?
……………………………………………………………………………………………………………………………………………………………
……………………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………….
3- Can larger computer use many bytes? give an example.
……………………………………………………………………………………………………………………………………………………………
……………………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………….
11