Lecture 1 - Number Systems
Lecture 1 - Number Systems
Number systems
Agenda:
• Module Introduction
Your Module Leader
Module Objective
Module Assessments and Syllabus Summary
Recommended booklist
• Week 1 Lecture Coverage
Different number bases
Conversions between different bases
1’s and 2’s complement
2
iAcademy
iAcademy
Module Leader
• Mr. Prakash Adhikari
(M.Ed Mathematics, TU, Nepal)
(Master’s Degree by research, Computer Sciences, University
of Lumire, France)
– Senior Lecturer, Islington College,
Nepal
– [email protected]
3
iAcademy
iAcademy
4
iAcademy
iAcademy
5
iAcademy
iAcademy
Overview of Module:
• Computing mathematics and digital logic
• Aim: This module seeks to consolidate and improve
students’ mathematical knowledge, skills and concepts
through practical, analytical, problem Solving
applications and through integration with other
modules. This module introduces, and in some cases
reviews, the mathematical foundations of Computer
science.
6
iAcademy
iAcademy
Learning
Objectives:
Computer
Hardware
Programming
Databases
Design Computer graphics
Computing Mathematics and Digital logic
8
iAcademy
iAcademy
Learning Strategy:
Computing Mathematics and Digital logic
• Taught over 1 semester (12 weeks )
• Total 12 weeks of class (1 academic semester)
• Each week consists of 1 Lecture (2 Hours) and 2
tutorials (1.5 Hours each)
– Lecture: Learn how to acquire different
mathematical skills
– Tutorial: Review and practice mathematical
problems through in-class assignments to actually
acquire them
9
iAcademy
iAcademy
10
iAcademy
iAcademy
Learning Strategy:
11
iAcademy
iAcademy
Assessment Details:
Computing Mathematics and Digital Logic
• 2 written examinations
• All assessments on an individual basis
– Mid-term Examination (Week 7, Weightage-30 %)
– Final Examination (Week 13/14, Weithtage-70 %)
12
iAcademy
iAcademy
Assessment Details:
• Module Grading Standards in the UK
Range of
Grade Remarks
Marks
Excellent: outstanding performance with only minor
70 - 100 A
errors
Very Good: above the average standard but with
60 – 69 B
some errors
Good: generally sound work with a number of
50 - 59 C
notable errors
43 - 49 D Satisfactory: fair but with significant shortcomings
40 - 42 E Sufficient: performance meets the minimum criteria
Fail: performance does not meet the minimum
0 - 39 F
criteria and considerable further work is required
13
iAcademy
iAcademy
Any Questions?
14
iAcademy
iAcademy
16
iAcademy
iAcademy
17
iAcademy
iAcademy
18
iAcademy
iAcademy
19
iAcademy
iAcademy
20
iAcademy
iAcademy
21
iAcademy
iAcademy
Lecture 1 Coverage:
Number Base System
o Decimal Number System
o Binary Number System
o Octal Number System
o Hexadecimal Number System
23
iAcademy
iAcademy
24
iAcademy
iAcademy
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, and E
• Example: 2E6, D13E, ABC, etc.
25
iAcademy
iAcademy
In Summary..
System Base Digits Example
Decimal 10 0, 1, … 9 12 , 2300
Hexa- 0, 1, … 9,
16 2AE, 34816
decimal A, B, … F
26
iAcademy
iAcademy
Counting (1 of 2):
Decimal Binary Octal Hexa-decimal
0 0 0 0
1 1 1 1
2 10 2 2
3 11 3 3
4 100 4 4
5 101 5 5
6 110 6 6
7 111 7 7
27
iAcademy
iAcademy
Counting (2 of 2):
Decimal Binary Octal Hexa-decimal
8 1000 10 8
9 1001 11 9
10 1010 12 A
11 1011 13 B
12 1100 14 C
13 1101 15 D
14 1110 16 E
15 1111 17 F
28
iAcademy
iAcademy
Any Questions?
29
iAcademy
iAcademy
Bases Conversion:
• The conversion possibilities:
Decimal Octal
Binary Hexadecimal
30
iAcademy
iAcademy
Decimal Octal
Binary Hexadecimal
31
iAcademy
iAcademy
32
iAcademy
iAcademy
1010112 => 1 x 20 = 1
1 x 21 = 2
0 x 22 = 0
1 x 23 = 8
0 x 24 = 0
1 x 25 = 32
4310
33
iAcademy
iAcademy
Decimal Octal
Binary Hexadecimal
34
iAcademy
iAcademy
35
iAcademy
iAcademy
7248 => 4 x 80 = 4
2 x 81 = 16
7 x 82 = 448
46810
36
iAcademy
iAcademy
Decimal Octal
Binary Hexadecimal
37
iAcademy
iAcademy
38
iAcademy
iAcademy
ABC16 = ?10
39
iAcademy
iAcademy
Decimal Octal
Binary Hexadecimal
40
iAcademy
iAcademy
41
iAcademy
iAcademy
12510 = 11111012
42
iAcademy
iAcademy
Decimal Octal
Binary Hexadecimal
43
iAcademy
iAcademy
44
iAcademy
iAcademy
7 0 5
7058= 1110001012
45
iAcademy
iAcademy
Decimal Octal
Binary Hexadecimal
46
iAcademy
iAcademy
47
iAcademy
iAcademy
1 0 A F
10AF16 = 00010000101011112
48
iAcademy
iAcademy
Decimal Octal
Binary Hexadecimal
49
iAcademy
iAcademy
50
iAcademy
iAcademy
8 1234
8 154 2
8 19 2
8 2 3
0 2
123410 = 23228
51
iAcademy
iAcademy
Decimal Octal
Binary Hexadecimal
52
iAcademy
iAcademy
53
iAcademy
iAcademy
123410 = 4D216
54
iAcademy
iAcademy
Decimal Octal
Binary Hexadecimal
55
iAcademy
iAcademy
56
iAcademy
iAcademy
1 3 2 7
10110101112 = 13278
57
iAcademy
iAcademy
Decimal Octal
Binary Hexadecimal
58
iAcademy
iAcademy
59
iAcademy
iAcademy
10 1011 1011
2 B B
10101110112 = 2BB16
60
iAcademy
iAcademy
Decimal Octal
Binary Hexadecimal
61
iAcademy
iAcademy
62
iAcademy
iAcademy
1 0 7 6
10768 = 23E16
63
iAcademy
iAcademy
Decimal Octal
Binary Hexadecimal
64
iAcademy
iAcademy
65
iAcademy
iAcademy
1 F 0 C
1F0C16 = 174148
66
iAcademy
iAcademy
Any Questions?
67
iAcademy
iAcademy
35
1111101
605
10A
Exercise – Answers:
35 100011 43 23
125 1111101 175 7D
389 110000101 605 185
266 000100001010 412 10A
69
iAcademy
iAcademy
Fractional numbers
Decimal to binary
3.14579 = 3 + 0.14579 .14579
x 2
3.14579 0.29158
x 2
0.58316
x 2
1.16632
x 2
0.33264
x 2
0.66528
x 2
11.001001.. 1.33056
etc.
70
iAcademy
iAcademy
30.8
110.1100
5.45
F.34
71
iAcademy
iAcademy
Any Questions?
72
iAcademy
iAcademy
73
iAcademy
iAcademy
Negative Numbers?
• Digital electronics requires frequent addition and
subtraction of numbers. You know how to design an
adder, but what about a subtract-er?
• A subtract-er is not needed with the 2’s complement
process. The 2’s complement process allows you to
easily convert a positive number into its negative
equivalent.
• Since subtracting one number from another is the same
as making one number negative and adding, the need
for a subtract-er circuit has been eliminated.
74
iAcademy
iAcademy
-13 = 11110011
Example #2 Complement Digits
00001100
+1 Add 1
13 = 00001101
76
iAcademy
iAcademy
77
iAcademy
iAcademy
9 00001001
+ 5 + 00000101
14 00001110
78
iAcademy
iAcademy
9 00001001
+ (-5) + 11111011
4 1]00000100
8th Bit = 0: Answer is Positive Disregard 9 th Bit
00000101
2’s
11111010 Complement
+1 Process
11111011
79
iAcademy
iAcademy
(-9) 11110111
+ 5 + 00000101
-4 11111100
8th Bit = 1: Answer is Negative
On Answer +1
00001110
81
iAcademy
iAcademy
Any Questions?
82
iAcademy
iAcademy
84
iAcademy
iAcademy
Thank you
iAcademy