Codes; Bcd Code - Mitsubishi MELSEC System Q Manual

Hide thumbs Also See for MELSEC System Q:
Table of Contents

Advertisement

An Introduction to Programming
4.4

Codes

For safe und efficient data communication the letters of the alphabet and the decimal numbers
must be converted into a code that a machine can understand.
4.4.1

BCD Code

Binary-coded decimal (BCD) is an encoding for decimal numbers in which each digit (0 to 9) is
represented by a 4-bit binary number (0000 to 1001, see table below). Thus one byte (8 bits)
can store two decimal numbers.
To convert decimal numbers with more than one digit the BCD expressions of the individual
digits are linked together. A four digit number in BCD code occupies one word (16 Bit) and can
cover the range from 0000 to 9999.
Example
0
0
2
In the MELSEC System Q the BCD code is not used for internal operations. However, in indus-
trial applications BCD is frequently used to input values or to display numbers on a LED dis-
play. For those cases several instructions for converting to and from BCD code are available.
MELSEC System Q Beginners Manual
Decimal
0
1
2
3
4
5
6
7
8
9
1
0
0
1
0
1
5
BCD
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
0
0
1
1
0
1
3
1
1
BCD
7
Decimal
Codes
4 – 5

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents