Programmable Logic Controllers

The number system used for everyday calculations is the denary or decimal system. This is based on the use of the 10 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. With a number represented by this system, the digit position in the number indicates the weight attached to each digit, the weight increasing by a factor of 10 as we proceed from right to left. Hence we have:
|
| 10 3 | 10 2 | 10 1 | 10 0 |
| thousands | hundreds | tens | units | |
| Denary | 1000 | 100 | 10 | 1 |
Counting can, however, be done to any base. The denary system is just convenient because we have ten fingers. If we had only two then our system for everyday counting would probably have been different. Computers, and hence PLC systems, are based on counting in twos because it is convenient for their system, their two digits being effectively just the off and on signals. When working with PLCs, other base number systems are also used, e.g. input and output addresses are often specified using the octal system, i.e. base 8.
The binary system is based on just two digits: 0 and 1. These are termed binary digi ts or bits. When a number is represented by this system, the digit position in the number indicates the weight attached to each digit, the weight increasing by a factor of 2 as we proceed from right to left.
|
| 2 3 | 2 |