These are all different interpretations of the same bit ...jmconrad/ECGR2181-2008... · To add...
Transcript of These are all different interpretations of the same bit ...jmconrad/ECGR2181-2008... · To add...
![Page 1: These are all different interpretations of the same bit ...jmconrad/ECGR2181-2008... · To add sign-magnitude numbers: (1) if signs are the same, just add magnitudes and preserve](https://reader033.fdocuments.in/reader033/viewer/2022052005/6018efaf62e0840e981acb1b/html5/thumbnails/1.jpg)
These are all different interpretations of the same bit string.
1
![Page 2: These are all different interpretations of the same bit ...jmconrad/ECGR2181-2008... · To add sign-magnitude numbers: (1) if signs are the same, just add magnitudes and preserve](https://reader033.fdocuments.in/reader033/viewer/2022052005/6018efaf62e0840e981acb1b/html5/thumbnails/2.jpg)
Problems with non-positional: (1) large numbers require lots of bits, (2) arithmetic is not easy.
Positional: compact, simple arithmetic.
2
![Page 3: These are all different interpretations of the same bit ...jmconrad/ECGR2181-2008... · To add sign-magnitude numbers: (1) if signs are the same, just add magnitudes and preserve](https://reader033.fdocuments.in/reader033/viewer/2022052005/6018efaf62e0840e981acb1b/html5/thumbnails/3.jpg)
3
![Page 4: These are all different interpretations of the same bit ...jmconrad/ECGR2181-2008... · To add sign-magnitude numbers: (1) if signs are the same, just add magnitudes and preserve](https://reader033.fdocuments.in/reader033/viewer/2022052005/6018efaf62e0840e981acb1b/html5/thumbnails/4.jpg)
100110
4
![Page 5: These are all different interpretations of the same bit ...jmconrad/ECGR2181-2008... · To add sign-magnitude numbers: (1) if signs are the same, just add magnitudes and preserve](https://reader033.fdocuments.in/reader033/viewer/2022052005/6018efaf62e0840e981acb1b/html5/thumbnails/5.jpg)
5
![Page 6: These are all different interpretations of the same bit ...jmconrad/ECGR2181-2008... · To add sign-magnitude numbers: (1) if signs are the same, just add magnitudes and preserve](https://reader033.fdocuments.in/reader033/viewer/2022052005/6018efaf62e0840e981acb1b/html5/thumbnails/6.jpg)
To add sign-magnitude numbers:
(1) if signs are the same, just add magnitudes and preserve sign (ignoring overflow for now)
(2) if signs are different, subtract smaller magnitude from larger and set sign according to larger
To add one’s complement:
Add normally, then increment by carry-out.
6
![Page 7: These are all different interpretations of the same bit ...jmconrad/ECGR2181-2008... · To add sign-magnitude numbers: (1) if signs are the same, just add magnitudes and preserve](https://reader033.fdocuments.in/reader033/viewer/2022052005/6018efaf62e0840e981acb1b/html5/thumbnails/7.jpg)
Common mistake: I say, “What is the two’s complement representation of +5?”
Student takes the two’s complement of +5 (00101) and tells me “11011”.
7
![Page 8: These are all different interpretations of the same bit ...jmconrad/ECGR2181-2008... · To add sign-magnitude numbers: (1) if signs are the same, just add magnitudes and preserve](https://reader033.fdocuments.in/reader033/viewer/2022052005/6018efaf62e0840e981acb1b/html5/thumbnails/8.jpg)
8
![Page 9: These are all different interpretations of the same bit ...jmconrad/ECGR2181-2008... · To add sign-magnitude numbers: (1) if signs are the same, just add magnitudes and preserve](https://reader033.fdocuments.in/reader033/viewer/2022052005/6018efaf62e0840e981acb1b/html5/thumbnails/9.jpg)
9
![Page 10: These are all different interpretations of the same bit ...jmconrad/ECGR2181-2008... · To add sign-magnitude numbers: (1) if signs are the same, just add magnitudes and preserve](https://reader033.fdocuments.in/reader033/viewer/2022052005/6018efaf62e0840e981acb1b/html5/thumbnails/10.jpg)
Memorize this table!
10
![Page 11: These are all different interpretations of the same bit ...jmconrad/ECGR2181-2008... · To add sign-magnitude numbers: (1) if signs are the same, just add magnitudes and preserve](https://reader033.fdocuments.in/reader033/viewer/2022052005/6018efaf62e0840e981acb1b/html5/thumbnails/11.jpg)
11
![Page 12: These are all different interpretations of the same bit ...jmconrad/ECGR2181-2008... · To add sign-magnitude numbers: (1) if signs are the same, just add magnitudes and preserve](https://reader033.fdocuments.in/reader033/viewer/2022052005/6018efaf62e0840e981acb1b/html5/thumbnails/12.jpg)
12
![Page 13: These are all different interpretations of the same bit ...jmconrad/ECGR2181-2008... · To add sign-magnitude numbers: (1) if signs are the same, just add magnitudes and preserve](https://reader033.fdocuments.in/reader033/viewer/2022052005/6018efaf62e0840e981acb1b/html5/thumbnails/13.jpg)
13
![Page 14: These are all different interpretations of the same bit ...jmconrad/ECGR2181-2008... · To add sign-magnitude numbers: (1) if signs are the same, just add magnitudes and preserve](https://reader033.fdocuments.in/reader033/viewer/2022052005/6018efaf62e0840e981acb1b/html5/thumbnails/14.jpg)
14
![Page 15: These are all different interpretations of the same bit ...jmconrad/ECGR2181-2008... · To add sign-magnitude numbers: (1) if signs are the same, just add magnitudes and preserve](https://reader033.fdocuments.in/reader033/viewer/2022052005/6018efaf62e0840e981acb1b/html5/thumbnails/15.jpg)
15
![Page 16: These are all different interpretations of the same bit ...jmconrad/ECGR2181-2008... · To add sign-magnitude numbers: (1) if signs are the same, just add magnitudes and preserve](https://reader033.fdocuments.in/reader033/viewer/2022052005/6018efaf62e0840e981acb1b/html5/thumbnails/16.jpg)
16
![Page 17: These are all different interpretations of the same bit ...jmconrad/ECGR2181-2008... · To add sign-magnitude numbers: (1) if signs are the same, just add magnitudes and preserve](https://reader033.fdocuments.in/reader033/viewer/2022052005/6018efaf62e0840e981acb1b/html5/thumbnails/17.jpg)
17
![Page 18: These are all different interpretations of the same bit ...jmconrad/ECGR2181-2008... · To add sign-magnitude numbers: (1) if signs are the same, just add magnitudes and preserve](https://reader033.fdocuments.in/reader033/viewer/2022052005/6018efaf62e0840e981acb1b/html5/thumbnails/18.jpg)
18
![Page 19: These are all different interpretations of the same bit ...jmconrad/ECGR2181-2008... · To add sign-magnitude numbers: (1) if signs are the same, just add magnitudes and preserve](https://reader033.fdocuments.in/reader033/viewer/2022052005/6018efaf62e0840e981acb1b/html5/thumbnails/19.jpg)
Could also subtract, with borrows, from left to right.
This way, they only have to learn addition and they're prepared for LC-2, which doesn't have a subtract instruction.
19
![Page 20: These are all different interpretations of the same bit ...jmconrad/ECGR2181-2008... · To add sign-magnitude numbers: (1) if signs are the same, just add magnitudes and preserve](https://reader033.fdocuments.in/reader033/viewer/2022052005/6018efaf62e0840e981acb1b/html5/thumbnails/20.jpg)
11001000
11110010 = -14
20
![Page 21: These are all different interpretations of the same bit ...jmconrad/ECGR2181-2008... · To add sign-magnitude numbers: (1) if signs are the same, just add magnitudes and preserve](https://reader033.fdocuments.in/reader033/viewer/2022052005/6018efaf62e0840e981acb1b/html5/thumbnails/21.jpg)
21
![Page 22: These are all different interpretations of the same bit ...jmconrad/ECGR2181-2008... · To add sign-magnitude numbers: (1) if signs are the same, just add magnitudes and preserve](https://reader033.fdocuments.in/reader033/viewer/2022052005/6018efaf62e0840e981acb1b/html5/thumbnails/22.jpg)
22
![Page 23: These are all different interpretations of the same bit ...jmconrad/ECGR2181-2008... · To add sign-magnitude numbers: (1) if signs are the same, just add magnitudes and preserve](https://reader033.fdocuments.in/reader033/viewer/2022052005/6018efaf62e0840e981acb1b/html5/thumbnails/23.jpg)
Memorize this table!
23
![Page 24: These are all different interpretations of the same bit ...jmconrad/ECGR2181-2008... · To add sign-magnitude numbers: (1) if signs are the same, just add magnitudes and preserve](https://reader033.fdocuments.in/reader033/viewer/2022052005/6018efaf62e0840e981acb1b/html5/thumbnails/24.jpg)
24
![Page 25: These are all different interpretations of the same bit ...jmconrad/ECGR2181-2008... · To add sign-magnitude numbers: (1) if signs are the same, just add magnitudes and preserve](https://reader033.fdocuments.in/reader033/viewer/2022052005/6018efaf62e0840e981acb1b/html5/thumbnails/25.jpg)
25
![Page 26: These are all different interpretations of the same bit ...jmconrad/ECGR2181-2008... · To add sign-magnitude numbers: (1) if signs are the same, just add magnitudes and preserve](https://reader033.fdocuments.in/reader033/viewer/2022052005/6018efaf62e0840e981acb1b/html5/thumbnails/26.jpg)
26