0% found this document useful (0 votes)
13 views21 pages

Khushaal

This presentation covers various number systems including decimal, binary, octal, and hexadecimal, and explains how to convert between them. It details methods for converting decimal to binary, binary to decimal, and includes examples for clarity. Additionally, it discusses one's and two's complement in binary arithmetic.

Uploaded by

aaravdeepak96
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)
13 views21 pages

Khushaal

This presentation covers various number systems including decimal, binary, octal, and hexadecimal, and explains how to convert between them. It details methods for converting decimal to binary, binary to decimal, and includes examples for clarity. Additionally, it discusses one's and two's complement in binary arithmetic.

Uploaded by

aaravdeepak96
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
You are on page 1/ 21

NUMBER SYSTEM

&
CONVERSION

Presented by Khushahal Sahu


Number Systems and Data
Representation
• This presentation explores
various number systems and how
computers represent data,
including integers and real
numbers.

• The number system that we use


in our day-to-day life is the
decimal number system. Decimal
number system has base 10 as it
uses 10 digits from 0 to 9. In
decimal number system.
Introduction to Number Systems
• Decimal Binary Octal Hexadecimal

Base-10 Base-2 system, Base-8 system, Base-16 system,


system, using using digits 0 and using digits 0-7. using digits 0-9 and
digits 0-9. 1. letters A-F.
Converting Between Number
Systems
Decimal to Binary Binary to Decimal

Divide the decimal number by 2 Multiply each binary digit by its


repeatedly, collecting remainders, corresponding power of 2 and sum
which form the binary representation. the results.
Binary To Decimal


• Multiply each bit by 2n, where n is the
"weight" of the bit.
• The weight is the position of the bit,
starting from 0 on the right
• Add the results
EXAMPLE
• (101001) 2 => 1 * 2 0
=1
• 0 * 2 1
=0
• 0 * 2 2
=0
• 1 * 2 3
=8
• 0 * 2 4
=0
• 1 * 2 5
=32
• (41)10
Decimal To Binary

• * Divide by two, keep track of the


remainder
• * First remainder is bit 0 (LSB, least-
significant bit)
• Second remainder is bit 1
Octal to Decimal

Multiply each bit by 8n, where n is the


"weight" of the bit.
• The weight is the position of the bit,
starting from 0 on the right.
• Add the results
EXAMPLE
• (343)8
◦ 3 x 80 =4
◦ 4 x 81 =16
◦ 3 x 82 =
192

=(212)10

Hexadecimal to Decimal

• Technique:
• Multiply each bit by 16n, where n is the
"weight" of the bit
• The weight is the position of the bit,
starting from 0 on the right
• Add the results
OCTAL TO BINARY

• Convert each octal digit to a 3 bit


equivalent binary representation.

• (777) 8 =
• 7 7 7
• 111 111 171
• (777)8= 111000101
COMPLEMENT OF NUMBER
• One's complement: In binary system, if
each 1 is replaced by 0and each 0 by 1,
then resulting number is called as one's
complement of the that number.
• If first number is positive then resulting will
be negative with the same magnitude and
vice versa.
• In binary arithmetic 1's complement of a
binary number N is obtained by the formula
= (2n-1) – N
• Where n is the no of bits in
binary number N.
EXAMPLE
• Convert binary number 1001010 to 1's complement.
• Method:
• Replace 0 with 1 and vice versa.
• N=1001010
• Answer:
• 1's complement of N is 0110101
TWO’S COMPLEMENT
• Two's complement: If 1 is
added to the complement
of a number then resulting
number is known as two's
complement.
• • If MSB is 0 then the
number is positive else if
MSB is 1 then the number
is negative.
• • 2's complement of a
binary number N is
obtained by the formula
(2n) - N, Where n is the no
of bits in number N
EXAMPLE
• Convert binary number 111001101 to 2's complement
• Method:
• 2's complement of a binary no can be obtained by two step
process
• Step 1
• 1's complement of number N = 000110010
• Step 2
• 1's complement + 1
• 000110010 +000000001 = 000110011
• Answer
• 2's complement of a binary no 111001101 is 000110011
Question 1: Convert (101101)₂ to Decimal
Convert the binary number (101101)₂ to its decimal
equivalent.

Solution: Each binary digit represents a power of 2.

(101101)2=1×25+0×24+1×23+1×22+0×21+1×20(10110
1)_2 = 1×2^5 + 0×2^4 + 1×2^3 + 1×2^2 +

0×2^1 + 1×2^0(101101)2​
=1×25+0×24+1×23+1×22+0×21+1×20
=1×32+0×16+1×8+1×4+0×2+1×1=

1×32 + 0×16 + 1×8 + 1×4 + 0×2 +


1×1=1×32+0×16+1×8+1×4+0×2+1×1
=32+0+8+4+0+1=45= 32 + 0 + 8 + 4 + 0 + 1 =
Question 2: Convert (356)₈ to Decimal
Convert the octal number (356)₈ to its decimal equivalent.

Solution: Each digit represents a power of 8.

(356)8=3×82+5×81+6×80(356)_8 = 3×8^2 + 5×8^1 + 6×8^0(356)8​


=3×82+5×81+6×80 =3×64+5×8+6×1=

3×64 + 5×8 + 6×1=3×64+5×8+6×1 =192+40+6=238= 192 + 40 + 6


= 238=192+40+6=238Answer: (356)₈ =

(238)₁₀
Question 3: Convert (245)₁₀ to Binary
Convert the decimal number (245)₁₀ to its binary equivalent.

Solution: Perform successive division by 2:

245÷2=122 remainder 1245 ÷ 2 = 122 \text{ remainder }


1245÷2=122 remainder 1

122÷2=61 remainder 0122 ÷ 2 = 61 \text{ remainder }


0122÷2=61 remainder 0
61÷2=30 remainder 161 ÷ 2 = 30 \text{ remainder }
161÷2=30 remainder 1
30÷2=15 remainder 030 ÷ 2 = 15 \text{ remainder }
030÷2=15 remainder 0 15÷2=7 remainder 115 ÷ 2 = 7 \
text{ remainder } 115÷2=7 remainder 1 7÷2=3 remainder 17 ÷ 2 =
3 \text{ remainder } 17÷2=3 remainder 1 3÷2=1 remainder 13 ÷ 2
= 1 \text{ remainder } 13÷2=1 remainder 1 1÷2=0 remainder 11 ÷
2 = 0 \text{ remainder } 11÷2=0 remainder 1Reading from bottom
Question 4: Convert (2F)₁₆ to Decimal
Convert the hexadecimal number (2F)₁₆ to its decimal equivalent.

Solution: Each digit represents a power of 16.

(2F)16=2×161+F×160(2F)_{16} = 2×16^1 + F×16^0(2F)16​=2×161+F×160(Since F = 15 in


decimal)

=2×16+15×1= 2×16 + 15×1=2×16+15×1 =32+15=47= 32 + 15 = 47=32+15=47Answer:


(2F)₁₆ = (47)₁₀
Question 5: Convert (101011)₂ to Octal
Convert the binary number (101011)₂ to octal.
Solution: Group the binary digits into sets of three from right to left:

101011→101011101011 \rightarrow 101 \quad 011101011→101011Now convert each group to octal:

(101)2=1×22+0×21+1×20=5(101)_2 = 1×2^2 + 0×2^1 + 1×2^0 = 5(101)2​


=1×22+0×21+1×20=5

(011)2=0×22+1×21+1×20=3(011)_2 = 0×2^2 + 1×2^1 + 1×2^0 = 3(011)2​


=0×22+1×21+1×20=3Answer: (101011)₂ = (53)₈
Thank you

You might also like