beautypg.com

Micromod Micro-DCI: 53MC5000 PLC AND PRINTER INTERFACES User Manual

Page 119

background image

APPENDIX A: BASE 2/8/10/16 TABLE

A numbering system is called a base. Numbers in the binary system are to the base 2; numbers in
the octal system are to the base 8, etc. The base of a number is usually indicated as a subscript
after the last digit of the number (e.g., 11010000

2

indicates this is an eight digit binary number and

not a decimal number in the ten-millions).

Decimal-to-binary conversion is performed by subtracting the weights from the decimal number un-
til 0 remains. A binary 1 digit is set for each position where the weight can be subtracted from the
decimal number. For example, to convert 208

10

to binary: 208 - 128 = 80 (bit 2

7

= 1); 80 - 64 =

16 (bit 2

6

= 1); 16 - 32 can not be performed (bit 2

5

= 0); 16 - 16 = 0 (bit 2

4

= 1); all other digits

2

3

through 2

0

are 0. The binary number is 11010000

2

. This number can then be converted into an

octal number by grouping the binary digits into three’s (11 010 000 = 320

8

) or a hexadecimal num-

ber by grouping the binary digits into four’s (1101 0000 = D0

16

).

Binary-to-decimal conversion is performed by adding the decimal weights of the binary 1 digits.
Using the same example as above, the binary number 11010000 has 2

7

, 2

6

, and 2

4

set to 1; there-

fore, the decimal weights of these three digits are added together to calculate the decimal equiva-
lent: 128 + 64 + 16 = 208

10

. Octal or hexadecimal numbers can be converted into decimal

numbers by first converting them into binary form. Each octal number requires three binary digits
and each hexadecimal number requires four binary digits (320

8

= 11 010 000

2

; D0

16

=

1101 0000

2

). The binary string is then converted to a decimal number by adding the decimal

weights of the binary 1 digits.

The above conversions can be summarized as follows:

11010000

2

= 320

8

= 208

10

= D0

16

Powers of 2:

2

7

2

6

2

5

2

4

2

3

2

2

2

1

2

0

Decimal Weights: 128 64 32 16 8 4 2 1

Highest Number: 1 1 1 1 1 1 1 1

2

= 255

10

for 8 binary digits

Binary Notation:

1 1 0 1 0 0 0 0

2

Octal = Groups of Three = 11 010 000

2

= 320

8

Hexadecimal = Groups of Four = 1101 0000

2

= D0

16

Decimal = Added Decimal Weights = 128 + 64 + 0 + 16 + 0 + 0 + 0 + 0 = 208

10

As a quick reference, Table A-1 is provided as a base 2/8/10/16 conversion table for numbers rang-
ing from 0 to 255

10

.

Appendix A. Base 2/8/10/16 Table

APPENDIX

A-1