MGMT 1030 Lecture 35: MGMT 1030 Lecture 35 Notes
MGMT 1030 Lecture 35 Notes – Second Method
Introduction
• I iar for, the odulus osists of a ase folloed the speified uer
of 0s.
• For 16 bits, for example, the modulus is 10000000000000000.
• As as true for the s opleet, the s opleet of a uer a e foud i
one of two ways
• Either sutrat the alue fro the odulus or fid the s opleet iertig
every 1 and 0 and adding 1 to the result.
• The second method is particularly well suited to implementation in the computer, but
you can use whichever method you find more convenient.
• An 8-it sale for s opleet represetatio.
• Tos opleet additio, like s opleet additio i deial, osists of
adding the two numbers mod <the modulus>.
• This is particularly simple for the computer, since it simply means eliminating any 1s that
dot fit ito the uer of its i the ord.
• Subtraction and overflow are handled as we have already discussed.
• As i s opleet, the rage is ueel diided eteen positive and negative.
• The rage for its, for eaple, is − ≤ alue ≤.
• The use of s opleet is ore oo i oputers tha is s opleet, ut
both methods is in use.
• The trade-off is made by the designers of a particular computer
• s opleet akes it easier to hage the sig of a uer
• Addition requires an extra end-around carry step.
• Oes opleet has the additioal draak that the algorith ust test for ad
oert− to at the ed of eah operatio.
• Tos oplement simplifies the addition operation at the expense of an additional add
operation any time the sign change operation is required.
find more resources at oneclass.com
find more resources at oneclass.com