0% found this document useful (0 votes)
3 views32 pages

Understanding Numbering Systems in Computing

This document covers the fundamentals of numbering systems in computing, including binary, octal, decimal, and hexadecimal systems. It outlines learning objectives and outcomes for students, emphasizing conversions between these systems and binary arithmetic operations. The chapter also discusses signed and unsigned numbers, as well as the concept of binary complements.

Uploaded by

faizajannatul0
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views32 pages

Understanding Numbering Systems in Computing

This document covers the fundamentals of numbering systems in computing, including binary, octal, decimal, and hexadecimal systems. It outlines learning objectives and outcomes for students, emphasizing conversions between these systems and binary arithmetic operations. The chapter also discusses signed and unsigned numbers, as well as the concept of binary complements.

Uploaded by

faizajannatul0
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

CSC-103

Computer Fundamental Chapter-04


Numbering System
Presented by-
Faniyam Maria Mansia
Lecturer, CSE,IUBAT
Learning Objectives

By the end of this course, students will be able to:


– Understand the importance and applications of different numbering
systems.
– Identify the types of numbering systems, such as binary, octal, decimal,
and hexadecimal.
– Perform conversions between different numbering systems.
– Understand binary arithmetic operations and their significance in
computing.
– Distinguish between signed and unsigned numbers.
– Explain the concept and purpose of binary complements.
Learning Outcomes

Upon completing this course, students will:


– Demonstrate an understanding of the need of numbering systems.
– Identify and describe the characteristics of binary, octal, decimal, and
hexadecimal numbering systems.
– Perform inter-conversions among decimal, binary, octal, and hexadecimal
numbers accurately.
– Apply binary arithmetic operations to solve basic computational tasks.
– Differentiate between signed and unsigned binary numbers.
– Calculate the complement of binary numbers and explain its significance
in computing.
Slide Contents
• Introduction to Numbering System
• Types of Number System
• Conversion of Numbering System
• Binary Arithmetic Operations
• Signed and unsigned Numbers
• Complement of Binary Numbers
Introduction to Numbering System
The data stored in the computer may be of different kinds, as
follows—
• Numeric data (0, 1, 2, …, 9)
• Alphabetic data (A, B, C, …, Z)
• Alphanumeric data—Combination of any of the symbols—
(A, B, C… Z), (0, 1… 9), or special characters (+, −, Blank),
etc.
All kinds of data, be it alphabets, numbers, symbols, sound
data or video data, is represented in terms of 0s and 1s, in the
computer. Each symbol is represented as a unique
combination of 0s and 1s. This chapter discusses the number
systems that are commonly used in the computer.
1
Number System
A number system is a writing system which is a mathematical notation
for representing numbers of a given set, using digits or other symbols.
There are four types of number system:
1. Binary(Base 2)(Digit-0,1)
2. Decimal(Base 10) (Digit-0,1,2,3,4,5,6,7,8,9)
3. Octal(Base 8) (Digit-0,1,2,3,4,5,6,7)
4. Hexadecimal(Base16)(Digit 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F)

2
Types of Number System
Decimal Numbers
• Our everyday number system is a Base-10 system.
• Has 10 digits to show all numbers i.e. 0,1,2,3,4,5,6,7,8,9

Example: 4210

Binary Numbers
• Binary numbers is a base-2 number system.
• This number system only works with two digits 0 and 1.

Example: 101102
3
Types of Number System
Octal Numbers
• Octal numbers are Base Eight numbers meaning
eight digits are used to represent all the values.
They are 0, 1, 2, 3, 4, 5, 6, and 7.

Octal 0 1 2 3 4 5 6 7

Binary 000 001 010 011 100 101 110 111

Decimal 0 1 2 3 4 5 6 7
4
Types of Number System
Hexadecimal Numbers
• The hexadecimal system is Base Sixteen.
• This number system is used for color code and memory address.
Example: 11AB16, ADF16, 119216 etc

Hex 0 1 2 3 4 5 6 7
8 9 A B C D E F

Binary 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111

Decimal 0 1 2 3 4 5 6 7
8 9 10 11 12 13 14 15

5
Exercise 1.1
Find the base of the following numbers

• 1610 • 9610
• 1816 • 25A16
• 1110102 • 7816
• 1508 • 1116

5
Conversion of Numbering System
• Decimal to Other Base System
– Decimal to binary
– Decimal to octal
– Decimal to hex
• Other Base System to Decimal


Binary to Decimal
Octal to Decimal
– Hex to Decimal
• Binary to Octal
• Octal to Binary
• Binary to Hexadecimal
• Hexadecimal to Binary 6
Conversion from Decimal to Binary, Octal,
Hexadecimal
• In order to convert a decimal number to any others number
these three steps are needed-
Integral Part – Fractional Part –
• Divide the decimal number by the • Multiply the decimal number by
base of the number you want to base value and take 1 or 0
convert and take its remainder. depending on what is left before
• The process is repeated until it decimal point
produces the result of 0. • The process is repeated until it
• The resulting number is obtained produces the result of 0 or until 3
by taking the remainder from the or 4 decimal points.
bottom to the top.
• The binary number is obtained by
taking the 1s or 0s. 7
Decimal to Binary
• Example: 20.2510 to (?)2
solve:
Integral Part – Fractional Part –
20 0.25
=> 20 / 2 = 10 remainder 0
=> 10 / 2 = 5 remainder 0
=> 0.25 x 2 = 0.50 taking 0
=> 5 / 2 = 2 remainder 1 => 0.50 x 2 = 1.00 taking 1
=> 2 / 2 = 1 remainder 0
=0.012
=> 1 / 2 = 0 remainder 1
=101002 Thus, 20.2510 = 10100.012
8
Exercise 1.2
• Convert the following numbers to Binary, Octal
and Hexadecimal

• 10.2510 • 89.9110
• 4.6910 • 756.1210
• 1008.2410 • 11.1310
• 51.3610 • 48.8310
• 87.7910 • 45.5510
9
Conversion of Binary, Octal,
Hexadecimal to Decimal
In order to convert any number you have to use the formula we have discussed in Understanding the Base. For the convenience here is
the example for you,
N = anbn + an-1bn-1 + … + a1b1 + a0b0
Where:
N: Decimal Equivalent
b: base
ai: i-th digit
so,

100012= 1x24 + 0x23 + 0x22 + 0x21 + 1x20 = 16 + 0 + 0 + 0 + 1 = 1710

16A16 = 1x162 + 6x161 + A(10)x160 = 256 + 96 + 10 = 36210

7218 = 7x82 + 2x81 + 1x80 = 448 + 16 + 1 = 46510

.1102= 1x2-1 + 1x2-2 + 0x2-3 = .5 + .25 + 0 = .7510


10
Exercise 1.3
• Convert the following number to Decimal

• 17816 • FAF16 • 1101010102


• 11011012 • DEF16 • 111118
• 3328 • 77916 • 1010.112
• FFA16 • 3148 • FF.FF16

11
Binary to Octal and Octal to Binary
Binary Octal
These three steps are needed for Binary to Octal Conversion- 000 0
1. At first make group of three digits starting from the
right. If in last the digits can’t be rounded up to 001 1
three add 0 to the left.
2. Replace each group accordingly with the help of the 010 2
table
3. Sequence the numbers as the groups are created
011 3
❖ These two steps are needed for Octal to Binary
100 4
Conversion-
101 5
1.
2.
Replace each digit with its equivalent three digits
After joining the numbers if any 0s are left at the 110 6
leftmost erase them
111 7 12
Binary to Octal and Octal to Binary
Converting 101112 to Octal :

So, there will be two groups.


010 111 replacing each group with their designated value from table we get 2 & 7.
Thus, 101112 = 278

Convert 278 to Binary :


So, 2 is replaced by 010 and 7 is replaced by 111.
Thus the number becomes 010111 and removing the leftmost zero as it bears no value
the answer. becomes 101112.

13
Exercise 1.4
• Convert the following numbers to Octal
• 101112 • 11112 • 101.1102
• 10101002 • 11010102 • 111.110102
• 11001012 • 11111002
• 111112 • 10101012
• Convert the following numbers to Binary
• 778 • 1248
• 2.1348
• 6728 • 1118
• 7.1138
• 4538 • 758
• 3318 • 75.118
14
Binary Hexadeci
Binary to Hexadecimal and Hexadecimal mal
to Binary 0000 0
0001 1
Binary to Hexadecimal Conversion- 0010 2
1. At first make group of four digits starting from the 0011 3
right. If in last the digits can’t be rounded up to four
add 0 to the left. 0100 4
2. Replace each group accordingly with the help of the 0101 5
table. 0110 6
3. Sequence the numbers as the groups are created.
0111 7
1000 8
These two steps are needed for Hexadecimal to Binary 1001 9
Conversion-
1010 A
1. Replace each digit with its equivalent four digits.
2. After joining the numbers if any 0s are left at the 1011 B
leftmost erase them. 1100 C
1101 D 15
Binary to Hexadecimal and
Hexadecimal to Binary
Converting 10011112 to Hexadecimal :

So, there will be two groups.


0100 1111 replacing each group with their designated value from table we get 4 & F.
Thus, 10011112 = 4F16

Convert 4F16 to Binary :


So,4 is replaced by 0100 and F is replaced by 1111.
Thus the number becomes 01001111 and removing the leftmost zero as it bears no value
the answer becomes 10011112.
16
Exercise 1.5
• Convert the following numbers to Hex
• 101112 • 11112 • 101.1102
• 10101002 • 11010102 • 111.110102
• 11001012 • 11111002
• 111112 • 10101012
• Convert the following numbers to Binary
• 1AF16 • 14516
• AF.FFF16
• ABC16 • 7816
• 11.BCD16
• DF1216 • 91516
• FFF16 • 1EF3816
17
Binary Arithmetic
Binary Addition :
In binary addition we add two numbers according to the 0+0=0
column and forward the carry to the next column.
0+1=1
Example:
1+0=1
1 + 1 = 0, and
101011 1011 carry 1 to the
+1011
+00110
10110
next more
110001
significant bit
18
Binary Arithmetic
Binary Subtraction :
Basic rules for binary subtraction are given below: 0-0=0
Example: 0 - 1 = 1, and
borrow 1 from the next

10 100 1010 more significant bit


-1 - 10 - 110
1 10 100 1-0=1
1-1=0
19
Exercise 1.6
Do the Binary Addition : Do the Binary Subtraction :
1. 1110 + 111 1. 1001 – 11
2. 110110 + 110 2. 100 – 11
3. 1011 + 10101 3. 1001 – 110
4. 1010 + 11001 4. 11101 – 110
5. 1101 + 1101 5. 1101 – 111

6. 1110 + 10111 6. 111101 – 1010

7. 1110 + 1111 7. 10111 – 111

20
Signed and Unsigned Numbers

• A binary number may be positive or negative. Generally, we use the symbol “+” and “−”
to represent positive and negative numbers, respectively. The sign of a binary number
has to be represented using 0 and 1, in the computer.
• The left most bit, also called the Most Significant Bit (MSB) is the sign bit.

• In signed binary numbers, the sign bit is 0 for a positive number and 1 for a negative
number. For example, 01100011 is a positive number since its sign bit is 0, and,
11001011 is a negative number since its sign bit is 1.

21
• Complement of Binary Numbers
• Complements are used in computer for the simplification of the subtraction
operation. For any number in base r, there exist two complements—(1) r’s
complement and (2) r-1 ’s complement.

Number System Base Complements possible


Binary 2 1’s complement and 2’s complement
Octal 8 7’s complement and 8’s complement
Decimal 10 9’s complement and 10’s complement
Hexadecimal 16 15’s complement and 16’s complement

22
• Complement of Binary Numbers
• Let us now see how to find the complement of a binary number. There are two
types of complements for the binary number system—1’s complement and 2’s
complement.
• 1’s Complement of Binary Number is computed by changing the bits 1 to 0 and the bits
0 to 1. For example,
1’s complement of 101 is 010
1’s complement of 1011 is 0100
1’s complement of 1101100 is 0010011
• 2’s Complement of Binary Number is computed by adding 1 to the 1’s complement of
the binary number. For example,
2’s complement of 101 is 010 + 1 = 011
2’s complement of 1011 is 0100 + 1 = 0101
23
• Complement of Binary Numbers
• Example: Subtract 10 from 15 using the 2’s complement method or Add +15
and −10.
Solution:
10 = 00001010
1’s complement 11110101
Add 1 + 1
2’s complement = 11110110

+15 = 00001111
-10 = 11110110

00000101 Here, we can see that the MSB is 0 0r the result is


positive. The result is = +5
24
Problems to solve
1. Subtract 100 from 150 using the 2’s complement method.

2. X, Y and Z went to the market and bought three books with the price of X= (110110)2
, Y = (36)8 and Z = (A9)16 taka.
a. Find the price of Z in decimal.
b. X buy higher price books then Y analysis by using 2’s complement method.

25

You might also like