1 / 14

Eng. Mohammed Timraz Electronics & Communication Engineer

University of Palestine Faculty of Engineering and Urban planning Software Engineering Department. Digital Logic Design Lab. ESGD2203. Preface. Arithmetic Binary Operations. Eng. Mohammed Timraz Electronics & Communication Engineer. 5. Arithmetic Binary Operations. 5-1 Binary Addition :.

Download Presentation

Eng. Mohammed Timraz Electronics & Communication Engineer

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. University of Palestine Faculty of Engineering and Urban planning Software Engineering Department Digital Logic Design Lab. ESGD2203 Preface Arithmetic Binary Operations Eng. Mohammed Timraz Electronics & Communication Engineer

  2. 5. Arithmetic Binary Operations 5-1 Binary Addition:

  3. Arithmetic Binary Operations 5-1 Binary Addition: • Example:- • 3+1=4 • By using the truth table to convert the decimal number to binary number. • = 0 1 1 • = 0 0 1 • 0 1 1 • 0 0 1 • 1 0 0 = 4 1 1 +

  4. 5. Arithmetic Binary Operations 5-2 Binary Subtraction:

  5. 5. Arithmetic Binary Operations Arithmetic Binary Operations 5-2 Binary Subtraction: Example:- 5-3=2 By using the truth table to convert the decimal number to binary number. 5 = 1 0 1 3 = 0 1 1 1 0 1 0 1 1 0 1 0 = 2 1 -

  6. 5. Arithmetic Binary Operations 5-3 Binary Multiplication:

  7. 5. Arithmetic Binary Operations Arithmetic Binary Operations 5-3 Binary Multiplication: Example:- 7×3=35 7 = 1 1 1 5 = 1 0 1 • 1 1 • 1 0 1 × 1 1 1 0 0 0 1 1 1 1 0 0 0 1 1 = 35

  8. 5. Arithmetic Binary Operations 5-4 Negative Number Presentation (Sign Number): 5.4.1 Sign Magnitude: LSB MSB Sign Bit - ve + ve Example: + 16 = 0 0 0 1 0 0 0 0 - 16 = 1 0 0 1 0 0 0 0

  9. 5. Arithmetic Binary Operations To get the negative number from positive number, there are two ways as follows: • 5-5 1st Complement: • This is the first way to get the negative number from positive number. • This way just convert each ONE (1) to ZERO (0), and each ZERO (0) to ONE (1). Example: + 13 = 1 1 0 1 + 13 = 0 0 1 0

  10. 5. Arithmetic Binary Operations 5-6 2nd Complement: There are two ways to get the 2nd complement: First Way: we can get the 2nd complement by adding 1 to the 1st complement 2nd complement = 1st complement + 1 Example: + 6 = 0 1 1 0 The 1st complement to +6 is: 1 0 0 1 2nd complement = 1st complement + 1 Then the 2nd complement for +6 is: 1 0 0 1 0 0 0 1 1 0 1 0 = -6 1 +

  11. 5. Arithmetic Binary Operations 5-6 2nd Complement: There are two ways to get the 2nd complement: Second Way: we can get the 2nd complement by convert each ONE (1) to ZERO (0) after the first ONE (1) we catch it from right side. Example: + 10 = 1 0 1 0 0 1 1 0 = - 10 - - - - - - - - - - -

  12. 5. Arithmetic Binary Operations 5-7 Division: Example: 21 ÷ 7 = 3 The result of the division operation is equal to the number of the subtraction operations to reach the smallest integer number. 21 – 7 = 14 14 – 7 = 7 7 – 7 = 0 } 1 3 subtraction operations 2 3 So, the result 3 is equal to the subtraction operations numbers

  13. 5. Arithmetic Binary Operations 5-7 Division: Example: 21 ÷ 7 = 3 The result of the division operation is equal to the number of the subtraction operations to reach the smallest integer number. 21 – 7 = 14 14 – 7 = 7 7 – 7 = 0 } 1 3 subtraction operations 2 3 The result 3 is equal to the subtraction operations numbers, So, if we convert each number to binary number and applied the subtraction operation, the result will be the number of subtraction operations The subtraction operation can be applied by using the 2nd complement and applied the addition operation as appears in the following example

  14. Example: • 35 ÷ 7 = 5 • = 0 0 1 0 0 0 1 1 • = 0 0 0 0 0 1 1 1 • -7 = 1 1 1 1 1 0 0 1 • = 0 0 1 0 0 0 1 1 • -7 = 1 1 1 1 1 0 0 1 • 1 0 0 0 1 1 1 0 0 • -7 = 1 1 1 1 1 0 0 1 0 0 0 1 0 1 0 1 • And complete the operation to reach ZERO, we will complete it by 5 addition’s operations. + N.C +

More Related