A NUMBER SYSTEM AND CODE (chapter 12)

Knoeledge of number systems other than the decimal numbering system is quite useful when working PLCs or with almost any type of digital equipment. This is true because a basic requirement. This is true because a basic requirement of these divices is to represent, store, and operate on a numbers. In general, PLCs work on binary numbers in one form or another; these are used to represent various codes and quantities. Often the programmer needs to be able to perform conversions between the systems, and to perform math functions within each system.

The decimal system, which is most common to us, has a base of 10. The base of a number system determines the total number of different symbols or digits used by the system. For instance, in the decimal system, 10 unique number or digits-the digits 0 through 9-are used.

WP_20140513_024

A comaparison between four common numbering systems: decimal (base 10), octal (base 8), hexadecimal (base 16), and binary (base 2). Note that all numbering systems start at zero.

The binary numbering system (base 2) is the basis af all digital systems. Two state exits in digital equipment, an ON state, which is representative of one (1), and an OFF condition, which is representative of zero (0). The ON condition in a circuit is approximately equal to supply voltage, and the OFF to zero volts or ground. A third state may exist in some logic circuits to produce tri-state logic. This condition is ahigh-impedence or no-voltage state and is not considered in the binary system.

The octal numbering system, a base 8 system, is often used in microprocessor, commputer, and programmable controller systems because 8 data bits make up a byte of information which can be addressed by the PLC user or programmer. Is some intances, programmable controller manufacturers use the octal system to number wiring terminals, programmable controller racks, and other PLC hardware. The octal number system makes use of 8 digits: 0 through 7. As in all other number systems, each digit in an octal number has a weighted decimal value according to its position.

WP_20140513_030

The hexadecimal (hex) number system provides even shorter notation than octal. Hexadecimal uses a base of 16. It employs 16 digits, numbers 0 through 15, respectively. The techniques for converting hexadecimal to decimal and decimal to hexadecimal are the same as those used for binary and octal.

WP_20140513_031

The binary coded decimal (BCD) system provides a convenient means to handle large numbers that need to be input to or output from a PLC. The BCD system represents decimal numbers as patterns of 1s and 0s. This system provides a means of converting a code readily handled by humans (decimal) to a code readily handled by the equipment (binary).

Leave a comment