附英文阅读材料.docx

上传人:b****6 文档编号:7395059 上传时间:2023-01-23 格式:DOCX 页数:41 大小:413.10KB
下载 相关 举报
附英文阅读材料.docx_第1页
第1页 / 共41页
附英文阅读材料.docx_第2页
第2页 / 共41页
附英文阅读材料.docx_第3页
第3页 / 共41页
附英文阅读材料.docx_第4页
第4页 / 共41页
附英文阅读材料.docx_第5页
第5页 / 共41页
点击查看更多>>
下载资源
资源描述

附英文阅读材料.docx

《附英文阅读材料.docx》由会员分享,可在线阅读,更多相关《附英文阅读材料.docx(41页珍藏版)》请在冰豆网上搜索。

附英文阅读材料.docx

附英文阅读材料

CHAPTERTWO

DataRepresentation

(选自M.MORRISMANO《COMPUTERSYSTEMARCHITECTURE》THIRDEDITION)

INTHISCHAPTER

2-1DataTypes

2-2Complements

2-3Fixed-PointRepresentation

2-4Floating-PointRepresentation

2-5OtherBinaryCodes

2-6ErrorDetectionCodes

2-1DataTypes

Binaryinformationindigitalcomputersisstoredinmemoryorprocessorregisters.Registerscontaineitherdataorcontrolinformation.Controlinformationisabitoragroupofbitsusedtospecifythesequenceofcommandsignalsneededformanipulationofthedatainotherregisters.Dataarenumbersandotherbinary-codedinformationthatareoperatedontoachieverequiredcomputationalresults.Inthischapterwepresentthemostcommontypesofdatafoundindigitalcomputersandshowhowthevariousdatatypesarerepresentedinbinary-codedformincomputerregisters.

Thedatatypesfoundintheregistersofdigitalcomputersmaybeclassifiedasbeingoneofthefollowingcategories:

(1)numbersusedinarithmeticcomputations,

(2)lettersofthealphabetusedindataprocessing,and(3)otherdiscretesymbolsusedforspecificpurposed.Alltypesofdata,exceptbinarynumbers,arerepresentedincomputerregistersinbinary-codedform.Thisisbecauseregistersaremadeupofflip-flopsandflip-flopsaretwo-statedevicesthatcanstoreonly1’sand0’s.Thebinarynumbersystemisthemostnaturalsystemtouseinadigitalcomputer.Butsometimesitisconvenienttoemploydifferentnumbersystems,especiallythedecimalnumbersystem,sinceitisusedbypeopletoperformarithmeticcomputations.

NumberSystems

Anumbersystemofbase,orradix,risasystemthatusesdistinctsymbolsforrdigits.Numbersarerepresenteedbyastringofdigitsymbols.Todeterminethequantitythatthenumberrepresents,itisnecessarytomultiplyeachdigitbyanintegerpowerofrandthenformthesumofallweighteddigits.Forexample,thedecimalnumbersystemineverydayuseemploystheradix10system.The10symbolsare0,1,2,3,4,5,6,7,8,and9.Thestringofdigits724.5isinterpretedtorepresentthequantity.

7102+2101+4100+510-1

thatis,7hundreds,plus2tens,plus4units,plus5tenths.Everydecimalnumbercanbesimilarlyinterpretedtofindthequantityitrepresents.

Thebinarynumbersystemusestheradix2.Thetwodigitsymbolsusedare0and1.Thestringofdigits101101isinterpretedtorepresentthequantity

125+024+123+122+021+120=45

Todistinguishbetweendifferentradixnumbers,thedigitswillbeenclosedinparenthesesandtheradixofthenumberinsertedasasubscript.Forexample,toshowtheequalitybetweendecimalandbinaryforty-fivewewillwrite(101101)2=(45)10

Besidesthedecimalandbinarynumbersystems,theoctal(radix8)andhexadecimal(radix16)areimportantindigitalcomputerwork.Theeightsymbolsoftheoctalsystemare0,1,2,3,4,5,6,and7.The16symbolsofthehexadecimalsystemare0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,andF.Thelastsixsymbolsare,unfortunately,identicaltothelettersofthealphabetandcancauseconfusionattimes.However,thisistheconventionthathasbeenadopted.Whenusedtorepresenthexadecimaldigits,thesymbolsA,B,C,D,E,Fcorrespondtothedecimalnumbers10,11,12,13,14,15,respectively.

Anumberinradixrcanbeconvertedtothefamiliardecimalsystembyformingthesumoftheweighteddigits.Forexample,octal736.4isconvertedtodecimalasfollows:

(736.4)8=782+381+680+48-1

=764+38+61+4/8=(478.5)10

TheequivalentdecimalnumberofhexadecimalF3isobtainedfromthefollowingcalculation:

(F3)16=F16+3=1516+3=(243)10

Conversionfromdecimaltoitsequivalentrepresentationintheradixrsystemiscarriedoutbyseparatingthenumberintoitsintegerandfractionpartsandconvertingeachpartseparately.Theconversionofadecimalintegerintoabaserrepresentationisdonebysuccessivedivisionsbyrandaccumulationoftheremainders.Theconversionofadecimalfractiontoradixrrepresentationisaccomplishedbysuccessivemultiplicationsbyrandaccumulationoftheintegerdigitssoobtained.Figure2-1demonstratestheseprocedures.

Theconversionofdecimal41.6875intobinaryisdonebyfirstseparatingthenumberintoitsintegerpart41andfractionpart.6875.Theintegerpartisconvertedbydividing41byr=2togiveanintegerquotientof20andaremainderof1.Thequotientisagaindividedby2togiveanewquotientandremainder.Thisprocessisrepeateduntiltheintegerquotientbecomes0.Thecoefficientsofthebinarynumberareobtainedfromtheremainderswiththefirstremaindergivingthelow-orderbitoftheconvertedbinarynumber.

Thefractionpartisconvertedbymultiplyingitbyr=2togiveanintegerandafraction.Thenewfraction(withouttheinteger)ismultipliedagainby2togiveanewintegerandanewfraction.Thisprocessisrepeateduntilthefractionpartbecomeszerooruntilthenumberofdigitsobtainedgivestherequiredaccuracy.Thecoefficientsofthebinaryfractionareobtainedfromtheintegerdigitswiththefirstintegercomputedbeingthedigittobeplacednexttothebinarypoint.Finally,thetwopartsarecombinedtogivethetotalrequiredconversion.

OctalandHexadecimalNumbers

Theconversionfromandtobinary,octal,andhexadecimalrepresentationplaysandimportantpartindigitalcomputers.Since23=8and24=16,eachoctaldigitcorrespondstothreebinarydigitsandeachhexadecimaldigitcorrespondstofourbinarydigits.Theconversionfrombinarytooctaliseasilyaccomplishedbypartitioningthebinarynumberintogroupsofthreebitseach.Thecorrespondingoctaldigitisthenassignedtoeachgroupofbitsandthestringofdigitssoobtainedgivestheoctalequivalentofthebinarynumber.Consider,forexample,a16-bitregister.Physically,onemaythinkoftheregisterascomposedof16binarystoragecells,witheachcellcapableofholdingeithera1ora0.Supposethatthebitconfigurationstoredintheregisterisasshowninfig.2-2.Sinceabinarynumberconsistsofastringof1’sand0’s,the16-bitregistercanbeusedtostoreanybinarynumberfrom0to216-1.Fortheparticularexampleshown,thebinarynumberstoredintheregisteristheequivalentofdecimal44899.Startingfromthelow-orderbit,wepartitiontheregisterintogroupsofthreebitseach(thesixteenthbitremainsinagroupbyitself).Eachgroupofthreebitsisassigneditsoctalequivalentandplacedontopoftheregister.Thestringofoctaldigitssoobtainedrepresentstheoctalequivalentofthebinarynumber.

Conversionfrombinarytohexadecimalissimilarexceptthatthebitsaredividedintogroupsoffour.ThecorrespondinghexadecimaldigitforeachgroupoffourbitsiswrittenasshownbelowtheregisterofFig.2-2.Thestringofhexadecimaldigitssoobtainedrepresentsthehexadecimalequivalentofthebinarynumber.Thecorrespondingoctaldigitforeachgroupofthreebitsiseasilyrememberedafterstudyingthefirsteightentrieslistedintable2-1.Thecorrespondencebetweenahexadecimaldigitanditsequivalent4-bitcodecanbefoundinthefirst16entriesofTable2-2.

Table2-1listsafewoctalnumbersandtheirrepresentationinregistersinbinary-codedform.Thebinarycodeisobtainedbytheprocedureexplainedabove.Eachoctaldigitisassigneda3-bitcodeasspecifiedbytheentriesofthefirsteightdigitsinthetable.Similarly,Table2-2listsafewhexadecimalnumbersandtheirrepresentationinregistersinbinary-codedform.Herethebinarycodeisobtainedbyassigningtoeachhexadecimaldigitthe4-bitcodelistedinthefirst16entriesofthetable.

Comparingthebinary-codedoctalandhexadecimalnumberswiththeirbinarynumberequivalentwefindthatthebitcombinationinallthreerepresentationsisexactlythesame.Forexample,decimal99,whenconvertedtobinary,becomes1100011.Thebinary-codedoctalequivalentofdecimal99is001100011andthebinary-codedhexadecimalofdecimal99is01100011.Ifweneglecttheleadingzerosinthesethreebinaryrepresentations,wefindthattheirbitcombinationisidentical.Thisshouldbesobecauseofthestraightforwardconversionthatexistsbetweenbinarynumbersandoctalorhexadecimal.Thepointofallthisisthatastringof1’sand0’sstoredinaregistercouldrepresentabinarynumber,butthissamestringofbitsmaybeinterpretedasholdinganoctalnumberinbinary-codedform(ifwedividethebitsingroupsofthree)orasholdingahexadecimalnumberinbinary-codedform(ifwedividethebitsingroupsoffour).

Theregistersinadigitalcomputercontainmanybits.Specifyingthecontentofregistersbytheirbinaryvalueswillrequirealongstringofbinarydigits.Itismoreconvenienttospecifycontentofregistersbytheiroctalorhexadecimalequivalent.Thenumberofdigitsisreducedbyone-thirdintheoctaldesignationandbyone-fourthinthehexadecimaldesignation.Forexample,thebinarynumber111111111111has12digits.Itcanbeexpressedinoctalsas7777(fourdigits)orinhexadecimalasFFF(threedigits).Computermanualsinvariablychooseeithertheoctalorthehexadecimaldesignationforspecifyingcontentsofregisters.

Decimalrepresentation

Thebinarynumbersystemisthemostnaturalsystemforacomputer,butpeopleareaccustomedtothedecimalsystem.Onewaytosolvethisconflictistoconvertallinputdecimalnumbersintobinarynumbers,letthecomputerperformallarithmeticoperationsinbinaryandthenconvertthebinaryresultsbacktodecimalforthehumanusertounderstand.However,itisalsopossibleforthecomputertoperformarithmeticoperationsdirectlywithdecimalnumbersprovidedtheyareplacedinregistersinacodedform

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 高等教育 > 理学

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1