Unit 1 - Lecture - 3 - Binary Arithmetic Operators
Unit 1 - Lecture - 3 - Binary Arithmetic Operators
Unit I: Lecture 3
Lecture 3: Binary Arithmetic Operations
Dr.R.EZHILARASIE
Assistant Professor
School of Computing
SASTRA Deemed to be University
1
Objectives
2
Binary Arithmetic
• Basics of Binary Addition, Subtraction, Multiplication and Division
Binary Addition a) 11+10 b) 111 +11
0 1 1 0 0 1 1 0 1
1 0 1 0 1 0 1 0 1
1 1 0 1 1 1 1 1 1
3
Binary Subtraction
Binary Subtraction
• Four Basic rules for subtracting binary digits a) 11 - 01 b) 101 - 011
A B Sub Borrow
0 0 0 0
0 1 1 1
1 0 1 0
1 1 0 0
4
Binary Multiplication
• Four Basic rules for multiplying binary digits a) 11 * 10 b) 111 * 11
A B Mul
(A * B)
0 0 0
0 1 0
1 0 0
1 1 1
5
Binary Division
• Similar to decimal division
• Called as the long division procedure a) 110 / 10
6
Signed Binary Numbers (SBN)
• Digital Systems able to handle both Positive and Negative Numbers
– 1’ Complement
– 2’s Complement
7
Signed Binary Numbers: Representation
Sign Magnitude
• Negative Number has the same magnitude bits as positive number but the sign bit is 1 rather zero
• Eg: - 20
8
Example
• Express – 12 as an 8-bit number in a) Sign magnitude
b)1’s complement c) 2’s complement
9
Example
• 2’s Complement are mostly used in Computers and microprocessor based systems
• Determine the decimal values of SBN in 2’ s Complement Form
• Eg: a) 01010111 b) 11010111
10
Arithmetic operations with Signed Binary Numbers
• Addition
– Addition of two positive numbers yields a positive number
Ex: 00001000 + 00001010
– Addition of positive number and a smaller negative number yields a positive number
Ex: 10 - 3
11
SBN: Addition
• Addition of positive number and a larger negative number yields a negative number in 2’s
complement form
Ex: 4 – 8
12
SBN: Subtraction
• To subtract 2 SBN, take the 2’s Complement of the subtrahend and add.
Discard any final carry bit.
• Eg: a) 8 – 3
13
Summary
• Binary Arithmetic Operations
• Representation of SBN
14
Thank You
15