7-19
For example, when integer value 16,706 is transferred in ASCII and binary formats
are compared.
As shown in the figure below, five bytes are required to transfer the data in ASCII
format. In this case, the ASCII code must be converted to binary code. On the other
hand, only two bytes are required to transfer the data in binary format. In this case, the
data format does not need to be converted. Therefore, binary transfer is usually used
for high-speed data transfer.
ASCII transfer Binary transfer
X
=
16706
Upper byte
Lower byte
Upper byte
1st byte 2nd byte
41
(
H
)
31
(
H
)
36
(
H
)
37
(
H
)
30
(
H
)
36
(
H
)
42
(
H
)
(H) indicates
hexadecimal
representation.
16706
1st byte 2nd byte 3rd byte 4th byte 5th byte
16706
(
D
)=
4 × 16
3
+ 1 × 16
2
+ 4 × 16
1
+ 2 × 16
0
Lower byte
bit 15
0
14
1
13
0
12
0
11
0
10
0
9
0
8
1
7
0
6
1
5
0
4
0
3
0
2
0
1
1
0
0
X
=
16706
bit 7
0
6
1
5
0
4
0
3
0
2
0
1
0
0
1
0
1000010
1st byte
2nd byte
(Transmission sequence): 1st byte to 2nd byte
(Upper byte) = 41 (H)
(Lower byte) = 42 (H)
Binary
representation
7.2 Sample Program (Example of Program Using Visual Basic)