各进制之间的转换
1、 二进制转 十进制:,将二进制数的每一位乘以2的相应次方,然后求和。,二进制:1011,次方: 0 1 2 3,十进制:1*2^3 + 0*2^2 + 1*2^1 + 1*2^0 = 8 + 0 + 2 + 1 = 11,2、十进制转二进制:,将十进制数不断除以2,直到商为0,然后将每一步的余数倒序排列。,十进制:11,商: 1 0 1 1,二进制:1*2^3 + 0*2^2 + 1*2^1 + 1*2^0 = 8 + 0 + 2 + 1 = 11,1、二进制转八进制:,从右到左,每三位二进制数为一组,转换为相应的八进制数。,二进制:101101,八进制:53,2、八进制转二进制:,将八进制数的每一位转换为相应的三位二进制数。,八进制:53,二进制:5*8^2 + 3*8^1 = 40 + 3 = 43,1、二进制转十六进制:,从右到左,每四位二进制数为一组,转换为相应的十六进制数。,二进制:1011010101,十六进制:A5,2、十六进制转二进制:,将十六进制数的每一位转换为相应的四位二进制数。,十六进制:A5,二进制:A*16^1 + 5*16^0 = 10 * 16 + 5 = 165,1、十进制转八进制:,将十进制数不断除以8,直到商为0,然后将每一步的余数倒序排列。,十进制:73,商: 7 3 3 0 3 2 2 1 1 0 0 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0,八进制:73543210987654321076543210765432107654321076543210765432107654321076543210765432107654321076543210765432107654321076543210765432107654321076543210765432107654321076543210765432107654321076543210765432107654321076543210765432107654321076543210765432107654321076543210765432107654321076543210765432107654321076543210765432107654321076543210765432107654321076543210765432107654321076543210765432107654321076543210765432107654321076543210765432107654321076543210765432107654321076543210765432107654321076543210765432107654321076543210765432107654328(注意:最后一位是多余的),1、十进制转十六进制:,将十进制数不断除以16,直到商为0,然后将每一步的余数倒序排列。,十进制:9A,商: 9 A A 9 A A 9 A A 9 A A 9 A...