02 - Unit 01 - Part 2 - v1

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 37

Applications of Information and

Communication Technologies
CSC 101

Dr. Syed Abdul Mannan Kirmani

CSC101 Applications of Information and


Spring 2024
Communication Technologies
Number Systems

Conversions & Arithmetic

CSC101 Applications of Information and


Spring 2024
Communication Technologies
Goals
• Distinguish among categories of numbers
• Describe positional notation
• Convert numbers in other bases to base 10
• Convert base-10 numbers to numbers in other bases
• Understand basic arithmetic operations in different bases

CSC101 Applications of Information and


Spring 2024
Communication Technologies
Basic Definitions
• Number
• A unit of an abstract mathematical system subject to the laws of arithmetic
• Natural Number
• The number 0 and any number obtained by repeatedly adding 1 to it
• Negative number
• A value less than 0, with a sign opposite to its positive counterpart
• Integer
• A natural number, a negative of a natural number, or zero
• Rational number
• An integer or the quotient of two integers (division by zero excluded)

CSC101 Applications of Information and


Spring 2024
Communication Technologies
Number Systems

• A way of representing numbers


• Decimal numbering system
• Uses 10 digits/symbols (0 – 9)

• Binary numbering system


• Uses only two digits/symbols (1 and 0) to represent all possible numbers

• Octal numbering system


• Uses eight digits/symbols (0 – 7)

• Hexadecimal numbering system


• Uses sixteen digits/symbols (0 – 9 and A – F) to represent all possible numbers

CSC101 Applications of Information and


Foundations of Computer Science (4 th Ed.) by Behrouz Forouzan Spring 2024
Communication Technologies
Basic Definitions
• Base
• The foundational value of a number system, which dictates the number of digits and the value of digit
positions
• Positional notation
• A system of expressing numbers in which the digits are arranged in succession, the position of each digit
has a place value, and the number is equal to the sum of the products of each digit by its place value

CSC101 Applications of Information and


Spring 2024
Communication Technologies
Positional Number Systems

• The position a symbol occupies in the number determines the value it represents:

• S is the set of symbols and b is the base or radix

CSC101 Applications of Information and


Foundations of Computer Science (4 th Ed.) by Behrouz Forouzan Spring 2024
Communication Technologies
Decimal Number Systems

CSC101 Applications of Information and


Foundations of Computer Science (4 th Ed.) by Behrouz Forouzan Spring 2024
Communication Technologies
Decimal Number Systems

• In decimal system a real number is written as:

CSC101 Applications of Information and


Foundations of Computer Science (4 th Ed.) by Behrouz Forouzan Spring 2024
Communication Technologies
Binary Number Systems

CSC101 Applications of Information and


Foundations of Computer Science (4 th Ed.) by Behrouz Forouzan Spring 2024
Communication Technologies
Binary Number Systems

• In binary system a real number is written as:

CSC101 Applications of Information and


Foundations of Computer Science (4 th Ed.) by Behrouz Forouzan Spring 2024
Communication Technologies
Octal Number Systems

CSC101 Applications of Information and


Foundations of Computer Science (4 th Ed.) by Behrouz Forouzan Spring 2024
Communication Technologies
Hexadecimal Number Systems

CSC101 Applications of Information and


Foundations of Computer Science (4 th Ed.) by Behrouz Forouzan Spring 2024
Communication Technologies
Summary of Four Positional Systems

CSC101 Applications of Information and


Foundations of Computer Science (4 th Ed.) by Behrouz Forouzan Spring 2024
Communication Technologies
Decimal Binary Octal Hexadecimal
0 0 0 0
1 1 1 1
Summary of Four 2 10 2 2
Positional Systems 3 11 3 3
4 100 4 4
5 101 5 5
6 110 6 6
7 111 7 7
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
CSC101 Applications of Information and
Foundations of Computer Science (4 th Ed.) by Behrouz Forouzan Spring 2024
Communication Technologies
Summary of Four Positional Systems

• Recall that the digits in any number system go up to one less than the base value.
• To represent the base value in any base, you need two digits.
• A 0 in the rightmost position and a 1 in the second position represent the value of the base
itself.

Base of the Number System Symbols / Digits Value


2 10 2
8 10 8
10 10 10
16 10 16

CSC101 Applications of Information and


Spring 2024
Communication Technologies
Any Base to Decimal Conversion

Number

Values

CSC101 Applications of Information and


Foundations of Computer Science (4 th Ed.) by Behrouz Forouzan Spring 2024
Communication Technologies
Any Base to Decimal Conversion

CSC101 Applications of Information and


Foundations of Computer Science (4 th Ed.) by Behrouz Forouzan Spring 2024
Communication Technologies
Any Base to Decimal Conversion

CSC101 Applications of Information and


Foundations of Computer Science (4 th Ed.) by Behrouz Forouzan Spring 2024
Communication Technologies
Any Base to Decimal Conversion

CSC101 Applications of Information and


Foundations of Computer Science (4 th Ed.) by Behrouz Forouzan Spring 2024
Communication Technologies
Decimal to Any Base Conversion

CSC101 Applications of Information and


Foundations of Computer Science (4 th Ed.) by Behrouz Forouzan Spring 2024
Communication Technologies
Decimal to Any Base Conversion

CSC101 Applications of Information and


Foundations of Computer Science (4 th Ed.) by Behrouz Forouzan Spring 2024
Communication Technologies
Decimal to Any Base Conversion

CSC101 Applications of Information and


Foundations of Computer Science (4 th Ed.) by Behrouz Forouzan Spring 2024
Communication Technologies
Decimal to Any Base Conversion

CSC101 Applications of Information and


Foundations of Computer Science (4 th Ed.) by Behrouz Forouzan Spring 2024
Communication Technologies
Decimal to Any Base Conversion

CSC101 Applications of Information and


Foundations of Computer Science (4 th Ed.) by Behrouz Forouzan Spring 2024
Communication Technologies
Decimal to Any Base Conversion

CSC101 Applications of Information and


Foundations of Computer Science (4 th Ed.) by Behrouz Forouzan Spring 2024
Communication Technologies
Decimal to Any Base Conversion

CSC101 Applications of Information and


Foundations of Computer Science (4 th Ed.) by Behrouz Forouzan Spring 2024
Communication Technologies
Decimal to Any Base Conversion

CSC101 Applications of Information and


Foundations of Computer Science (4 th Ed.) by Behrouz Forouzan Spring 2024
Communication Technologies
Conversion from Binary to Octal
• To convert from binary to octal, you start at the Decimal Binary Octal Hexadecimal

rightmost binary digit and mark the digits in groups 0 0 0 0

1 1 1 1
of threes.
2 10 2 2
• Then you convert each group of three to its octal 3 11 3 3

value. 4 100 4 4

5 101 5 5
• Let’s convert 1010110 to octal:
6 110 6 6

7 111 7 7

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

CSC101 Applications of Information and


Spring 2024
Communication Technologies
Conversion from Octal to Binary
• To convert from octal to binary, replace each digit Decimal Binary Octal Hexadecimal

with binary representation of that digit. 0 0 0 0

1 1 1 1
• Let’s convert 754 in octal to binary: 2 10 2 2

3 11 3 3

4 100 4 4

5 101 5 5

6 110 6 6

7 111 7 7

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

CSC101 Applications of Information and


Spring 2024
Communication Technologies
Conversion from Binary to Hexadecimal
• To convert from binary to hexadecimal, you start at Decimal Binary Octal Hexadecimal

the rightmost binary digit and mark the digits in 0 0 0 0

1 1 1 1
groups of fours.
2 10 2 2
• Then you convert each group of four to its 3 11 3 3

hexadecimal value. 4 100 4 4

5 101 5 5
• Let’s convert 1010110 to hexadecimal:
6 110 6 6

7 111 7 7

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

CSC101 Applications of Information and


Spring 2024
Communication Technologies
Conversion from Hexadecimal to Binary
• To convert from hexadecimal to binary, replace each Decimal Binary Octal Hexadecimal

digit with binary representation of that digit. 0 0 0 0

1 1 1 1
• Let’s convert ABC in hexadecimal to binary: 2 10 2 2

3 11 3 3

4 100 4 4

5 101 5 5

6 110 6 6

7 111 7 7

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

CSC101 Applications of Information and


Spring 2024
Communication Technologies
Binary Values and Computers
• Although some of the early computers were decimal machines, modern computers are binary
machines.
• That is, numbers within the computer are represented in binary form.
• In fact, all information is somehow represented using binary values.
• The reason is that each storage location within a computer contains either a low-voltage
signal or a high-voltage signal.
• Because each location can have only one of two states, it is logical to equate those states to 0
and 1.
• A low-voltage signal is equated with a 0, and a high-voltage signal is equated with a 1.
• In fact, you can forget about voltages and think of each storage location as containing either a
0 or a 1.
• Note that a storage location cannot be empty: It must contain either a 0 or a 1.

CSC101 Applications of Information and


Spring 2024
Communication Technologies
Binary Values and Computers
• Each storage unit is called a binary digit, or bit for short.
• Bits are grouped together into bytes (8 bits), and bytes are grouped together into units called
words.
• The number of bits in a word is known as the word length of the computer.
• For example, IBM 370 architecture in the late 1970s had half words (2 bytes or 16 bits), full
words (4 bytes), and double words (8 bytes).
• Modern computers are often 32-bit machines or 64-bit machines.

CSC101 Applications of Information and


Spring 2024
Communication Technologies
Arithmetic Operations
• Addition (Binary)
• It works like a "normal" (decimal) addition, but the number can have only zeros and ones as digits (symbols), so if the
sum exceeds 1, you have to carry 1 to the next bit.

+- 0 1 2 3 4 5 6 7 8 9
0 0 1 2 3 4 5 6 7 8 9
1
2
1
2
2 3 4
3 4 5
5
6
6
7
7
8
8
9
9
10
10
11
+ 0 1
3
4
3
4
4 5 6
5 6 7
7
8
8
9
9
10
10
11
11
12
12
13
0 0 1
5
6
5
6
6 7 8
7 8 9
9
10
10
11
11
12
12
13
13
14
14
15 1 1 10
7 7 8 9 10 11 12 13 14 15 16
Binary
8 8 9 10 11 12 13 14 15 16 17
9 9 10 11 12 13 14 15 16 17 18

Decimal

CSC101 Applications of Information and


Foundations of Computer Science (4 th Ed.) by Behrouz Forouzan Spring 2024
Communication Technologies
Arithmetic Operations
• Addition (Octal)

+ 0 1 2 3 4 5 6 7
0 0 1 2 3 4 5 6 7
1 1 2 3 4 5 6 7 10
2 2 3 4 5 6 7 10 11
3 3 4 5 6 7 10 11 12
4 4 5 6 7 10 11 12 13
5 5 6 7 10 11 12 13 14
6 6 7 10 11 12 13 14 15
7 7 10 11 12 13 14 15 16

CSC101 Applications of Information and


Foundations of Computer Science (4 th Ed.) by Behrouz Forouzan Spring 2024
Communication Technologies
Arithmetic Operations
• Addition (Hexadecimal)
+ 0 1 2 3 4 5 6 7 8 9 A B C D E F
0 0 1 2 3 4 5 6 7 8 9 A B C D E F
1 1 2 3 4 5 6 7 8 9 A B C D E F 10
2 2 3 4 5 6 7 8 9 A B C D E F 10 11
3 3 4 5 6 7 8 9 A B C D E F 10 11 12
4 4 5 6 7 8 9 A B C D E F 10 11 12 13
5 5 6 7 8 9 A B C D E F 10 11 12 13 14
6 6 7 8 9 A B C D E F 10 11 12 13 14 15
7 7 8 9 A B C D E F 10 11 12 13 14 15 16
8 8 9 A B C D E F 10 11 12 13 14 15 16 17
9 9 A B C D E F 10 11 12 13 14 15 16 17 18
A A B C D E F 10 11 12 13 14 15 16 17 18 19
B B C D E F 10 11 12 13 14 15 16 17 18 19 1A
C C D E F 10 11 12 13 14 15 16 17 18 19 1A 1B
D D E F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C
E E F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D
F F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E

CSC101 Applications of Information and


Foundations of Computer Science (4 th Ed.) by Behrouz Forouzan Spring 2024
Communication Technologies

You might also like