Example:
BAD(16) = 11 x 162 + 10 x 161 + 13 x 80
= 2816 + 160 + 13 = 298910
(The procedure is exactly the same as the one to find the representation for a value in the binary number system, except you need to divide by 8 instead of 2)
Example:
value = 30
Find the representation in the octal number system:
30
16 ------ 14 (= E)
1
16 ------ 1
0
representation is ----> 1E(16)
Hex digit Binary digits
----------- -------------
0 --> 0000
1 --> 0001
2 --> 0010
3 --> 0011
4 --> 0100
5 --> 0101
6 --> 0110
7 --> 0111
8 --> 1000
9 --> 1001
A --> 1010
B --> 1011
C --> 1100
D --> 1101
E --> 1110
F --> 1111
Example:
BAD(16) = 101110101101
901(16) = 100100000001
Binary digits Hex digit
------------- -----------
0000 --> 0
0001 --> 1
0010 --> 2
0011 --> 3
0100 --> 4
0101 --> 5
0110 --> 6
0111 --> 7
1000 --> 8
1001 --> 9
1010 --> A
1011 --> B
1100 --> C
1101 --> D
1110 --> E
1111 --> F
Example:
11010101 = D5(16)
10010001 = 91(16) (Note: this is NOT equal to 91 decimal !)