《大学计算机基础大学计算机基础 (15).ppt》由会员分享,可在线阅读,更多相关《大学计算机基础大学计算机基础 (15).ppt(11页珍藏版)》请在得力文库 - 分享文档赚钱的网站上搜索。
1、 Number conversion 1 NumberThesystemofnumbersisamethodofrepresentingnumericalvaluesbyasetoffixednumbersandasetofuniformrules.Forexample,decimaldataisrepresentedby10digits(0,1,2,3,4,5,6,7,8,9)andoperatesaccordingtotheeverydecimalonerule.Inthesameway,binarynumbersuse2digits(0,1)torepresentdata,andtheo
2、perationruleiseverybinaryone.(N)R=an-1 Rn-1+an-2 Rn-2+a2 R2+a1 R1+a0 R0+a-1 R-1+a m-R m-234.12=2102+3101+4100+110-1+210-2TitleBaseRightsExpansion Number Digital Base Title Suff suffixes Decimal0,1,2,3,4,5,6,7,8,91010 i D Binary binary0,122 i B Octal0,1,2,3,4,5,6,788 iQ Hexadecimal 0,1,2,3,4,5,6,7,8,
3、9 A,B,C,D,E,F,1616 i H Number conversionNumber conversion Converts the binary number 1011.01 B to a decimal number.Rightsexpansionmethodightsexpansionmethod 1011.01 B=123+022+121+120+02-1+12-2=8+0+2+1+0 0.25=11.25 DConvert non decimal to decimalConvertstheoctalnumber246Qtoadecimalnumber.Convertstheo
4、ctalnumber246Qtoadecimalnumber.Rightsexpansionmethodightsexpansionmethod 246Q=282+481+680=128+32+6=166 DRightsexpansionmethodightsexpansionmethodConvert non decimal to decimal Convertsahexadecimalnumber1A5.7Htoadecimalnumber.Convertsahexadecimalnumber1A5.7Htoadecimalnumber.1A5.7H=11 62+10161+5160+71
5、6-1=256+160+5+0.4375=421.4375Convert non decimal to decimalExample2.4Convertsthedecimalnumber26.25Dtobinary.2613632222102 Excess 1 0 1 1 Write the remainder in reverse order:1 1 0 1 01Decimalnumberstonon-decimalnumbersecimalnumberstonon-decimalnumbersExample2.4Convertsthedecimalnumber26.25Dtobinary.Decimalnumberstonon-decimalnumbersecimalnumberstonon-decimalnumbers0.252 Number 0 0.52 Integer 1 1.001Writetheorderofintegers Available:26.25 D=11010.01 B.