Objectives: Number Systems (Review)
Objectives: Number Systems (Review)
Objectives
• Understand Digital versus Analog signals
• Number Systems
• Decimal Number System
• Binary Number System
• Hexadecimal Number System
• Positional Numbering System
• Conversions Between Number Systems
• Analog signal
– Continuously varying
– Examples: temperature, pressure, velocity
• Digital signal
– OFF and ON states that can be represented
using 0s and 1s (respectively).
• Sum of the value of all digits gives the value of the number.
58710 = 5 x 102 + 8 x 101 + 7 x 100
= 5 x 100 + 8 x 10 + 7 x 1
= 500 + 80 + 7
= 587
1.# Source: Feleke Merin (Dr. – Eng.)
Positional Number Systems (Example)
= 375.17
• Decimal 3 11
4 100
– Base 10 5 101
– 10 symbols 6 110
7 111
0, 1, 2, 3, 4, 5, 6, 7, 8, 8 1000
9 9 1001
10 1010
11 1011
• Binary 12 1100
– Base 2 13 1101
14 1110
– 2 symbols: 0, 1 15 1111
16 10000
... ...
• Octal 2
3
2
3
– Base 8 4 4
5 5
– 8 symbols
6 6
0, 1, 2, 3, 4, 5, 6, 7 7 7
• Hexadecimal
10
11
8
9
– Base 16 12 A
13 B
– 16 symbols
14 C
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 15 D
A, B, C, D, E, F 16 E
– More compact representation 17 F
20 10
of the binary system
... ...
positional powers of 2: 25 24 23 22 21 20
decimal positional value: 32 16 8 4 2 1
binary number: 1 1 0 1 0 1
Ex: 1010112
positional powers of 2: 25 24 23 22 21 20
Ex 2: 3510 =
2) Rem:
2)
2)
2)
2)
2)
Answer: 3510 = 2
Ex 1: 5610
56 26 | 25 24 23 22 21 20
- 32 64 | 32 16 8 4 2 1
24 | 1 1 1 0 0 0
- 16
8
- 8
0
Answer: 5610 = 1110002
Ex 2: 3810
38 26 | 25 24 23 22 21 20
|
|
Answer: 3810 = 2
• Base: 8
• Digits: 0, 1, 2, 3, 4, 5, 6, 7
• Octal number: 12468
powers of : 84 83 82 81 80
decimal value: 4096 512 64 8 1
Octal number: 1 2 4 6
Ex: 12468
positional powers of 8: 83 82 81 80
decimal positional value: 512 64 8 1
Octal number: 1 2 4 6
512 + 128 + 32 + 6 = 67810
Ex: 103528
positional powers of 8: 84 83 82 81 80
Ex 1: 433010 = 103528
8 ) 4330 Rem:
8 ) 541 2
8 ) 67 5
8) 8 3
8) 1 0
0 1
1.# Source: Feleke Merin (Dr. – Eng.)
Decimal to Octal Conversion(contd.)
Ex 2: 81010 =
8 ) 810 Rem:
8)
8)
8)
Answer: 81010 = 8
Ex 1: 201810
2018 84 | 83 82 81 80
- 1536 4096 | 512 64 8 1
482 | 3 7 4 2
- 448
34
- 32
2
- 2
0 Answer: 201810 = 37428
Ex 2: 76510
765 84 | 83 82 81 80
|
|
• Base: 16
• Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
• Hexadecimal number: 1F416
powers of : 164 163 162 161 160
decimal value: 65536 4096 256 16 1
Hexadecimal number: 1 F 4
Ex: 1F416
positional powers of 16: 163 162 161 160
decimal positional value: 4096 256 16 1
Hexadecimal number: 1 F 4
256 + 240 + 4 = 50010
Ex: 7E16
positional powers of 16: 163 162 161 160
decimal positional value:
Hexa number:
0 7
Ex 2: 81010 =
16 ) 810 Rem:
16 )
16 )
Answer: 81010 = 16
Ex 1: 81010
810 163 | 162 161 160
- 768 4096 | 256 16 1
42 | 3 2 A
- 32
10
- 10
0 Answer: 81010 = 32A16
Ex 2: 15610
Answer: 15610 = 16
Ex : Convert 101001102 = 8
110 = 6
100 = 4
010 = 2 ( pad empty digits with 0)
101001102 = 2468
Ex : Convert 7428 = 2
2 = 010
4 = 100
7 = 111
Ex : Convert 101001102 = 16
0110 = 6
1010 = A
101001102 = A616
Ex : Convert 3D916 = 2
9 = 1001
D = 1101
3 = 0011
Course Title: Computer Architecture & Organization 1.# Source: Feleke Merin (Dr. – Eng.)
Octal to Hexa Conversion
Ex : Convert 7528 = 16
Ex : Convert E8A16 = 8
7 2 1 2
Course Title: Computer Architecture & Organization 1.# Source: Feleke Merin (Dr. – Eng.)
Practice session
Course Title: Computer Architecture & Organization 1.# Source: Feleke Merin (Dr. – Eng.)
Practice session
Answers
5710
5710 = 3916
13810
13810 = 8A16
21710
21710 = D916
25510
25510 = FF16
Course Title: Computer Architecture & Organization 1.# Source: Feleke Merin (Dr. – Eng.)
Practice session
Course Title: Computer Architecture & Organization 1.# Source: Feleke Merin (Dr. – Eng.)
Practice session
Course Title: Computer Architecture & Organization 1.# Source: Feleke Merin (Dr. – Eng.)
Practice session
Course Title: Computer Architecture & Organization 1.# Source: Feleke Merin (Dr. – Eng.)
Practice session
Answers
1B16 1B16 = 000110112
9416 9416 = 100101002
A516 A516 = 101001012
FB16 FB16 = 111110112
Course Title: Computer Architecture & Organization 1.# Source: Feleke Merin (Dr. – Eng.)
Practice session
10011012
1101.112
1AB.616
173.25 8
Course Title: Computer Architecture & Organization 1.# Source: Feleke Merin (Dr. – Eng.)
Practice session
Answer:
• 10011012 = 1 x 26 + 0 x 25 + 0 x 24 + 1 x 23 + 1 x 22 + 0 x 21+1 x 20
= 64 + 0 + 0 + 8 + 4 + 0 + 1
= 7710
Course Title: Computer Architecture & Organization 1.# Source: Feleke Merin (Dr. – Eng.)
Practice session
Answer:
• 1AB.616 = 1 x 162 + A x 161 + B x 160 + 6 x 16-1
= 1 x 256 + 10 x 16 + 11 x 1 + 6 x 16
= 256 + 160 + 11 + 0.375
= 427.37510
• 173.258 = 1 x 82 + 7 x 81 + 3 x 80 + 2 x 8-1 + 5 x 8-2
= 1 x 64 + 7 x 8 + 3 x 1 + 2/8 + 5/64
= 64 + 56 + 3 + 0.25 + 0.078125
= 123.32812510
Course Title: Computer Architecture & Organization 1.# Source: Feleke Merin (Dr. – Eng.)
Practice session
Answer
Convert 123|10 to Base 8:
8 ) 123
8 ) 15 R 3
8)1 R 7 Read Up!
0 R 1
Therefore, 123|10 = 173|8
Course Title: Computer Architecture & Organization 1.# Source: Feleke Merin (Dr. – Eng.)
Practice session
Answer
• Convert 59|10 to Base 2:
59|10 =1110112
Course Title: Computer Architecture & Organization 1.# Source: Feleke Merin (Dr. – Eng.)
Practice session
Course Title: Computer Architecture & Organization 1.# Source: Feleke Merin (Dr. – Eng.)
Practice session
Answers
Course Title: Computer Architecture & Organization 1.# Source: Feleke Merin (Dr. – Eng.)
The ASCII Code
Course Title: Computer Architecture & Organization 1.# Source: Feleke Merin (Dr. – Eng.)
Numbering System Applications
Course Title: Computer Architecture & Organization 1.# Source: Feleke Merin (Dr. – Eng.)
Application 1-1
Course Title: Computer Architecture & Organization 1.# Source: Feleke Merin (Dr. – Eng.)
Application 1-1 (continued)
0 0 1 0 1 0 0 0
Course Title: Computer Architecture & Organization 1.# Source: Feleke Merin (Dr. – Eng.)
Application 1-1 (continued)
0 1 0 1 0 1 0 1
Course Title: Computer Architecture & Organization 1.# Source: Feleke Merin (Dr. – Eng.)
Application 1-1 (continued)
Course Title: Computer Architecture & Organization 1.# Source: Feleke Merin (Dr. – Eng.)
Application 1-1 (continued)
– With the four low-order bits tied high, the lowest value
that indicates a problem is 0001
Course Title: Computer Architecture & Organization 1.# Source: Feleke Merin (Dr. – Eng.)
Application 1-1 (continued)
Course Title: Computer Architecture & Organization 1.# Source: Feleke Merin (Dr. – Eng.)
Summary
Course Title: Computer Architecture & Organization 1.# Source: Feleke Merin (Dr. – Eng.)
Summary
Course Title: Computer Architecture & Organization 1.# Source: Feleke Merin (Dr. – Eng.)