ࡱ> ` bjbjss *| 4vvvvvvv \0\0\08040lM<@2@2@2@2@2@2@2@2mMoMoMoMoMoMoM$*OhQMvP3@2@2P3P3Mvv@2@2Mn4n4n4P3v@2v@2mMn4P3mMn4n4`Dvv%H@242 @CD\0`3(%G8QHM0M]GR3Rp%HRv%H,@20p2"n422@2@2@2MM^4@2@2@2MP3P3P3P3\0\04"vvvvvv Department of Computer and Mathematical SciencesCS 2401 Assembly Language2 Lab 2: Arithmetic Operations of Signed Number in Binary Objectives: The main objective of this lab is to learn how to add and subtract signed number in signed and magnitude, 1s and 2s complements. Task 1: Signed and Magnitude System Note that subtraction is the same as addition with negative number. A process of addition in signed and magnitude is as follows: Convert the two numbers to signed and magnitude. If the two numbers have the same sign, find the sum of the magnitudes and keep the sign bit. If the two numbers have the different signs, find the difference of the magnitudes and keep the sign of the larger magnitude. Activity 1.1: Perform the following operation in signed and magnitude in 8 bits: 17 + 35 00010001+0010001100110100 Activity 1.2: Perform the following operation in signed and magnitude in 8 bits: (17 + 35 10010001+0010001100010010 Activity 1.3: Perform the following operation in signed and magnitude in 8 bits: (23 ( 44 10010111+1010110011000011 Task 2: 1s Complement A process of addition in 1s complement is as follows: Convert the two numbers to 1s complement. Perform addition. If there is a carry out, add one to the sum. Activity 2.1: Perform the following operation in 1s complement in 8 bits: 17 + 35 00010001+0010001100110100 Activity 2.2: Perform the following operation in 1s complement in 8 bits: (17 + 35 11101110+00100011100010001 100010010 Activity 2.3: Perform the following operation in 1s complement in 8 bits: (23 ( 44 11101000+11010011110111011 110111100 Task 3: 2s Complement A process of addition in 2s complement is as follows: Convert the two numbers to 2s complement. Perform addition. Activity 3.1: Perform the following operation in 2s complement in 8 bits: 17 + 35 00010001+0010001100110100Activity 3.2: Perform the following operation in 2s complement in 8 bits: (17 + 35 11101111+0010001110001001000010010 Activity 3.3: Perform the following operation in 2s complement in 8 bits: (23 ( 44 11101001+1101010011011110110111101 Activity 3.4: Perform the following operation in 2s complement in 8 bits: 10100000 carry10101001+1011010010101110101011101 Activity 3.5: Is the result in Activity 3.4 correct? If the answer is either yes or no, explain why? No, since Carry in is not the same as carry out. Task 4: Hexadecimal System A Hexadecimal number is a number with base sixteen. Activity 4.1: Perform the following operation: 2A9F6+D6B5810154E Activity 4.2: Perform the following operation: D6B58-2A9F6AC162     Name: ______________________________ 56PS A # * + - 8 9 C D N O Q _ ` # $ ' ( , ڼ󼝌|p|pp j-hi5CJhhiB*CJOJQJhph hRBhiB*OJQJhph$hRBhiB*CJOJQJhphhiCJOJQJ^Jhi5CJh hi\h hi5h hi5CJ hiCJ hi5CJ4 hi5 hi5CJhijhiU,56>PR $$Ifa$$IfRST  UPKFPPP$a$$a$$a$kd$$IfTl  rJ$   Mp   0  4 laT A Q , - 6 8 9 kqkd $$Ifl40+Yi064 la>f4 $$Ifa$$If$a$$ & Fa$$a$ 9 B C D M N qkd $$Ifl40+Y i064 la>f4$IfN O P Q R v $$Ifa$$If$a$$a$nkd!$$Ifl0+Yi064 la> $Ifqkd"$$Ifl40+Yi064 la>f4 $IfqkdR#$$Ifl40+Y i064 la>f4 , - 6 8 v $$Ifa$$If$a$$a$nkd!$$$Ifl0+Yi064 la>, - 8 9 C D N O P Q Y h i  X _ c n o y z  ýýyt hihhi5OJQJ^J j-hi5h hi5\hiCJOJQJ^J hi\hhi hi\ hi5 hi5h hiCJhiB*CJOJQJhph hRBhiB*OJQJhph$hRBhiB*CJOJQJhphhi5CJh*8 9 B C $Ifqkd%$$Ifl40+Yi064 la>f4C D M N $Ifqkd%$$Ifl40+Y i064 la>f4N O P Q i b c {{{rm$a$$B^Ba$$ & Fa$$a$$a$nkd&$$Ifl0+Yi064 la> c l n o x y qkdw'$$Ifl40+Yi064 la>f4 $$Ifa$$Ify z $Ifqkd>($$Ifl40+Y i064 la>f4 wn $$Ifa$ $$Ifa$$a$$a$$a$nkd )$$Ifl0+Yi064 la> $If $$Ifa$qkd)$$Ifl40+ i064 laf4 $If $$Ifa$qkd*$$Ifl40+  i064 laf4  $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>!vh5Y5i#vY#vi:V l406+5Y5i/  / / 4a>f4$$If>!vh5Y5i#vY#vi:V l065Y5i/ / / / / 4a>$$If>!vh5Y5i#vY#vi:V l406+,5Y5i/ /  4a>f4$$If>!vh5Y5i#vY#vi:V l406+5Y5i/  / / 4a>f4$$If>!vh5Y5i#vY#vi:V l065Y5i/ / / / / 4a>$$If>!vh5Y5i#vY#vi:V l406+,5Y5i/ /  4a>f4$$If>!vh5Y5i#vY#vi:V l406+5Y5i/  / / 4a>f4$$If>!vh5Y5i#vY#vi:V l065Y5i/ / / / / 4a>$$If>!vh5Y5i#vY#vi:V l406+,5Y5i/ /  4a>f4$$If>!vh5Y5i#vY#vi:V l406+5Y5i/  / / 4a>f4$$If>!vh5Y5i#vY#vi:V l065Y5i/ / / / / 4a>$$If!vh5 5i#v #vi:V l406+,5 5i/ /  4af4$$If!vh5 5i#v #vi:V l406+5 5i/  / / 4af4$$If!vh5 5i#v #vi:V l065 5i/ / / / 4a$$If!vh5 5i#v #vi:V l065 5i/ / / / / 4a$$If!vh5 5i#v #vi:V l406+,5 5i/ /  4af4$$If!vh5 5i#v #vi:V l406+5 5i/  / / 4af4$$If!vh5 5i#v #vi:V l065 5i/ / / / 4a$$If!vh5 5i#v #vi:V l065 5i/ / / / / 4a$$If>!vh5Y5i#vY#vi:V l406+,5Y5i/ /  4a>f4$$If>!vh5Y5i#vY#vi:V l406+5Y5i/  / / 4a>f4$$If>!vh5Y5i#vY#vi:V l065Y5i/ / / / / 4a>$$If!vh5 5i#v #vi:V l406+,5 5i/ /  4af4$$If!vh5 5i#v #vi:V l406+5 5i/  / / 4af4$$If!vh5 5i#v #vi:V l065 5i/ / / / 4a$$If!vh5 5i#v #vi:V l065 5i/ / / / / 4a$$If!vh5 5i#v #vi:V l406+,5 5i/ /  4af4$$If!vh5 5i#v #vi:V l406+5 5i/  / / 4af4$$If!vh5 5i#v #vi:V l065 5i/ / / / 4a$$If!vh5 5i#v #vi:V l065 5i/ / / / / 4a$$If!vh5 5#v #v:V l406,5 5c/ 4af4$$If!vh5 5#v #v:V l406+,5 5c/ /  4af4$$If!vh5 5#v #v:V l406+5 5c/  / / 4af4$$If!vh5 5#v #v:V l065 5c/ / / / 4a$$If!vh5 5#v #v:V l065 5c/ / / / / 4a$$If!vh5 5i#v #vi:V l406+,5 5i/ /  4af4$$If!vh5 5i#v #vi:V l406+5 5i/  / / 4af4$$If!vh5 5i#v #vi:V l065 5i/ / / / / 4a$$If!vh5 5i#v #vi:V l406+,5 5i/ /  4af4$$If!vh5 5i#v #vi:V l406+5 5i/  / / 4af4$$If!vh5 5i#v #vi:V l065 5i/ / / / / 4a<@< NormalCJ_HmH sH tH 8@8 Heading 1$@&CJ<@< Heading 2$@&5CJ N@N Heading 3$h@&^hB*CJhtH uH@H Heading 4$@&5B*CJhtH uV@V Heading 5$@&^`B*CJhtH uDAD Default Paragraph FontVi@V  Table Normal :V 44 la (k(No List 4>@4 Title$a$5CJ4 @4 Footer  !<Z@< Plain Text CJOJQJ8@"8 Header  !CJPC@2P Body Text Indent$^a$\h:B@B: Body Text$a$\h | z z zP U56>PRSTAQ,-689CDMNOPQR,-689CDMNOPQi  bclnoyz  denpq{|$%{|   !"#wx       & ' ( 1 2 3 4 ! P Q W Y Z a b i j k l  luuu62l$$$$$$$$$$$$$$$aa`a`aa`$a$a$$ $aa`a`aa`$a$$$ $aa`a`aa`$a$$$$$$$$$$aa`a`aa`$a$a$$ $5aa`5a`5a5aaD5aa`$$$ $5aa`5a`5a5aaD5aa`$$$$$$$$$$aa`a`aa`$ $5aa`5a`5aa`5aa`$$ $5aa`5a`5aa`5aa`$$$5aa`5aa`5a`5aa`5aa`$$$$$$$$$$$$5aa`5a`5aa`$$$5aa`5a`5aa`$$v:$v:$56>PRSTAQ,-689BCDMNOPQR,-689BCDMNOPQi  bclnoxyz  denpqz{|$%{|    !"#wx        & ' ( 1 2 3 4 ! P Q W Y Z ` a b i j k l 0 000 0 00 0 0 080H0T000000 0 0 000000 0d0 0 00 0 00000000 00 0 00 0 00000000 00 0 00 0 000000 0 0 00000 0 0 0 0 0 0 0 0 000000 0 0 0 0 0 00 0 0 0 0 0 00000 0 0 0 0 0 00 0 0 0 0 0 00000 0 00000 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 0 0 0 0 0000 0 0 0 0 0 0 0 0 0 0 0 0000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0000000000000 0 0 0 0 0 0 0 0 0000 0 0 0 0 0 0 0 0 0h0ah0ah0ah0ah0ah0ah0ah0a00h0a 333336, i '28R 9 N 8 C N c y  p{ !'2Qaj  !"#$%&()*+,-./01345679:;<= ӫs#ԫsD#h;Sf &^q 8*urn:schemas-microsoft-com:office:smarttagstime > 08HourMinute  ::6T-R-ice%|#x4 Q l  dK kvV{ cy7}  Yx`  c < ;]( 1Jf* -B8. ]9A .jMB NB]jZ h xfi EDo c4rBYp t\Znu U yrgh9} *hh^h`o(.hTT^T`)h$$^$`.hL^`L.h  ^ `.h^`.hdLd^d`L.h44^4`.h^`.hL^`L. hh^h`OJQJo(h^`)h^`.hL^`L.h  ^ `.hRR^R`.h"L"^"`L.h^`.h^`.hL^`L.hh^h`o() hh^h`OJQJo( hh^h`OJQJo(hh^h`.hh^h`o()hh^h`.Z^`o( hh^h`OJQJo( hh^h`OJQJo(Z^`o(Z^`o( hh^h`OJQJo( hh^h`OJQJo( hh^h`OJQJo(hh^h`o()Z^`o(h^`)h^`.hL^`L.h  ^ `.hRR^R`.h"L"^"`L.h^`.h^`.hL^`L. hh^h`OJQJo(h^`)h^`.hL^`L.h  ^ `.hRR^R`.h"L"^"`L.h^`.h^`.hL^`L.hh^h`o()dK;](EDo7} 9}\Znu1Jf*{<- c8. N]jZ.jMYx`]9Ac4rxfihkcYp tU yh @CJ$OJQJo(4@CJ2OJQJo(4@CJ,OJQJo(4                                    lZiNRB56PRS,-689BCDMNO!-689BCDMNOUclnoxyz  Yenpqz{|n|    !"lx        & ' ( 1 2 3 B ! P Q W Y Z ` a b i j k .#0@O d + P@UnknownGz Times New Roman5Symbol3& z Arial?5 z Courier NewEMonotype Sorts"hFF#f  $>4d  3QHP(?i2*CS2401- Computer Organization and Assembly/Lab 2 - Arithmetic Operations On Signed NumbersOngard SirisaengtaksinGX620p                    Oh+'0$0@ P\ |   ,CS2401- Computer Organization and Assembly0Lab 2 - Arithmetic Operations On Signed NumbersOngard SirisaengtaksinNormalGX6202Microsoft Office Word@Ik@XK@v}/D@v}/D ՜.+,0  hp   UH-Downtown  +CS2401- Computer Organization and Assembly Title  !"#$%&'()*+,-./0123456789:;<=>@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`bcdefghijklmnopqrstuvwxyz{|}~Root Entry FDDData ?kB1TableaSWordDocument*|SummaryInformation(DocumentSummaryInformation8CompObjq  FMicrosoft Office Word Document MSWordDocWord.Document.89q