资源描述:
《计算机专业英语教程ppt4》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、2.3.4MultibyteDataOrganizationInlittleendian,theorderisreversed.TheleastsignificantbyteisstoredinlocationX,thenextbyteinlocationX+1,andsoon.Thesamevalue,inlittleendianformat,isshowninTable2-1(b).依照低位优先格式,顺序正好相反。最低字节存储在单元X中,次字节存储在单元X+1中,依次类推。上例中的同一值,以低位优先格式存储,如表2-1
2、(b)所示。2.3.4MultibyteDataOrganizationThesameorganizationscanbeusedforbitswithinabyte.Inbigendianorganization,bit0istherightmostbitofabyte:theleftmostbitisbit7.Inlittleendianorganization,theleftmostbitisbit0andbit7istherightmostbit.同样的组织方式可用于一个字节中的不同位上。在高位优先结构中,位0代表
3、字节中最右边的位,最左边的位是第7位。在低位优先结构中,最左边的位是0,最右边的位是7。2.3.4MultibyteDataOrganizationWhichendianorganizationisusedforbytesandwordsdoesnotimpacttheperformanceoftheCPUandcomputersystem.AslongastheCPUisdesignedtohandleaspecificformat,neitherisbetterthantheother.Themainproblemco
4、mesintransferringdatabetweencomputerswithdifferentendianorganizations.Forexample,ifacomputerwithlittleendianorganizationtransfersthevalue01020304Htoacomputerwithbigendianorganizationwithoutconvertingthedata,thebigendiancomputerwillreadthevalueas04030201H.Therearep
5、rogramswhichcanconvertdatafilesfromoneformattotheother,andsomemicroprocessorshavespecialinstructionstoperformtheconversion.对于字节和字而言,无论使用哪一种排列组织方式都不会影响CPU和计算机系统的性能。只要设计CPU处理一种特定的格式,就不存在谁比谁强的问题,主要的问题在于具有不同排列组织方式的CPU之间传输数据的问题,例如,如果一个低位优先结构的计算机传输01020304H的数据给一个高位优先结构的
6、计算机,而没有转换数据,那么该高位优先结构计算机读出的值为04030201H。有程序可以将两种时局文件进行格式转换,并且某些处理器有特殊的指令可以执行这种转换。2.3.4MultibyteDataOrganizationOneotherissueofconcernformultibytewordsisalignment.Modernmicroprocessorscanreadinmorethanonebyteofdataatatime.Forexample,theMotorola68040microprocessorcan
7、readinfourbytessimultaneously.However,thefourbytesmustbeinconsecutivelocationsthathavethesameaddressexceptforthetwoleastsignificantbits.ThisCPUcouldreadlocations100,101,102,and103simultaneously,butnotlocations101,102,103,and104.Thiscasewouldrequiretworeadoperation
8、s,oneforlocations100(notneeded),101,102,and103,andtheotherfor104,105(notneeded),106(notneeded),and107(notneeded).多字节的另一个值得关注的问题是对齐问题。现代微处理器在某一时刻可以读出多个字节