The text of a manual · part 11 of 14
Analog Input Module, Cat. No. 1771-IFE, User Manual: C - Data Table Formats
Pages 52 to 54 of 63, from Analog Input Module, Cat. No. 1771-IFE, User Manual
The original document is the PDF (516 KB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Allen-Bradley 1771-IFE
Page 52
C
Appendix
Data Table Formats
4-Digit Binary Coded Decimal (BCD)
The 4-digit BCD format uses an arrangement of 16 binary digits to represent a 4-digit decimal number from 0000 to 9999 (Figure C.1). The BCD format is used when the input values are to be displayed for operator viewing. Each group of four binary digits is used to represent a number from 0 to 9. The place values for each group of digits are 20, 21, 22 and 23 (Table C.A). The decimal equivalent for a group of four binary digits is determined by multiplying the binary digit by its corresponding place value and adding these numbers. Figure C.1 4-Digit Binary Coded Decimal 0 X 23 = 0 0 X 22 = 0 0 X 21 = 0
1
1 X 20 = 1 0 X 23 = 0 0 X 22 = 0
2
1 X 21 = 2 0 X 20 = 0
0 X 23 = 0 0 X 22 = 0
3
1 X 21 = 2 1 X 20 = 1
1 X 23 = 8 0 X 22 = 0 0 X 21 = 0
910
1 X 20 = 1
0
0
0
1
0
0
1
0
0
0
1
1
1
0
0
1 12955-I
1
2
3
9
C-1
Page 53
Appendix C Data Formats
Table C.A BCD Representation
Signed-magnitude Binary
23 (8)
Place Value 22 (4) 21 (2)
20 (1)
Decimal Equivalent
0
0
0
0
0
0
0
0
1
1
0
0
1
0
2
0
0
1
1
3
0
1
0
0
4
0
1
0
1
5
0
1
1
0
6
0
1
1
1
7
1
0
0
0
8
1
0
0
1
9
Signed–magnitude binary is a means of communicating numbers to your processsor. It should be used with the PLC-2 family when performing computations in the processor. It cannot be used to manipulate binary 12-bit values or negative values. Example: The following binary number is equal to decimal 22. 101102 = 2210 The signed–magnitude method places an extra bit (sign bit) in the left–most position and lets this bit determine whether the number is positive or negative. The number is positive if the sign bit is 0 and negative if the sign bit is 1. Using the signed magnitude method: 0 10110 = +22 1 10110 = –22
C-2
Page 54
Appendix C Data Formats
Two's Complement Binary
Two’s complement binary is used with PLC-3 processors when performing mathematical calculations internal to the processor. To complement a number means to change it to a negative number. For example, the following binary number is equal to decimal 22. 101102 = 2210 First, the two’s complement method places an extra bit (sign bit) in the left-most position, and lets this bit determine whether the number is positive or negative. The number is positive if the sign bit is 0 and negative if the sign bit is 1. Using the complement method: 0 10110 = 22 To get the negative using the two’s complement method, you must invert each bit from right to left after the first “1” is detected. In the above example: 0 10110 = +22 Its two’s complement would be: 1 01010 = –22 Note that in the above representation for +22, starting from the right, the first digit is a 0 so it is not inverted; the second digit is a 1 so it is not inverted. All digits after this one are inverted. If a negative number is given in two’s complement, its complement (a positive number) is found in the same way: 1 10010 = –14 0 01110 = +14 All bits from right to left are inverted after the first “1” is detected. The two’s complement of 0 is not found, since no first “1” is ever encountered in the number. The two’s complement of 0 then is still 0.
C-3