Computer organization and architecture themes and variations 1st edition alan clements solutions manual PDF

Title Computer organization and architecture themes and variations 1st edition alan clements solutions manual
Author Ceti Mam
Course Computer Vision
Institution University of Delhi
Pages 24
File Size 887.8 KB
File Type PDF
Total Downloads 33
Total Views 138

Summary

Computer organization and architecture themes and variations 1st edition alan clements solutions manual...


Description

Computer Organization and Architecture Themes and Variations 1st Edition Alan Clements Solutions Manual Full Download: http://testbanklive.com/download/computer-organization-and-architecture-themes-and-variations-1st-edition-al

Chapter 2: Computer Arithmetic and Digital Logic  1.

 2.



Whyisbinaryarithmeticemployedbydigitalcomputers?  SOLUTION  Binary arithmetic is used entirely because digital systems are constructed with two‐state logic elements. If semiconductor manufacturing processes changed and allowed logic elements with five states, then base‐5 arithmeticwouldbeused. Wesaidthatbinaryvalueshavenointrinsicinformation(thatistrueofallother numberrepresentations).The VoyagerIspacecraft,containingsamplesofhumanmusic andothermessages,wasthefirsthumanartifactto leave the solar system to travel to the stars. How is it possible to communicate with aliens in binary form if thereisnointrinsicmeaningtothedata?  SOLUTION

 Itis,ofcourse,truethatbinary datahasnointrinsicinformation, anda pattern of1sand0s hasnointrinsic meaningotherthanthatgiventoitby theprogrammer;forexample,we agreethatthebinarycode01000001 representstheletter‘A’inASCIIandrepresents65asan8421‐weighted,unsignedbinary,integer.  Science Fiction writers have long thought about how communication might take place between different civilizations.Onepossiblesolutionistoconstructalanguageusinginformationthatcanbeshared.Forexample, there are universal constants such as the speed of light, the spectral lines of the hydrogen spectrum, the periodictableandthenumberof protonsineachelement.Similarly,therearemathematicalconcepts suchas primenumbers,constantssuchasπande,andsoon.So,bytransmitting,say,aseriesofprimenumbersorthe atomicnumbersof membersoftheperiodic table,analienintelligencewouldbeableto guessthesequence andthenworkouthowthenumbershavebeenencoded.   An interesting case of decoding in the face of little information took place in WW2. The British had German Enigmamachinesbutneededtoseeatranslationofknowndata beforetheycouldperform generaldecoding. So,theyarrangedforbombstobedroppedontoemptyseanearaGermansubmarine.TheGermansubmarine observed the bombs and transmitted their position back to base. The message was intercepted and the decodingperformedbylookingfortheencodedpositionofthebombsusingtheknownactualposition.  3.

Howmuchmoreinaccurateisbinaryintegerarithmeticthandecimal integerarithmetic? Can the accuracyof binarycomputersbeimprovedtomakethemasaccurateasdecimalcomputers?



SOLUTION  Thisisatrickquestion.Intheabsenceofactualerrors(faulty hardwareor software),anydigitallogicsystem is perfectlyaccurate;thatis,acalculationinonebaseyieldsthesameresultasacalculationinanotherbase.Any so‐called inaccuracies result from finite word‐lengths (e.g., a 10‐bit binary value represents a number to one part in 210 (one in in 1,000) whereas a 10‐bit decimal number allows a representation of 1 part in 10,000,000,000). Inaccuracies arise in fractional calculations (remember that a number like π cannot be representedinafinitenumberofdigits).Similarly,notalldecimalfractionscanalwaysberepresentedexactly inbinarybyafinitenumberofbits.  4. 

Whyarecomputersbyte‐oriented?

SOLUTION  There is no logical reason – it is a matter of custom and historical development. During the development of computers many different wordlengths were used. Some early computers actually had a 6‐bit byte. First‐ 16 © 2014 Cengage Learning. All Rights Reserved. May not be scanned, copied, or duplicated, or posted to a publicly available website, in whole or in part.

F ll d

l

d ll h

t

i t

tl

l

t S l ti

M

l T tB

k it

t tb

kli

generationmicroprocessorshad8‐bitdataregisters.8bitswerecalledbytes.Byusingthebyteasabasicunitof dataitmeansthat16,32,and 64‐bitaddressesfitexactly inanintegernumberofbytes(which is,ofcourse, whywechoosetheseaddresswidths).Ifanaddresswere34 bits wide in abyte‐orientedworld,thenitwould requirea40‐bitwordof5bytestostoretheaddresswith6bitsunused.  Moreimportantly,abyteis8,bitswhichis23andthatfitswellinabinaryword.Anotherreasonforemploying an8‐bitbyteisthatitallows28=256differentcharacters which fit inwell with the extended ASCII character set.  Isometimewonderwhetherthebasicunitofdatainacomputershouldhavebeen12bits.Thatwouldpermita widerrangeof representationusingthebasicunit(1in212=4,096)whichwouldhaveprovidedfor(a)greater precision in simple calculations and (b) a greater ability to encode alphabets. Moreover, a 12‐bit unit would allowafeasibleaddressinsimplecontrol applications(4Klocations),whereasan8‐bitunithas tobeused to createa16‐bitaddress.  5. 

Calculationsaretobeperformedtoaprecisionof0.001%.Howmanybitsdoesthisrequire?

SOLUTION  Aprecisionof0.001%isonepartin100,000.Thenearestpower oftwoabovethisvalueis217.Therefore,17 bitsarerequired.  6.

 7. 

What are the decimal equivalents of the following values (assume positional notation and unsigned integer formats):  a. 110011002 b. 110011003 c. 110011004 d. 11001100‐2   SOLUTION  a. 110011002 1×22+1×23+1×26+1×27=4+8+64+128=204 b. 110011003 1×32+1×33+1×36+1×37=2,952 c. 110011004 1×42+1×43+1×46+1×47=20,560 d. 11001100‐2 1×(‐2)2+1×(‐2)3+1×(‐2)6+1×(‐2)7=4–8+64–128=‐68 Whydowehaveoctalandhexadecimalarithmetic?

SOLUTION  Computers operate with base 2 arithmetic. However, it is difficult for people to handle binary numbers (for example 29810 is 1001010102) because binary numbers involve long strings of bits and we are not good at remembering long sequences. Hexadecimal arithmetic has 16 digits from 0 to F representing 4 binary bits. Therefore, a binary number can be easily represented in hexadecimal form by replacing each four bits by a hexadecimalcharacter.Forexample,29810is12A16(easierforpeopletorememberthan000100101010).  Octalarithmeticusesbase8withthedigits0to7.Eachoctaldigitreplacesthreebits.Ithasthesameadvantage ashexadecimalnumbers;forexamplethe binarynumber111101011is 753inoctal.However,octalarithmetic ishardlyusedtoday.      

17 © 2014 Cengage Learning. All Rights Reserved. May not be scanned, copied, or duplicated, or posted to a publicly available website, in whole or in part.

8.

Convertthefollowingdecimalnumbersinto(a)binaryand(b)hexadecimalforms  a. 25 b. 250 c. 2500 d. 25555

    

SOLUTION     

a. b. c. d.

25 250 2500 25555

11001 11111010 100111000100 110001111010011

19 FA 9C4 63D3

 Convertthefollowingunsignedbinarynumbersintodecimalform  a. 11 b. 1001 c. 10001 d. 10011001

9.     

SOLUTION       10.     

a. b. c. d.

11 1001 10001 10011001

3 9 17 153

Convertthefollowinghexadecimalnumbersintodecimalform  a. AB b. A0B c. 10A01 d. FFAAFF

SOLUTION       11.     

a. b. c. d.

AB A0B 10A01 FFAAFF

10101011 101000001011 10000101000000001 111111111010101011111111

171 2571 68097 16755455

Convertthefollowinghexadecimalnumbersintobinaryformat  a. AC b. DF0B c. 10B11 d. FDEAF1

SOLUTION     

a. b. c. d.

AC DF0B 10B11 FDEAF1

10101100 1101111100001011 10000101100010001 111111011110101011110001 18

© 2014 Cengage Learning. All Rights Reserved. May not be scanned, copied, or duplicated, or posted to a publicly available website, in whole or in part.

 12.     

Convertthefollowingfractionaldecimalnumbersinto16‐bitunsignedbinaryform.Useeightbitsofprecision.  a. 0.2 b. 0.046875 c. 0.1111 d. 0.1234

SOLUTION     

a. b. c. d.

13.

          

0.2 0.046875 0.1111 0.1234

0.0011001100110011 0.0000110000000000 0.0001110001110001 0.0001111110010111

0.00110011 0.00001100 0.00011100 0.00100000

 Performthefollowingcalculationsinthestatedbases  a. 001101112  +010110112 b. 

001111112 +010010012

c. 

0012012116 +0A01503116

d. 

00ABCD1F16 +0F00800F16

SOLUTION                 14. 

a.  

001101112 +010110112 100100102

b.  

001111112 +010010012 100010002

c.  

0012012116 +0A01503116 0A13515216

d.  

00ABCD1F16 +0F00800F16 0FAC4D2E16

Whatisarithmeticoverflow?Whendoesitoccurandhowcanitbedetected?

SOLUTION 

 Arithmetic overflow takes place when one or more two’s complement numbers take part in an arithmetic operation and the sign‐bit of the result is incorrect. For example, arithmetic overflow takes place when two positiveintegersareaddedandtheresult(wheninterpretedasatwo’scomplementvalue)isnegative,orwhen twonegativenumbersareaddedandthe resultispositive. In4‐bitarithmetic,thesignedtwo’scomplement 19 © 2014 Cengage Learning. All Rights Reserved. May not be scanned, copied, or duplicated, or posted to a publicly available website, in whole or in part.

values1100and 1000 areaddedtogive10100, wherethe most‐significantbit isacarry out. The sign ofthe result, 0100, is 0 indicating a positive value. Since the numbers we added were both negative, arithmetic overflowhasoccurred.   Intwo’scomplementaddition,arithmeticoverflowcanbedetectedbysaying,“Ifthesignbitsofthetwosource operandsarethesame,anddifferfromthesignbitoftheresultoperand,thenarithmeticoverflowoccurred.”  15.

Then‐bittwo’scomplementinteger N iswrittenan‐1,an‐2,. . . a1,a0. Provethat(intwo'scomplementnotation) therepresentationofasignedbinarynumberin n +1bits maybederivedfromitsrepresentationinnbits by repeatingtheleftmostbit.Forexample,ifn=‐12=10100infivebits,n=‐12=110100insixbits.



SOLUTION  In n bits the positive number N is represented by an‐1, an‐2, . . . a 1, a0. We can extend this to n+1 bits by appendinga0totheleftwithoutchangingitsvalue;thatis0,an‐1,an‐2,...a1,a0.   Nowconsiderthevalue‐Ninnbits.Thisisrepresentedas2n‐N.Ifweextendthiston+1bits,itbecomes2n+1‐ Nor2n+2n‐N.Thisis,ofcourse,theoriginalnegativerepresentationwithaleading1totheleft.Consequently, apositivenumberisextendedbyappendinga0,andanegativenumberbyaddinga1;thatis,byextendingthe signbit.  16.

Convert1234.125into32‐bitIEEEfloating‐pointformat.  SOLUTION  1234=100110100102 0.125=0.0012 Therefore,1234.125=10011010010.0012 

Thisis1.0011010010001×210(normalizedbinary)  TheIEEEfloatingpointsignis0(positive)  Thefractionalmantissain23bits(withsuppressedleading1)is00110100100010000000000  Thebiasedexponentis10+127=137or100010012  Thefloatingpointnumberis01000100100110100100010000000000or449A420016  17.

Whatisthedecimalequivalentofthe32‐bitIEEEfloating‐pointvalueCC4C0000?  SOLUTION  ThebinaryequivalentofCC4C0000is11001100010011000000000000000000  Thiscanbesplitintosign,biasedexponent,andfractionalmantissa.Thatis  S=1,E=10011000,F=10011000000000000000000  The sign is negative, and the exponent is 100110002 ‐ 127 = 110012 = 25 (remember the stored exponent is biasedby127,whichhastobesubtracted)  Themantissa,aftertheinsertionoftheleading1,is1.10011000000000000000000  Combiningmantissaandexponentweget 1.10011000000000000000000×225=11001100000000000000000000.0=53,477,37610

 20 © 2014 Cengage Learning. All Rights Reserved. May not be scanned, copied, or duplicated, or posted to a publicly available website, in whole or in part.

18.

What is the difference between overflow in the context of two’s complement numbers and overflow in the contextoffloating‐pointnumbers?



SOLUTION  In two’s complement arithmetic, arithmetic overflow occurs when a result goes out of range (that is, more positive than 2n‐1‐1 or more negative than ‐2n‐1. When arithmetic overflow occurs, the sign of the computed resultisdifferenttothecorrectresult.  Infloating‐pointarithmetic, overflowoccurs whentheexponentofafloating‐pointnumber becomes toolarge toberepresentedintheformat inuse.The numberisnowtoobig tobestoredand, usually, an exception is generated.  19.

 20.   

Inthenegabinarysystemani‐bitbinaryinteger,N,isexpressedusingpositionalnotationas:  N=a0×(‐1)0×20+a1×(‐1)1×21+…+ai‐1×(‐1)i‐1×2i‐1  Thisisthesameasconventionalnatural8421 binaryweightednumbers, exceptthat alternatepositionshave theadditionalweighting+1and‐1.Forexample,1101=(‐1×1×8)+(+1×1×4)+(‐1×0×2)+(+1×1×1)=‐8 +4 +1 =‐3.Thefollowing4‐bitnumbersarerepresentedinnegabinaryform. Convertthemintotheirdecimal equivalents.  a. 0000 b. 0101 c. 1010 d. 1111  SOLUTION  a. 0 b. +4++1=5 c. ‐8+‐2=‐10 d. ‐8++4+‐2+1=‐5 Performthefollowingadditionson4‐bitnegabinarynumbers.Theresultisa6‐bitnegabinaryvalue.  a. 0000 b. 1010 c. 1101 d.  1111 +0001  +0101  +1011  +1111

SOLUTION     

 a.

0000 +0001 000001 

b. 1010  +0101  001111

c. 1101  1011  110100

d. 1111  1111  001010

21 © 2014 Cengage Learning. All Rights Reserved. May not be scanned, copied, or duplicated, or posted to a publicly available website, in whole or in part.

21.

Arithmetic overflow occurs during a two's complement addition if the result of adding two positive numbers yieldsanegativeresult,orifaddingtwonegativenumbersyieldsapositiveresult.IfthesignbitsofAandBare thesamebutthesignbitoftheresultisdifferent,arithmeticoverflowhasoccurred.Ifan‐1isthesignbitofA,bn‐ 1isthesignbitofB,andsn‐1isthesignbitofthesumofAandB,thenoverflowisdefinedby  V=an‐1⋅bn‐1⋅sn‐1+an‐1⋅bn‐1⋅sn‐1

 Inpractice,realsystemsdetectoverflowfromCin≠Couttothelaststage.Thatis,wedetectoverflowfrom  V=cn⋅cn‐1+cn⋅cn‐1.  Demonstratethatthisexpressioniscorrect. 

SOLUTION  Thediagramillustratesthemost‐significantstage ofaparalleladderthataddstogetherbitsan‐1,bn‐1,andcn‐1 togenerateasumbit,sn‐1,andacarry‐out,cn.There arefourpossiblecombinationsof A and B whichcanbe addedtogether:    +A++B +A+‐B ‐A++B ‐A+‐B      Becauseaddingtwonumbersofdifferingsigncannot resultin arithmeticoverflow,weneedconsideronlythe caseswhereAandBarebothpositive,andwhereAandBarebothnegative.  Case1:AandBarepositive;thatis,an‐1=0,bn‐1=0  Thefinalstageadds an‐1+bn‐1 +cn‐1togetcn.Because an‐1andbn‐1areboth0(bydefinitionifthenumbersare positive),thecarry‐out,cn,is0,andsn‐1=cn‐1.  Weknowthatoverflowoccursifsn‐1=1(i.e.,thesignbitofthesumisnegative),thereforeoverflowoccursifcn⋅ Cn‐1=1.  Case2:AandBarenegative;thatis,an‐1=1,bn‐1=1.  Thefinalstageaddsan‐1+bn‐1+cn‐1=1+1+cn‐1,togetasum,Sn‐1=cn‐1,andacarry‐outcn=1.  Overflowoccursifsn‐1=0.Consequently,overflowoccurswhencn‐1=0andcn⋅cn‐1=1. Consideringbothcases,overflowoccursifcn⋅cn‐1+cn⋅cn‐1=1.        22 © 2014 Cengage Learning. All Rights Reserved. May not be scanned, copied, or duplicated, or posted to a publicly available website, in whole or in part.

22. 

Whatisthedifferencebetweenatruncationerrorandaroundingerror?

SOLUTION  Atruncationerroroccurswhenanumberisroundedbychoppingoffbits; forexample,0.1110111istruncated tofivebitsas0.11101bychoppingoffthelasttwo bits(11).Roundingis similar totruncationinthesensethat bitsareremoved.Whenanumberistruncated,the bitsremoved areexamined. If they are less than halfthe value of the least‐significant bit, then the bits are just dropped. If they are equal to or greater than half the least‐significantdigit,theleastsignificantdigitisroundedup.  Forexample0.1110111wouldberoundedupto0.11101+1=0.11110,whereas0.1110001wouldberounded down to 0.11100. Truncation leads to a systematic or biased error (the rounding is always down). Rounding leads to an unbiased error (the error is sometimes positive and sometimes negative). However, rounding is moredifficulttoperformasitrequiresanextraaddition.  23.

Positive and negative numbers can be represented in many ways in a computer. List some of the ways of representingsignednumbers.Canyouthinkofanyotherwaysofrepresentingsignedvalues?  SOLUTION  Therearefourcommonwaysofrepresentingsignednumbersincomputing:  a. One’scomplement;thenumber begins with 0 forpositive values and1 for negativevalues. If thenumber has n bits, n‐1 bits are used for the number and one for its polarity (i.e., sign). A negative number is obtained from a positive number by inverting bits; for example, if 12 in six bits is 001100 then ‐12 is 110011. One’s complement is little used today. It has thedisadvantagethat therearetwo valuesforzero: 000…0is+0and111…1is‐0.  b. Two’scomplement:like1’scomplement,themost‐significantbitisasignbit.Atwo’scomplementnumber isformedbyinvertingthe bitsand thenadding 1 (i.e.,one’s and two’s complement negativevaluesdiffer by1).If12is001100,‐12is110011+1=110100.Atwo’scomplementnumberhasasinglevalueforzero, 000...0,andisatruecomplementbecause × +‐x=0(e.g.,12+‐12=001100 +110100 =1000000).The addition of...


Similar Free PDFs