Panasonic FP-M Hardware Manual page 241

Table of Contents

Advertisement

binary:
Binary Coded Decimal (BCD):
In general, programmable controllers work with binary numbers in one form
or another to represent various codes or quantities. The binary number
system uses the number 2 as the base and the only allowable symbols are "0"
and "1". There are no 2s, 3s, etc. Each digit of binary is called as "bit". "Bit"
means "binary digit". A group of 8 bits is called a "byte" and a group of 16
bits (two bytes) is called a "word".
Most significant bit
(MSB)
15
14 13
Bit position
0
0
0
Binary data
The binary number "0000000000101011" is expressed in decimal as follows:
1 × 2
+ 1 × 2
+ 0 × 2
+ 1 × 2
0
1
2
= 1 + 2 + 0 + 8 + 0 + 32 + ..... + 0
= 43
One of the codes expressed in binary. BCD is a binary code in which each
decimal digit from 0 to 9 is represented by four binary digits (bits). The four
positions have a weighted value of 1, 2, 4, and 8, respectively, starting with
the least significant bit. A thumbwheel switch is specified as a BCD device,
and when connected to a programmable controller, each decimal digit
requires four inputs.
BCD is usually expressed grouping four bits as one digit in the same way as
the hexadecimal constant H. When BCD is grouped in four bit units, the
BCD is expressed by adding the prefix H to the data. Since the weight of
each BCD H code is same as that of decimals, be sure to pay attention
not to be confused with hexadecimal numbers when BCD H code is
handled.
Example: When K1993 (decimal) is expressed in BCD.
Decimal
K
1
BCD code
0 0 0 1
BCD H code
H
1
10
Least significant bit
12
11
10
9
8
7
6
5
0
0
0
0
0
0
0
1
byte
word
+ 0 × 2
+ 1 × 2
+ ..... + 0 × 2
3
4
5
9
9
3
1 0 0 1
1 0 0 1
0 0 1 1
9
9
3
× 9 = 90
10
1
× 9 = 900
10
2
× 1 = 1000
3
8-13. Terminology
(LSB)
4
3
2 1
0
0
1
0
1 1
byte
15
× 3 = 3
10
0
233

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents