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

Page 140

Advertising
background image

Data Encoding and Addressing

Chapter 6

6-3

Binary Coded Decimal

PC data is often represented in binary coded decimal (BCD) form. In this
system, each group of four bits in a PC word represents one decimal
number between 0 and 9. In this way, each 16-bit word can represent a
BCD value between 0 and 9,999. Figure 6.2 shows the BCD
representation of the decimal number 239.

Figure 6.2
BCD Representation of Decimal 239

0

0

1

0

0

0

1

1

1

0

0

1

2

3

9

10241

0 x 2

3

= 0

0 x 2

2

= 0

1 x 2

1

= 2

0 x 2

0

= 0

0 x 2

3

= 0

0 x 2

2

= 0

1 x 2

1

= 2

1 x 2

0

= 1

1 x 2

3

= 8

0 x 2

2

= 0

0 x 2

1

= 0

1 x 2

0

= 1

2

3

9

10

Advertising