Data Type Order Big Endian
Data Type Order Big Endian
7 6 5 4 3 2 1 0 Bit number 15 8 7 0
31 24 23 16 15 8 7 0
63 56 55 48 ... 7 0
BCD numbers do not have their own data type. For a BCD number, use the data type
WORD or DWORD and enter only the numbers 0 to 9 or 0 and F for the sign in the
hexadecimal form W#16#xxxx or DW#16#xxxx_xxxx. For a positive, three-decade
decimal number you can also use the notation C#0 to C#999.
BCD numbers are used, for example, in association with the conversion functions.
The sign of a BCD number is located in the left-justified (highest) decade. Thus one
decade is lost in the number range (Fig. 4.14).
The sign of a BCD number present in a 16-bit word is in the bits 12 to 15, where only
bit 15 is relevant. Signal state “0” means that the number is positive. Signal state
“1” represents a negative number. The sign does not influence the assignment of
the individual decades.
115