Cryptography Reference
In-Depth Information
Table A.1: Decimal and binary equivalents of hex digits
Decimal
Binary
Hex
0
0000
0
1
0001
1
2
0010
2
3
0011
3
4
0100
4
5
0101
5
6
0110
6
7
0111
7
8
1000
8
9
1001
9
10
1010
A
11
1011
B
12
1100
C
13
1101
D
14
1110
E
15
1111
F
Converting from binary to hex is just substituting the other way. For example, to
convert 11000111 2 into hex we make the substitutions:
1100 2 =
C 16 ,
0111 2 =
7 16
from Table A.1, to get:
11000111 2 =
C 7 16 .
In the case where the binary number cannot be neatly divided into groups of four
bits, we add leading zeros until it can. Thus to convert 1110011111 2 into hex we
first add two leading zeros:
1110011111 2 = 001110011111 2 .
 
Search WWH ::




Custom Search