9 PLC Program To Implement Binary To Gray Code Conversion
9 PLC Program To Implement Binary To Gray Code Conversion
Conversion
This is a PLC Program to Implement Binary to Gray Code Conversion.
Problem Description
Implementing Binary to Gray Code conversion in PLC using Ladder Diagram
programming language.
Problem Solution
In Gray Code only one bit changes at a time.
Write truth table showing the relation between Binary as input and Gray code as
output.
To obtain these equations, Karnaugh-Map method is again used.
For each Gray code output D3, D2, D1 and D0, write Karnaugh-Map.
From the K-Map, obtaining a simplified expression for each Gray Code output in
terms of Binary inputs.
Realize the code converter using the Logic Gates.
By following actual process to convert Binary into Gray Code, Truth Table can be
written as given below.
PLC Program
Here is PLC program to Implement Binary to Gray Code Conversion, along with
program explanation and run time test cases.
advertisement
Program Description
RUNG000 to RUNG003 are to obtain D3 to D0 Gray Code output.
Output D3 (O:2/0) is same as input B3 (I:1/0).
Output D2 (O:2/1) is obtained by EX-ORing B3 (I:1/0) and B2 (I:1/1).
Output D1 (O:2/2) is obtained by EX-ORing B3 (I:1/1) and B1 (I:1/2).
Output D0 (O:2/3) is obtained by EX-ORing B2 (I:1/2) and B0 (I:1/3).
This program description is also the actual process to convert any BCD number
into Gray Code.