- #1
njama
- 216
- 1
Hello PF members!
I am interested in proving that the conversion of binary to hex is valid.
Example: 1000100100110111
Breaking into 'quartets' 1000 1001 0011 0111
Now using the fact that 24 = 0...15
1000 = 8, 1001 = 9, 0011 = 3, 0111 = 7. So
10001001001101112=893716
I can create the table starting from 0000 to 1111. I need to prove that this conversion really works.
I would start the proof by stating that the number in binary form is:
[tex]b_1b_2...b_{n-1}b_n[/tex]
If n mod 4 == 0 (if the remainder of the division of n with 4 is zero) then:
[tex]b_1b_2b_3b_4 ... ... ... b_{n-3}b_{n-2}b_{n-1}b_n[/tex]
But how to prove afterward?
else we can add m zeroes so that (m+n) mod 4 ==0.
By adding zeroes before the binary number I can easily prove that nothing is changed.
[tex](*)=b_1b_2...b_{n-1}b_n=b_n*2^0 + b_{n-1}*2^1+...+b_2*2^{n-2}+b_1*2^{n-1}[/tex]
[tex]00..00b_1b_2...b_{n-1}b_n=b_n*2^0 + b_{n-1}*2^1+...+b_2*2^{n-2}+b_1*2^{n-1}+0*2^n+0*2^{n+1}...+0*2^{n+m}=(*)[/tex]
Any help would be appreciated.
I am interested in proving that the conversion of binary to hex is valid.
Example: 1000100100110111
Breaking into 'quartets' 1000 1001 0011 0111
Now using the fact that 24 = 0...15
1000 = 8, 1001 = 9, 0011 = 3, 0111 = 7. So
10001001001101112=893716
I can create the table starting from 0000 to 1111. I need to prove that this conversion really works.
I would start the proof by stating that the number in binary form is:
[tex]b_1b_2...b_{n-1}b_n[/tex]
If n mod 4 == 0 (if the remainder of the division of n with 4 is zero) then:
[tex]b_1b_2b_3b_4 ... ... ... b_{n-3}b_{n-2}b_{n-1}b_n[/tex]
But how to prove afterward?
else we can add m zeroes so that (m+n) mod 4 ==0.
By adding zeroes before the binary number I can easily prove that nothing is changed.
[tex](*)=b_1b_2...b_{n-1}b_n=b_n*2^0 + b_{n-1}*2^1+...+b_2*2^{n-2}+b_1*2^{n-1}[/tex]
[tex]00..00b_1b_2...b_{n-1}b_n=b_n*2^0 + b_{n-1}*2^1+...+b_2*2^{n-2}+b_1*2^{n-1}+0*2^n+0*2^{n+1}...+0*2^{n+m}=(*)[/tex]
Any help would be appreciated.