Chapter 3 Devices Byte: A byte is composed of two consecutive nibbles (i.e. 8 bits, b7~b0). Bytes can be used to represent 00~FF in the hexadecimal system. Word: A word is composed of two consecutive bytes (i.e. 16 bits, b15~b0). Words can be used to represent 0000~FFFF in the hexadecimal system. Double word: A double word is composed of two consecutive words (i.e. 32 bits, b31~b0). Double words can be used to represent 00000000~FFFFFFFF in the hexadecimal system. The relation among bits, nibbles, bytes, words, and double words in the binary system is shown below. DW Double word W1 W0 Word BY3 BY2 BY1 BY0 Byte NB0 NB1 NB2 NB3 NB4 NB5 NB6 NB7 Nibble Bit 2.
Decimal number (DEC) A decimal number can be used as the setting value of a timer, or the setting value of a counter, e.g. TMR T0 K50 (K indicates that the value following it is a constant.). A decimal number can be used as the number of an S/M/SM/T/C/D/SR/V/Z/P device, e.g. M10 and T30. A decimal number can be used as an operand in an applied instruction, e.g. MOV K123 D0 (K indicates that the value following it is a constant.). Decimal numbers can be used as external input numbers, e.g. X0.0~X0.15 and X1.0~X 1.15. Decimal number can be used as external output numbers, e.g. Y0.0~Y0.15 and Y1.0~Y1.15. 3.
Hexadecimal number (HEX) A hexadecimal number can be used as an operand in an applied instruction, e.g. MOV H1A2B D0 (H indicates that the value following it is a constant.). Constant (K): A decimal number is generally preceded by K. For example, K100 represents the decimal number 100. Exception: If K is used with an M/S device, a nibble device, a byte device, a word device, or a double word device will be formed. Example: K1M100 represents a device composed of 4 bits, K2M100 represents a device composed of 8 bits, K3M100 represents a device composed of 12 bit, and K4M100 represents a device composed of 16 bits. Constant (16#): A hexadecimal number is generally preceded by 16#.
For example, the hexadecimal number 16#100 represents the decimal number 256. Floating-point number (F): A floating-point number is generally preceded by F. For example, the floating-point number F3.123 represents 3.123. 3-3 b31 b30 b29 b28 b27 b26 b25 b24 b23 b22 b21 b20 b19 b18 b17 b16 b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0