1 / 16

CMP 101 Fundamentals of Computer and programming in C

CMP 101 Fundamentals of Computer and programming in C. Rohit Khokher. Computer Arithmetic. Every thing that can be done in decimal number system can also be done in binary number system. Binary Arithmetic. Addition. A carry of 1 to the next higher column. Examples. 5. 2. 7. 1. 1. 1.

pomona
Download Presentation

CMP 101 Fundamentals of Computer and programming in C

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. CMP 101 Fundamentals of Computer and programming in C RohitKhokher

  2. Computer Arithmetic Every thing that can be done in decimal number system can also be done in binary number system Binary Arithmetic

  3. Addition A carry of 1 to the next higher column

  4. Examples 5 2 7 1 1 1 1 1 0 0

  5. Examples 1 1 1 1 1 1 0 0 0 0 1 0

  6. Subtraction A borrow from the left column 10

  7. Subtraction 1 2 2 2 0 0 0 0 1 1 1

  8. Complementary Subtraction Complement = (basen -1) –m Where: M is the number. n denotes number of digits in m Complement of 3710 = 102 -1-37=99-37 = 6210

  9. Complementary Method Find complement of subtrahend Add the minuend If there is carry of 1, add it. If no carry, then re-complement the result and negate the number.

  10. Complementary Method Subtract 5610 (subtrahend) from 9210 (minuend) 99-56 + 92 =135, 35+1 =36 There is a carry so add it Subtract 3510 (subtrahend) from 1810 (minuend) 99-35 + 18 =82 There is no carry so re-complement and negate the result 99-82 = -17

  11. Complementary Method Subtract 0111000 from 10111000 Result

  12. Complementary Method Subtract 100011 from 010010 Place a Negative Sign

  13. Multiplications Multiplicand Multiplier For each 0 shift left

  14. Multiplications Carry 1 1 1 1 1 1 1 1

  15. Division Quotient 0 1 0 1 Divisor Dividend Result 0101.11 0 Subtraction not possible quotient 0 Subtraction possible quotient 1 Remainder

More Related