Number Systems
Number Systems
Number Systems
Number Systems
Join the Group
o [email protected]
Decimal
Binary
Octal
Hexadecimal
Decimal
5
Binary
6
Binary
o Binary TO Decimal Conversion
7
Binary
o Decimal TO Binary Conversion
8
Octal
o Octal to Decimal Conversion
o Decimal to Octal Conversion
o Octal to Binary Conversion
o Binary to Octal Conversion
9
Hexadecimal
o Hex to Decimal Conversion
o Decimal to Hex Conversion
o Hex to Binary Conversion
o Binary to Hex Conversion
10
FRACTIONS
11
Conversion of Decimal fraction to
Binary
Example:
Integer Fraction
0.6875 x 2 = 1.3750 = 1 + 0.3750
x 2 = 0.7500 = 0 + 0.7500
x 2 = 1. 5000 = 1 + 0.5000
x 2 = 1. 0000 = 1 + 0.0000
0.6875 = (0.1 0 1 1) 2
13
Conversion of Decimal fraction to
Binary (cont.)
o To convert a full Decimal Number to Binary, Convert the
integer and Fraction Part Separately:
o Example
Convert 3.6875 to Binary
Step-1
• Convert Integer Part to Binary:
• 3 = (11)2
Step-2
• Convert Fraction Part to Binary:
• 0.6875 = (0.1011)2
Step-3
• Combine them:
• 3.6875 = (11.1011)2
14
Conversion of Binary Fraction to
Decimal fraction
Example:
(0 .10 1 1) 2 = __1 + __
0 + __ 1 + __1
( 2)1 (2 )2 ( 2)3 ( 2)4
15
Conversion of Binary fraction to
Decimal (cont.)
o To convert a full Binary Number to Decimal, Convert the
integer and Fraction Part Separately:
o Example
Convert (11.1011)2 to Decimal
Step-1
• Convert Integer Part to Decimal:
• (11)2 = 3
Step-2
• Convert Fraction Part to Decimal:
• (0.1011)2 = 0.6875
Step-3
• Combine them:
• (11.1011)2 = 3.6875
16
Homework
o Conversion of HEX fractions into Decimal and vice
versa
17
COMPLEMENTS
18
Complements
o Used to simplify subtraction operation in digital
computers
o Simplifying operation simple circuit
o Two Types
Radix Complement (r’s complement)
Diminished Radix Complement ((r-1)’s complement)
Where r = base of the number M
19
Diminished Radix Complement
o Given a number N in base r having n digits, the
diminished radix complement of the number N is
o (rn-1) – N
o For decimal numbers, r=10
o (r-1)’s complement = 9’s complement
o Example:
9’s complement of N = 546700
= 999999-546700 = 453299
20
Diminished Radix Complement (cont)
21
Radix Complement
o Given a number N in base r having n digits, the
diminished radix complement of the number N is
o rn – N for N≠0
o For decimal numbers, r=10
o r’s complement = 10’s complement
o Example:
10’s complement of N = 546700
= 1000000-546700 = 453300
22
Radix Complement (cont)
o For binary numbers, r=2
o r’s complement = 2’s complement
o Example:
2’s complement of N = 1011000
= 10000000-1011000 = 0101000
23
1’s Complement of Binary Numbers
1 1 1 0 1 0 0
0 0 0 1 0 1 1
24
2’s Complement of Binary Numbers
0 0 0 1 0 1 1 1’s complement
1 Add 1
0 0 0 1 1 0 0 2’s complement
25
Subtraction with r’s complemnt
o Example
o X = (0101 0100)2
o Y = (0100 0011)2
o X- Y = ?
X= 0101 0100
2'S complement of Y= 1011 1101
Sum = 1 0001 0001
Discard end carry 28= -1 0000 0000
Answer 0001 0001
26