0% found this document useful (0 votes)
19 views

Data Type Order Big Endian

Uploaded by

adam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

Data Type Order Big Endian

Uploaded by

adam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

4.

6 Elementary data types

Data type BYTE Data type WORD


Byte m Byte m Byte m+1

7 6 5 4 3 2 1 0 Bit number 15 8 7 0

Data type DWORD


Byte m Byte m+1 Byte m+2 Byte m+3

31 24 23 16 15 8 7 0

Data type LWORD


Byte m Byte m+1 Byte m+7

63 56 55 48 ... 7 0

Fig. 4.12 Assignment of bit-serial data types

Data type CHAR

Byte m Special characters for CHAR


CHAR HEX Meaning

Bit 7 6 5 4 3 2 1 0 $$ 16#24 Dollar symbol


$' 16#27 Single inverted comma

ASCII code $L or $l 16#0A Line feed (LF)


$R or $r 16#0D Carriage return (CR)
$P or $p 16#0C Form feed (FF)
$T or $t 16#09 Tabulator

Fig. 4.13 Structure of the CHAR data type

4.6.3 BCD numbers BCD16 and BCD32

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

You might also like