《(2.2)--2.2Conversionbetweennumeralsyste.pdf》由会员分享,可在线阅读,更多相关《(2.2)--2.2Conversionbetweennumeralsyste.pdf(7页珍藏版)》请在得力文库 - 分享文档赚钱的网站上搜索。
1、Conversion between numeral systemsConversion between numeral systems2.2Conversion of numbers between different numeral systemsThe method of converting non-decimal numbers to decimal numbers is:Calculate the sum of the weight expansion of the non-decimal number.1.Convert non-decimal numbers to decima
2、l numbersEg1Convert binary number(1101.1)2 to decimalSolution:(1101.1)2=123+122+021+120+12-1=8+4+0+1+0.5=13.5Conversion between numeral systems2.2Solution:(346)8=382+481+680=192+32+6=230Solution:(2A6.8)16=2162+10161+6160+816-1=512+160+6+0.5=678.5Eg2Convert octal number(346)8 to decimalEg3Convert hex
3、adecimal number(2A6.8)16 to decimalConversion between numeral systems2.2202222210余0 5余0 2余1 1余00余1取余:1 0 1 0 0 The method of converting a decimal number to a non-decimal number is:For integral part,divide by the number base and keep the remainder;for the fraction part,multiply by the number base and
4、 keep the integral.2.Convert decimal numbers to non-decimal numbersSolution:Divide by the number base 2 and keep the remainder We get the result:20=10100BEg4Convert the decimal number 20 to binaryremain 0remain 0remain 0remain 1remain 1keep the remaindersConversion between numeral systems2.2Eg5Conve
5、rt the decimal number 20.25 to binarySolution:Firstly,convert the integral part 20 to binary number 10100B withsteps described above;and multiply the fractional part 0.25 by the base 2continuously until the fractional part equals 0.Then,arrange the integralpart of the number obtained by each multipl
6、ication in a order from left toright:0.25整数20.50 201.00 1取整:0 1 Finally,we get the result:20.25=10100.01Bintegerkeep the integralConversion between numeral systems2.2The method of converting octal numbers to binary is:Directly write out 3-bit binary numbers for each octal digits.The method of conver
7、ting binary numbers to octal is:Using the decimal point as a boundary,group each three digit binarynumbers and make up with 0 if theres less than three digits.Then,convert each set of binary numbers directly into thecorresponding 1-digit octal number.3.Conversion between non-decimal numbersEg6Conver
8、t octal number(425.67)8 to binarySolution:(425.67)8=(100 010 101.110 111)2 Eg7Convert binary number(10101111.01101)2 to octalSolution:(10101111.01101)2=(010 101 111.011 010)2=(257.32)8Conversion between numeral systems2.2The method of converting hexadecimal numbers to binary is:Write out the corresp
9、onding 4-bitbinary number for each digits of the hexadecimal.The method of converting binary numbers to hexadecimal is:Using the decimal point as theboundary,group each four digit binary numbers and make up with 0 if theres less than fourdigits.Then,convert each set of binary numbers directly into the corresponding 1-digit hexadecimal.Eg8Convert hexadecimal number(2C8)16 to binarySolution:(2C8)16=(0010 1100 1000)2=(1011001000)2 Eg9Convert binary number(1011001.11)2 to hexadecimalSolution:(1011001.11)2=(0101 1001.1100)2=(59.C)16