Chapter2a

385 views
298 views

Published on

Published in: Education, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
385
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Chapter2a

  1. 1. Chapter 1DATA REPRESENTATION
  2. 2. ComplementsExamples Examples 10’s C  1’s C • 512790 = 487210 • 011100 = 100011 • 14672.3 = 85327.7  2’s C 7’s C • 010101 = 101011 • 65172 = 12605  16’s C • 59A1D = A65E3
  3. 3. Systems Used to Represent Negative NumbersSigned-Magnitude Representation  A number consists of a magnitude and a symbol indicating whether the magnitude is positive or negative.Examples: +85 = 010101012 -85 = 110101012 +127 = 011111112 -127 = 111111112
  4. 4. Systems Used to Represent Negative NumbersSigned-Complement System• This system negates a number by taking its complement as defined by the system.Examples: +85 = 010101012 -85 = 101010102 (1s) +127 = 011111112 -127 = 100000012 (2s)
  5. 5. Chapter 2COMPUTER ARITHMETIC
  6. 6. Arithmetic in various Number Systems• Addition of numbers in any number system – Add numbers starting at the least significant digit. – Perform addition on numbers of the same number base.• Subtraction of numbers – Must use complements
  7. 7. Binary Addition• To add binary numbers: (X + Y) – Get the SCR of the negative numbers – Add the two numbers – If the SCR used is: • 2s C: Discard end carry • 1s C: Add the end carry to the sum
  8. 8. Example: Binary Addition• Add the following numbers. Use 8 bits to represent each number. – 6 + 13 – 6 + (-13) – (-6) + 13 – (-6) + (-13)
  9. 9. Example: Binary Addition• 6 + 13 = 19
  10. 10. Example: Binary Addition• 6 + 13 = 19 0 0000110
  11. 11. Example: Binary Addition• 6 + 13 = 19 0 0000110+ 0 0001101
  12. 12. Example: Binary Addition• 6 + 13 = 19 0 0000110+ 0 0001101= 0 0010011
  13. 13. Example: Binary Addition• 6 + 13 = 19 • 6 + (-13) = -7 0 0000110 0 0000110+ 0 0001101= 0 0010011
  14. 14. Example: Binary Addition• 6 + 13 = 19 • 6 + (-13) = -7 0 0000110 0 0000110+ 0 0001101 (1s)= 0 0010011
  15. 15. Example: Binary Addition• 6 + 13 = 19 • 6 + (-13) = -7 0 0000110 0 0000110+ 0 0001101 + 1 1110010 (1s)= 0 0010011
  16. 16. Example: Binary Addition• 6 + 13 = 19 • 6 + (-13) = -7 0 0000110 0 0000110+ 0 0001101 + 1 1110010 (1s)= 0 0010011 = 1 1111000
  17. 17. Example: Binary Addition • (-6) + 13 = 7 (2s)6 = 0 0000110
  18. 18. Example: Binary Addition • (-6) + 13 = 7 1 1111010 (2s)6 = 0 0000110
  19. 19. Example: Binary Addition • (-6) + 13 = 7 1 1111010 (2s) + 0 00011016 = 0 0000110
  20. 20. Example: Binary Addition • (-6) + 13 = 7 1 1111010 (2s) + 0 0001101 =10 00001116 = 0 0000110
  21. 21. Example: Binary Addition • (-6) + 13 = 7 1 1111010 (2s) + 0 0001101 =10 00001116 = 0 0000110
  22. 22. Example: Binary Addition • (-6) + 13 = 7 • (-6) + (-13) = -19 1 1111010 (2s) 1 1111010 (2s) + 0 0001101 =10 00001116 = 0 0000110
  23. 23. Example: Binary Addition • (-6) + 13 = 7 • (-6) + (-13) = -19 1 1111010 (2s) 1 1111010 (2s) + 0 0001101 + 1 1110011 (2s) =10 00001116 = 0 0000110
  24. 24. Example: Binary Addition • (-6) + 13 = 7 • (-6) + (-13) = -19 1 1111010 (2s) 1 1111010 (2s) + 0 0001101 + 1 1110011 (2s) =10 0000111 = 11 11011016 = 0 0000110
  25. 25. Example: Binary Addition • (-6) + 13 = 7 • (-6) + (-13) = -19 1 1111010 (2s) 1 1111010 (2s) + 0 0001101 + 1 1110011 (2s) =10 0000111 = 11 11011016 = 0 0000110
  26. 26. Examples: Addition• (999.5 + 281.6)10 1 1 1 999.5 + 281.6 1 281.1
  27. 27. Examples: Addition• (999.5 + 281.6)10 • (110.11 + 101010.11)2 1 1 1 1 1 1 1 1 999.5 110.11 + 281.6 + 101010.11 1 281.1 1100 01.10
  28. 28. Examples: Addition• (355.45 + 240.664)8 355.45 + 240.664 =
  29. 29. Examples: Addition• (355.45 + 240.664)8 1 355.45 + 240.664 = 4
  30. 30. Examples: Addition• (355.45 + 240.664)8 1 355.45 + 240.664 = 34
  31. 31. Examples: Addition• (355.45 + 240.664)8 1 1 355.45 + 240.664 = 6.3 34
  32. 32. Examples: Addition• (355.45 + 240.664)8 1 1 1 355.45 + 240.664 = 6 16.3 3 4
  33. 33. Examples: Addition• (355.45 + 240.664)8 • (A0C.D + E72.9)16 1 1 1 355.45 A0C.D + 240.664 + E72.9 = 6 16.3 3 4 =
  34. 34. Examples: Addition• (355.45 + 240.664)8 • (A0C.D + E72.9)16 1 1 1 1 355.45 A0C.D + 240.664 + E72.9 = 6 16.3 3 4 = .6
  35. 35. Examples: Addition• (355.45 + 240.664)8 • (A0C.D + E72.9)16 1 1 1 1 355.45 A0C.D + 240.664 + E72.9 = 6 16.3 3 4 = 1 8 7 F.6

×