Professional Documents
Culture Documents
3 (Lec 6)
3 (Lec 6)
3 (Lec 6)
Computer Organization
Arithmetic Operations
Ahmad A.Hani
Arithmetic Operations
• Arithmetic operations refer to the operations which can
be carried out on any numbering system.
• Binary addition.
• Binary subtraction.
• Binary multiplication.
• Binary division.
Binary Addition
• It is a key for binary subtraction, multiplication,
division. There are four rules of binary addition.
• 11 Carry
• 0 0 1 1 0 1 0 = 2610
• 0 0 0 1 1 0 0 = 1210
• 0 1 0 0 1 1 0 = 3810
Binary Subtraction
• Subtraction and Borrow, these two words will be used
very frequently for the binary subtraction. There are four
rules of binary subtraction.
Case A-B Subtraction Borrow
1 0-0 0 0
2 1-0 1 0
3 0-1 0 1
4 1-1 0 0
Binary Subtraction
• Example
• 11 Borrow
• 0 0 1 1 0 1 0 = 2610
• 0 0 0 1 1 0 0 = 1210
• 0 0 0 1 1 1 0 = 1410
Binary Multiplication
• Binary multiplication is similar to decimal
multiplication. It is simpler than decimal multiplication
because only 0s and 1s are involved. There are four rules
of binary multiplication. A x B
Case Multiplication
1 0x0 0
2 1x0 0
3 0x1 0
4 1x1 1
Binary Multiplication
• Example
• 0 0 1 1 0 1 0 = 2610
• X 0 0 0 1 1 0 0 = 1210
• 0000000
• 0000000
Addition
• 0011010
• 0011010
• 0 1 0 0 1 1 1 0 0 0 = 31210
Binary Division
• Binary division is similar to decimal division. It is called as the long
division procedure.
• 001011
• 5 = 1 0 1 1 1 0 1 1 1 = 5510
• -101
• 00111
• -101
• 0101
• -0101
• 000
Complement Arithmetic
• Complements are used in the digital computers in order
to simplify the subtraction operation and for the logical
manipulations. For each radix-r system (radix r
represents base of number system) there are two types of
complements.
• Binary Number 1 0 0 1 1 1 0
• 1’s Complement 0 1 1 0 0 0 1
2’s complement
• The 2's complement of binary number is obtained by
adding 1 to the Least Signi cant Bit (LSB) of 1's
complement of the number.
• Binary Number 1 0 0 1 1 1 0
• 1’s Complement 0 1 1 0 0 0 1
• Add 1 +1
• 2’s Complement 0 1 1 0 0 1 0
fi
Octal Arithmetic
• Octal arithmetics is similar to decimal with the base in
regard
• Octal addition
• Example: 123 + 376 = 521
• Octal Subtraction
• Example: 456 - 173 = 263
Hexadecimal Arithmetic
• Hexadecimal arithmetics is similar to decimal with the
base in regard
• Hexadecimal addition
• Example: 4A6 + 1B3 = 659
• Hexadecimal Subtraction
• Example: 4A6 - 1B3 = 2F3