Saturday, September 27, 2014

Binary and hex

It's straightforward at this point to proceed with converting decimal to binary and hexadecimal. We first convert decimal to octal as shown in the previous post and then convert each octal digit to a three digit binary number using leading zero(s) when necessary. Then we separate the binary number found into groups of four digits starting from the end and convert each one to a hexadecimal number.

To continue with last post's examples, 77 decimal is 115 octal.
115 octal is 1 001 101 binary, i.e. 1001101 binary. 1001101 binary is 100 1101 hex, i.e. 4D hex.

11111 decimal is 25547 octal. 25547 octal is 10 101 101 100 111 binary, i.e. 10101101100111 binary. 10101101100111 binary is 10 1011 0110 0111 hex, i.e. 2B67 hex.

Adding 2B and 67 hex we get 92 hex = A (mod 11) hex. Thus we see that decimal 11111 is 10 (mod 17) decimal.

No comments: