¿Conversiones decimales-binarias-hexadecimales7 con puntos Radix?

0

Esperaba que alguien de aquí pudiera ayudar a explicar las conversiones de base de números con puntos Radix. Estoy cursando mi Licenciatura en Ciencias de la Computación con 12 cursos restantes, actualmente en un curso de Hardware de Computación.

Para una de mis tareas, tuve que completar la siguiente tabla (las áreas en gris son los valores que me dieron para convertir a cada uno de los demás):

Aquíhaymásdemitrabajoparalasotrasconversionesquenosemuestrandirectamenteenlatabla:

DecToBin(37)=(37/2=1)(18/2=0)(9/2=1)(4/2=0)(2/2=0)(1/2=1)===101001orinreverseorder100101DecToBin(99)=(99/2=1)(49/2=1)(24/2=0)(12/2=0)(6/2=0)(3/2=1)(1/2=1)===1100011orinreverseorder1100011DecToBin(256)=(598/2=0)(299/2=1)(149/2=1)(74/2=0)(37/2=1)(18/2=0)(9/2=1)(4/2=0)(2/2=0)(1/2=1)===0110101001orinreverseorder1001010110DecToBin(3243)=(3243/2=1)(1621/2=1)(810/2=0)(405/2=1)(202/2=0)(101/2=1)(50/2=0)(25/2=1)(12/2=0)(6/2=0)(3/2=1)(1/2=1)===110101010011orinreverseorder110010101011DecToB7(37)=(37/7)=5r2or52;DecToB7(99)=(99/7)=14r1,(14/7)=2r0;==201;DecToB7(170)=(170/7)=24r2;(24/7)=3r3;==332;DecToB7(1757)=(1757/7)=251r0;(251/7)=35r6;(35/7)=5r0;==5060;DecToB7(598)=(598/7)=95r3;(95/7)=13r4;(13/7)=1r6;DecToB7(3243)=(3243/7)=463r2;(463/7)=66r1;(66/7)=9r3;(9/7)=1r2;==12312;B7toDec(12)=(1*7^1)+(2*7^0)=(7)+(2)=9inDecimalB7toDec(666)=(6*7^2)+(6*7^1)+(6*7^0)=342inDecimalDecToBin(9)=(9/2=1)(4/2=0)(2/2=0)(1/2=1)===1001orinreverseorder1001DecToBin(342)=(342/2=0)(171/2=1)(85/2=1)(42/2=0)(21/2=1)(10/2=0)(5/2=1)(2/2=0)(1/2=1)===011010101orinreverseorder101010110

Ahoramehandadounasegundatablaparahacerlomismo,peroestaeslaquedeboincluirparacalculartodoslosvaloresencuatrolugaresdespuésdelpuntoradix.Milibroensínoesmuyclaro,solomerefieroalospuntosradixenuncapítulode2oraciones,yloqueheencontradoenlíneanomeha"pinchado".

¿Alguienpuedeintentarexplicarcómomeconvertiríaconlospuntosradixcomosedescribe?Noestoybuscandorespuestas,soloparaquealguienmeproporcionealgunosejemplosquemepermitancomprenderquésemepreguntaycómohacerlo.

Cualquierytodalaasistenciaapreciada!Estaclasehasidodifícilhastaahoraytodavíaestoyrecuperándomeenalgunasáreas:)

EDIT:

¿PuedealguienconfirmarsiestoyenelcaminocorrectoyendoaDecimal?

BinaryToDec(11011.0111)=2^4+2^3+0+2^1+2^0.+0+2^-2+2^-3+2^-4=30.4375BinaryToDec(111.0111)=2^2+2^1+2^0.+2^-1+0+2^-3+2^-4=7.6875HexToDec(2.08)=(2*16^0)+.(0)+(8*16^-2)=2.03125HexToDec(AB.C)=(10*16^1)+(11*16^0)+.(12*16^-1)=171.75Base7ToDec(1.2)=(1*7^0).+(2*7^-1)=1.285714286Base7ToDec(66.6)=(6*7^1)+(6*7^0)+.(6*7^-1)=48.85714286

EDIT2:

Haciendoalgunosprogresos:

DecToBin(0.25) = 2^-2 = 0.25 or 0.0100
DecToBin(0.35)= 
BinaryToDec(11011.0111) = (2^4)+(2^3)+(0)+(2^1)+(2^0) + (0)+(2^-2)+(2^-3)+(2^-4) = 27.4375
BinaryToDec(111.1011) = (2^2)+(2^1)+(2^0) + (2^-1)+(0)+(2^-3)+(2^-4) = 7.6875
HexToDec(2.08) = (2*16^0) + (0)+(8*16^-2) = 2.03125 or by specs 2.0313
HexToDec(AB.C) = (10*16^1)+(11*16^0) + (12*16^-1) = 171.75 or by specs 171.7500
Base7ToDec(1.2) = (1*7^0)+(2*7-1) = 1.285714286 or by specs 1.2857
Base7ToDec(66.6) = (6*7^1)+(6*7^0) + (6*7^-1) = 48.85714286 or by specs 48.8571
http://cs.furman.edu/digitaldomain/more/ch6/dec_frac_to_bin.htm 
DecToBinary(0.25) = 0.25*2 = 0.50 (0.0???); 0.50*2 = 1.00 (0.01??); 00*2 = 0, so answer is 0.0100
DecToBinary(0.35) = 0.35*2 = 0.70 (0.0???); 0.70*2 = 1.4 (0.01??); 0.4*2 = 0.80 (0.010?); 
                                     0.80*2 = 1.60 (0.0101????); 0.6*2 = 1.20 (0.01011???); 0.2*2 = 0.4 (0.010110??);
                                     0.4*2 = 0.8 (0.0101100?); 0.8*2 = 1.60 (0.01011001????); 
                                    0.60*2 = 1.20 (0.010110011???); 0.2*2 = 0.4 (0.0101100110??); 
                                    0.4*2 = 0.8 (0.01011001100?); 0.8*2 = 1.60 (0.010110011001?);
DecToBinary(2.0313) = 2.0313*2 = 4.0626 (1?.????); 0.626*2= 1.252 (10.????); 
                                          0.252*2 = 0.504; (10.0???); 0.504*2 = 1.008 (10.01??); 
                                          0.008*2 = 0.016 (10.010?); 0.016*2 = 0.032 (10.0100???); 
                                          0.032*2 = 0.064 (10.01000??); 0.064*2 = 0.128 (10.010000?); 
                                          0.128*2 = 0.256 (10.0100000???); 0.256*2 = 0.512 (10.01000000??); 
                                         0.512*2 = 1.024 (10.010000001???); or by specs 10.0100….

EDIT3 :

Más progreso. Aún tengo algunos problemas con las conversiones de Decimal- > Base7:

DecToBin(0.25)=2^-2=0.25or0.0100DecToBin(0.35)=BinaryToDec(11011.0111)=(2^4)+(2^3)+(0)+(2^1)+(2^0)+(0)+(2^-2)+(2^-3)+(2^-4)=27.4375BinaryToDec(111.1011)=(2^2)+(2^1)+(2^0)+(2^-1)+(0)+(2^-3)+(2^-4)=7.6875HexToDec(2.08)=(2*16^0)+(0)+(8*16^-2)=2.03125orbyspecs2.0313HexToDec(AB.C)=(10*16^1)+(11*16^0)+(12*16^-1)=171.75orbyspecs171.7500Base7ToDec(1.2)=(1*7^0)+(2*7-1)=1.285714286orbyspecs1.2857Base7ToDec(66.6)=(6*7^1)+(6*7^0)+(6*7^-1)=48.85714286orbyspecs48.8571http://cs.furman.edu/digitaldomain/more/ch6/dec_frac_to_bin.htmDecToBinary(0.25)=0.25*2=0.50(0.0???);0.50*2=1.00(0.01??);00*2=0,soansweris0.0100DecToBinary(0.35)=0.35*2=0.70(0.0???);0.70*2=1.4(0.01??);0.4*2=0.80(0.010?);0.80*2=1.60(0.0101????);0.6*2=1.20(0.01011???);0.2*2=0.4(0.010110??);0.4*2=0.8(0.0101100?);0.8*2=1.60(0.01011001????);0.60*2=1.20(0.010110011???);0.2*2=0.4(0.0101100110??);0.4*2=0.8(0.01011001100?);0.8*2=1.60(0.010110011001?);DecToBinary(2.0313)=2.0313*2=4.0626(1?.????);0.626*2=1.252(10.????);0.252*2=0.504;(10.0???);0.504*2=1.008(10.01??);0.008*2=0.016(10.010?);0.016*2=0.032(10.0100???);0.032*2=0.064(10.01000??);0.064*2=0.128(10.010000?);0.128*2=0.256(10.0100000???);0.256*2=0.512(10.01000000??);0.512*2=1.024(10.010000001???);orbyspecs10.0100….DecToBinary(171.7500)=(171)=128+0+32+0+8+0+2+1=10101011.0.7500*2=1.500(1.1???);0.500*2=1.000(1.11??)===10101011.1100;DecToBinary(1.2857)=1.2857*2=2.5714(1.????);0.5714*2=1.1428(1.1???);0.1428*2=0.2856(1.10??);0.2856*2=0.5712(1.100?);0.5712*2=1.1424(1.1001);0.1424*2=0.2848(1.10010???);0.2848*2=0.5696(1.100100??);0.5696*2=1.1392(1.1001001??);0.1392*2=0.2784(1.10010010…)orbyspecs1.1001…DecToBinary(48.8571)=(48)=00110000.0.8571*2=1.7142(0.1????);0.7142*2=1.4284(0.11???);0.4284*2=0.8568(0.110??);0.8568*2=1.7136(0.1101?);0.7136*2=1.4272(0.11011)===110000.11011orbyspecs110000.1101DecToHex(0.25)=0.???=0.25*16=4;(0.4??);DecToHex(0.35)=0.???=0.35*16=5.6(0.5??);0.6*16=9.6(0.59???);0.6*16=9.6(0.599???);===0.5999999999…..orbyspecs0.5999DecToHex(27.4375)=(27)=1B;0.4375*16=7;===1B.7DecToHex(7.6875)=(7)=7;0.6875*16=1.375(7.1??);0.375*16=6(7.16);===7.BDecToHex(1.2857)=(1)=1;0.2857*16=0.57141.4923A;DecToHex(48.8571)=48/16=3?.????;0/16=0(30.????);0.8571*16=13.7136(30.D???);0.7136*16=11.4176(30.DB???);0.4175*16=6.6816(30.DB6??);0.6816*16=10.9056(30.DB6A?);0.9056*16=14.4896(30.DB6AE?);0.4896*16=7.8336;DecToBase7(0.25)=0.???=0.25*7=1.75(0.1??);0.75*7=5.25(0.15??);0.25*7=1.75(0.151?);

EDIT4:

Claramente,estoyhaciendoalgomalconmisconversionesdeDecimalaBase7.Finalmenteencontréuna calculadora que acepta decimales fraccionarios, pero la única conversión que obtengo correctamente es la fila inferior donde está Ya se proporcionó el valor Base7:

¿Alguienpuededetectarloqueestoyhaciendomalenmimatemática?

DecToBase7(0.25)=(0*7^0)+(2*7^-1)+(5*7^-2)=(0)+(0.2857142857)+(0.1020408163)=0.387755102orbyspecs0.3877.DecToBase7(0.35)=(0*7^0)+(3*7^-1)+(5*7^-2)=(0)+(0.4285714286)+(0.1020408163)=0.5306122449orbyspecs0.5306.DecToBase7(27.4375)=(2*7^1)+(7*7^0)+(4*7^-1)+(3*7^-2)+(7*7^-3)+(5*7^-4)=21.65514369orbyspecs21.6551.DecToBase7(7.6875)=(7*7^0)+(6*7^-1)+(8*7^-2)+(7*7^-3)+(5*7^-4)=8.042898792orbyspecs8.0428

EDIT5:

¡GraciasatodoslosquemeayudaronacomprendermejorlasconversionesdeDecimal/Binary/Hex/Base7con/sinpuntosRadix!Tengolamesacompletamentellenaycreoqueestácerca,sinotodo,correcto.Loverificarémástarde,peroporahoraaquíestálatablaymiscálculosquesolíallegaralosvalores(consuerteayudaráaalguienmásenelcamino):

DecToBin(0.25) = 2^-2 = 0.25 or 0.0100
DecToBin(0.35)= 
BinaryToDec(11011.0111) = (2^4)+(2^3)+(0)+(2^1)+(2^0) + (0)+(2^-2)+(2^-3)+(2^-4) = 27.4375
BinaryToDec(111.1011) = (2^2)+(2^1)+(2^0) + (2^-1)+(0)+(2^-3)+(2^-4) = 7.6875
HexToDec(2.08) = (2*16^0) + (0)+(8*16^-2) = 2.03125 or by specs 2.0313
HexToDec(AB.C) = (10*16^1)+(11*16^0) + (12*16^-1) = 171.75 or by specs 171.7500
Base7ToDec(1.2) = (1*7^0)+(2*7-1) = 1.285714286 or by specs 1.2857
Base7ToDec(66.6) = (6*7^1)+(6*7^0) + (6*7^-1) = 48.85714286 or by specs 48.8571

enlace

DecToBinary(0.25) = 0.25*2 = 0.50 (0.0???); 0.50*2 = 1.00 (0.01??); 00*2 = 0, so answer is 0.0100
DecToBinary(0.35) = 0.35*2 = 0.70 (0.0???); 0.70*2 = 1.4 (0.01??); 0.4*2 = 0.80 (0.010?); 
                                     0.80*2 = 1.60 (0.0101????); 0.6*2 = 1.20 (0.01011???); 0.2*2 = 0.4 (0.010110??);
                                     0.4*2 = 0.8 (0.0101100?); 0.8*2 = 1.60 (0.01011001????); 
                                    0.60*2 = 1.20 (0.010110011???); 0.2*2 = 0.4 (0.0101100110??); 
                                    0.4*2 = 0.8 (0.01011001100?); 0.8*2 = 1.60 (0.010110011001?);
DecToBinary(2.0313) = 2.0313*2 = 4.0626 (1?.????); 0.626*2= 1.252 (10.????); 
                                          0.252*2 = 0.504; (10.0???); 0.504*2 = 1.008 (10.01??); 
                                          0.008*2 = 0.016 (10.010?); 0.016*2 = 0.032 (10.0100???); 
                                          0.032*2 = 0.064 (10.01000??); 0.064*2 = 0.128 (10.010000?); 
                                          0.128*2 = 0.256 (10.0100000???); 0.256*2 = 0.512 (10.01000000??); 
                                         0.512*2 = 1.024 (10.010000001???); or by specs 10.0100….
DecToBinary(171.7500) = (171) = 128+0+32+0+8+0+2+1 = 10101011.   0.7500*2 = 1.500 (1.1???); 
                                         0.500*2 = 1.000 (1.11??) === 10101011.1100;
DecToBinary(1.2857) = 1.2857*2 = 2.5714 (1.????); 0.5714*2 = 1.1428 (1.1???); 0.1428*2 = 0.2856 (1.10??); 0.2856*2 = 0.5712 (1.100?); 0.5712*2 = 1.1424 (1.1001); 0.1424*2 = 0.2848 (1.10010???); 0.2848*2 = 0.5696 (1.100100??); 0.5696*2 = 1.1392 (1.1001001??); 0.1392*2 = 0.2784 (1.10010010…) or by specs 1.1001…
DecToBinary(48.8571) = (48) = 00110000. 0.8571*2 = 1.7142 (0.1????); 0.7142*2 = 1.4284 (0.11???); 0.4284*2 = 0.8568 (0.110??); 0.8568*2 = 1.7136 (0.1101?); 0.7136*2 = 1.4272 (0.11011) ===
110000.11011 or by specs 110000.1101

enlace

DecToHex(0.25) = 0.??? = 0.25*16 = 4; (0.4??); 
DecToHex(0.35) = 0.??? = 0.35*16 = 5.6 (0.5??); 0.6*16 = 9.6 (0.59???); 0.6*16 = 9.6 (0.599???); === 0.5999999999….. or by specs 0.5999
DecToHex(27.4375) = (27) = 1B; 0.4375*16 = 7; === 1B.7
DecToHex(7.6875) = (7) = 7; 0.6875*16 = 1.375 (7.1??); 0.375*16 = 6 (7.16); === 7.B
DecToHex(1.2857) = (1) = 1; 0.2857*16 = 0.5714 1.492
3A;
DecToHex(48.8571) =48/16 = 3?.????; 0/16 = 0 (30.????);  0.8571*16 = 13.7136 (30.D???); 0.7136*16 = 11.4176 (30.DB???); 0.4175*16 = 6.6816 (30.DB6??); 0.6816*16 = 10.9056 (30.DB6A?); 0.9056*16 = 14.4896 (30.DB6AE?); 0.4896*16 = 7.8336;

Para verificar los resultados de Base7: enlace

DecToBase7(0.25) = 0.???? = 0.25*7 = 1.75 (0.1???); 0.75*7 = 5.25 (0.15??); 0.25*7 = 1.75 (0.151?); 0.75*7 = 5.25 (0.1515…);
DecToBase7(0.35) = 0.???? = 0.35*7 = 2.45 (0.2???); 0.45*7 = 3.15 (0.23??); 0.15*7 = 1.05 (0.231?); 0.05*7 = 0.35 (0.2310);
DecToBase7(27.4375) = 36.???? = 0.4375*7 = 3.0625 (36.3???); 0.0625*7 = 0.4375 (36.30??); 0.4375*7 = 3.0625 (36.303?); 0.0625*7 = 0.4375 (36.3030);
DecToBase7(7.6875) = 10.???? = 0.6875*7 = 4.8125 (10.4???); 0.8125*7 = 5.6875 (10.45??); 0.6875*7 = 4.8125 (10.454?); 0.8125*7 = 5.6875 (10.4545);
DecToBase7(2.0313) = 2.???? = 0.0313*7 = 0.2191 (2.0???); 0.2191*7 = 1.5337 (2.01??); 0.5337*7 = 3.7359 (2.013?); 0.7359*7 = 5.1513 (2.0135);
DecToBase7(171.7500) = 333.???? = 0.7500*7 = 5.25 (333.5???); 0.25*7 = 1.75 (333.51??); 0.7500*7 = 5.25 (333.515?); 0.25*7 = 1.75 (333.5151);
DecToBase7(1.2857) = 1.???? = 0.2857*7 = 1.9999 (1.1???); 0.9999*7 = 6.9993 (1.16??); 0.9993*7 = 6.9951 (1.166?); 0.9951*7 = 6.9657 (1.1666);
    
pregunta Analytic Lunatic

3 respuestas

1

Creo que lo vi:

  

DecToBase7 (0.25) = (0 * 7 ^ 0) + (2 * 7 ^ -1) + (5 * 7 ^ -2) = (0) + (0.2857142857) +   (0.1020408163) = 0.387755102 o según las especificaciones 0.3877.

Sí, así es como convierto un 0.25_ (base 7) a un valor decimal de base diez.

Para convertir 8.8750_ (decimal) a un valor de base-7, debes ir al otro lado:

8.8750_(decimal)                            1
                                            1
                                            .
0.8750_(decimal) * 7 = 6.1250_(decimal) --> 6
0.1250_(decimal) * 7 = 0.8750_(decimal) --> 0
0.8750_(decimal) * 7 = 6.1250_(decimal) --> 6
0.1250_(decimal) * 7 = 0.8750_(decimal) --> 0
0.8750_(decimal) * 7 = 6.1250_(decimal) --> 6
0.1250_(decimal) * 7 = 0.8750_(decimal) --> 0
0.8750_(decimal) * 7 = 6.1250_(decimal) --> 6
...                               ...

Entonces 8.8750_ (decimal) es igual a 11.60606060606 ... (base 7).

Con unas pocas excepciones especiales, la conversión de una fracción en cualquier base a una fracción en cualquier otra base generalmente conduce a tales patrones de repetición. (Quizás el patrón de repetición inesperada más notorio ocurra al convertir 0.1_ (decimal) a binario. Un patrón de repetición similar ocurre cuando se convierte 0.1_ (base 3) a decimal).

    
respondido por el davidcary
1

Puedes convertir de decimal a otras bases con una conversión entera y un desplazamiento a la derecha.

4 lugares: * 2 ^ 4 = 16 en binario, * 2 ^ 16 = 65536 en hexadecimal

0.25 * 16 = 4 = b0100 - > Gire a la derecha en 4 dígitos - > 0.0100 binario

0.25 * 65536 = 16384 = h4000 - > Gire a la derecha en 4 dígitos - > 0.4000 hexadecimal

Por supuesto, la conversión entre binario y hexadecimal es trivial y se puede hacer directamente.

Para convertir a decimal, haz la suma ponderada de todos los dígitos:

bin 1010.1010 = 2 ^ 3 + 2 ^ 1 + 2 ^ -1 + 2 ^ -3

hex 1020.3040 = 16 ^ 3 + 2 * 16 ^ 1 + 3 * 16 ^ -1 + 4 * 16 ^ -3

... etc ...

Luego, puede pensar en redondear, ya que la conversión entre bases puede producir errores de redondeo. Por ejemplo, el número decimal 0.1 corresponde en binario a la secuencia infinita 0.00011001100110011 ...

    
respondido por el TEMLIB
1

Puedes lidiar con los números fraccionarios tratando los números a la derecha de Radix como poderes negativos.

Tomando como ejemplo binario usando notación 2.4 (es decir, número de 6 bits; 2 bits enteros; 4 bits fraccionarios:

2 ^ 1, 2 ^ 0 . 2 ^ (- 1), 2 ^ (- 2), 2 ^ (- 3), 2 ^ (- 4)

entonces: 3.5625 (d) = 2 + 1 + .5 + 0.0625 = 11.1001 (b)

etc ... para todas las otras bases, p. ej. 16 ^ 1,16 ^ 0. 16 ^ (- 1), 16 ^ (- 2) etc ...

Tomando 7 como base (es decir): 7 ^ 1, 7 ^ 0 . 7 ^ (- 1), 7 ^ (- 2) .....

entonces: 16 + 1/7 (d) = 22.1 es decir, 2 * 7 ^ 1 + 2 * 7 ^ 0 + 1 * 7 ^ (- 1)

    
respondido por el akellyirl

Lea otras preguntas en las etiquetas