欢迎来到天天文库
浏览记录
ID:51496657
大小:558.00 KB
页数:44页
时间:2020-03-25
《计算机组成原理与体系结构_09_Arithmetic.ppt》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、WilliamStallingsComputerOrganizationandArchitecture7thEditionChapter9ComputerArithmetic1Arithmetic&LogicUnitDoesthecalculationsEverythingelseinthecomputeristheretoservicethisunitHandlesintegersMayhandlefloatingpoint(real)numbersMaybeseparateFPU(maths
2、co-processor)MaybeonchipseparateFPU(486DX+)ALUInputsandOutputsIntegerRepresentationOnlyhave0&1torepresenteverythingPositivenumbersstoredinbinarye.g.41=00101001NominussignNoperiodSign-MagnitudeTwo’scomplimentSign-MagnitudeLeftmostbitissignbit0meanspositi
3、ve1meansnegative+18=00010010-18=10010010ProblemsNeedtoconsiderbothsignandmagnitudeinarithmeticTworepresentationsofzero(+0and-0)Two’sCompliment+3=00000011+2=00000010+1=00000001+0=00000000-1=11111111-2=11111110-3=11111101BenefitsOnerepresentationofzeroAri
4、thmeticworkseasily(seelater)Negatingisfairlyeasy3=00000011Booleancomplementgives11111100Add1toLSB11111101GeometricDepictionofTwosComplementIntegersNegationSpecialCase10=00000000Bitwisenot11111111Add1toLSB+1Result100000000Overflowisignored,so:-0=0Negati
5、onSpecialCase2-128=10000000bitwisenot01111111Add1toLSB+1Result10000000So:-(-128)=-128XMonitorMSB(signbit)ItshouldchangeduringnegationRangeofNumbers8bit2scompliment+127=01111111=27-1-128=10000000=-2716bit2scompliment+32767=01111111111111111=215-1-32768=1
6、0000000000000000=-215ConversionBetweenLengthsPositivenumberpackwithleadingzeros+18=00010010+18=0000000000010010Negativenumberspackwithleadingones-18=10010010-18=1111111110010010i.e.packwithMSB(signbit)AdditionandSubtractionNormalbinaryadditionMonitorsig
7、nbitforoverflowTaketwoscomplimentofsubstahendandaddtominuendi.e.a-b=a+(-b)SoweonlyneedadditionandcomplementcircuitsHardwareforAdditionandSubtractionMultiplicationComplexWorkoutpartialproductforeachdigitTakecarewithplacevalue(column)AddpartialproductsMul
8、tiplicationExample1011Multiplicand(11dec)x1101Multiplier(13dec)1011Partialproducts0000Note:ifmultiplierbitis1copy1011multiplicand(placevalue)1011otherwisezero10001111Product(143dec)Note:needdoublelengthresultUnsignedBinaryMultipl
此文档下载收益归作者所有