This article is about The Binary System Concept in PLC. Read Also Previous Articles if you did not read before.

- Lecture 1: What is Programmable Logic Controller in PLC?
- Lecture 2: PLC Hardware Components – PC Information
- Lecture 3: PLC Internal Architecture and Diagram Explanation
- Lecture 4: What is PLC System? and Working Principle
- Lecture 5: How to Connect Input Devices to PLC? Input Devices Examples
- Lecture 6: How to Connect Output Devices to PLC? PLC Output Devices
- Lecture 7: PLC Applications Examples And Solutions
- Lecture 8: Numbering System in PLC (Digital System)

## The Binary System Concept in PLC

The binary system is a number system that uses two digits, 0 and 1, which are referred to as binary digits or bits. Each digit’s position in a binary number represents a different weight, with the weight increasing by a factor of 2 as you move from right to left.

The rightmost bit in a binary number is called the least significant bit (LSB), and the leftmost bit is called the most significant bit (MSB). The LSB represents the smallest weight in the number, while the MSB represents the largest weight.

For example, let’s consider the binary number 1010. The LSB is the rightmost bit, which is 0 in this case. Its weight is determined by its position, which is 2^0 (2 raised to the power of 0), equivalent to 1. Moving to the left, the next bit is 1, with a weight of 2^1, which is 2. The next bit is 0 with a weight of 2^2, which is 4. Finally, the MSB is 1 with a weight of 2^3, which is 8. So the binary number 1010 represents the decimal value of 8 + 0 + 2 + 0 = 10.

In summary, the binary system is a base-2 number system that uses only 0 and 1 as its digits. The position of each bit in the number determines its weight, with the rightmost bit being the LSB and the leftmost bit being the MSB.

To convert a binary number to a decimal (denary) number, you need to multiply each bit (0 or 1) by the corresponding power of 2 based on its position and then sum up the results. Let’s use the binary number 1010 as an example:

1 * 2^3 + 0 * 2^2 + 1 * 2^1 + 0 * 2^0

Simplifying the equation:

8 + 0 + 2 + 0

The calculation gives us:

10

Therefore, the binary number 1010 is equivalent to the decimal number 10.

In general, to convert a binary number to a decimal number, you add up the products of each bit (0 or 1) multiplied by 2 raised to the power of its position, starting from the rightmost bit (LSB) with a position of 0 and increasing by 1 for each subsequent bit towards the left.

To convert a decimal (denary) number to a binary number, you can use the method of successive divisions by 2. Here’s a corrected explanation using the denary number 31:

- Divide 31 by 2:
- Quotient: 15
- Remainder: 1

- Divide 15 (the quotient from the previous step) by 2:
- Quotient: 7
- Remainder: 1

- Divide 7 (the quotient from the previous step) by 2:
- Quotient: 3
- Remainder: 1

- Divide 3 (the quotient from the previous step) by 2:
- Quotient: 1
- Remainder: 1

- The process stops when the quotient becomes 1.

Reading the remainders from bottom to top gives us the binary representation:

31 in denary is equal to 11111 in binary.

The LSB (Least Significant Bit) is obtained from the remainder of the first division, and the MSB (Most Significant Bit) is obtained from the remainder of the last division.