Data encoding and addressing chapter 6 – Rockwell Automation 1770-KF2 Data Highway or Highway Plus Interface Module User Manual User Manual

Page 141

Advertising
background image

Data Encoding and Addressing

Chapter 6

6-4

Decimal

The decimal number system is probably the easiest for us to use because it
is the most familiar to us. It uses the common digits 0 through 9, and each
digit has a place value that is a power of 10 (Figure 6.3). However,
despite the convenience of decimal numbers, it is often easier to convert
binary data to a number system other than decimal.

Figure 6.3
Decimal Representation, Number 239

2

3

9

10238

200

30

9

2 x 10

2

= 200

10

3 x 10

1

= 30

10

9 x 10

0

= 9

10

239

10

10

Hexadecimal

The hexadecimal number system is the most compact way to represent
binary data, and it allows for the easiest conversion to and from binary.
This system uses a number set of 16 digits: the numbers 0 through 9 and
the letters A through F (where the letters A through F are equivalent to the
decimal numbers 10 through 15, respectively).

Each group of four data bits represents one hexadecimal digit between 0
and F. In this way, each 16-bit data word can have a hexadecimal value
between 0 and FFFF.

Each digit of a hexadecimal number has a place value that is a multiple of
16. To convert a hexadecimal number to its decimal equivalent, multiply
each hexadecimal digit by its corresponding place value and add the
results of the multiplications. Figure 6.4 shows the hexadecimal
representation of the decimal number 423.

Advertising