Number Systems and Conversions Binary Arithmetic Operations
Number Systems and Conversions Binary Arithmetic Operations
Module-1 (Part-1)
Number Systems 1
CONTENTS
Lecture-3
Number Systems 2
CONVERSION BETWEEN NUMBER BASES
✓ The possibilities:
Decimal Binary
Octal Hexadecimal
Number Systems 3
CONVERSION FROM BINARY TO OCTAL
Decimal Binary
Octal Hexadecimal
Number Systems 4
CONVERSION FROM BINARY TO OCTAL
✓ Technique:
1. Group bits in threes, starting on right for integer part and from left for fractional part.
2. Ignore leading zeros and add zeros after decimal if necessary, to form group of three
bits.
3. Convert to octal digits
(1011010111)2 = (1327)8
Number Systems 5
CONVERSION FROM BINARY TO OCTAL
1 2 7 0 . 2 4
(1010111000.0101)2 = (1270.24)8
Number Systems 6
CONVERSION FROM BINARY TO HEXADECIMAL
Decimal Binary
Octal Hexadecimal
Number Systems 7
CONVERSION FROM BINARY TO HEXADECIMAL
✓ Technique:
1. Group bits in fours, starting on right for integer part and from left for fractional part.
2. Ignore leading zeros and add zeros after decimal if necessary, to form group of four bits.
3. Convert to hexadecimal digits
(1010111011)2 = (2BB)16
Number Systems 8
CONVERSION FROM BINARY TO HEXADECIMAL
2 B 8 . 5
(1010111000.0101)2 = (2B8.5)16
Number Systems 9
CONVERSION FROM OCTAL TO BINARY
Decimal Binary
Octal Hexadecimal
Number Systems 10
CONVERSION FROM OCTAL TO BINARY
✓ Technique:
1. Convert each octal digit to a 3-bit equivalent binary representation
✓ Example: (705)8 = (N)2
(705)8 = (111000101)2
Number Systems 11
CONVERSION FROM OCTAL TO BINARY
1 4 7 2 . 1 6
(1472.16)8 = (1100111010.00111)2
Number Systems 12
CONVERSION FROM OCTAL TO HEXADECIMAL
Decimal Binary
Octal Hexadecimal
Number Systems 13
CONVERSION FROM OCTAL TO HEXADECIMAL
✓ Technique:
1. Use binary as an intermediary
✓ Example: (1472.16)8 = (N)16
1 4 7 2 . 1 6
3 3 A . 3 8
Number Systems 14
CONVERSION FROM HEXADECIMAL TO BINARY
Decimal Binary
Octal Hexadecimal
Number Systems 15
CONVERSION FROM HEXADECIMAL TO BINARY
✓ Technique:
1. Convert each hexadecimal digit to a 4-bit equivalent binary representation
✓ Example: (10AF)16 = (N)2
(10AF)16 = (1000010101111)2
Number Systems 16
CONVERSION FROM HEXADECIMAL TO BINARY
A 5 B F . 0 C
(A5BF.0C)16 = (1010010110111111.000011)2
Number Systems 17
CONVERSION FROM HEXADECIMAL TO OCTAL
Decimal Binary
Octal Hexadecimal
Number Systems 18
CONVERSION FROM HEXADECIMAL TO OCTAL
✓ Technique:
1. Use binary as an intermediary
✓ Example: (A5BF.0C)16 = (N)8
A 5 B F . 0 C
1 2 2 6 7 7 . 0 3
Number Systems 19
ASSIGNMENT QUESTION
Number Systems 20
Binary Arithmetic
Number Systems 21
BINARY ADDITION
Number Systems 22
BINARY ADDITION
1 1 1 1 1 1 carries
1
1 1 1 0 1 6 1
+ 1 0 1 1 1 + 2 3
--------------------- ----------
1 0 1 0 1 0 0 8 4
Number Systems 23
BINARY ADDITION
Number Systems 24
BINARY SUBTRACTION
With Borrow 1
Number Systems 25
BINARY SUBTRACTION
Number Systems 26
BINARY MULTIPLICATION
Number Systems 27
BINARY MULTIPLICATION
✓ Example:
1 0 1 1 1 2 3
X 1 0 1 0 X 1 0
----------------------- ----------
0 0 0 0 0 2 3 0
1 0 1 1 1
0 0 0 0 0
1 0 1 1 1
-----------------------
1 1 1 0 0 1 1 0
Number Systems 28
ASSIGNMENT QUESTIONS
Number Systems 29