PLC Program to Implement 3 to 8 Line Decoder

This is a PLC Program to Implement 3 to 8 Line Decoder.

Problem Description

Implement 3 to 8 line decoder in PLC using Ladder Diagram programming language.

Problem Solution
  • It has three inputs I0, I1 and I2 and 8 outputs Q0 to Q7.
  • These three inputs I0, I1 and I2 determines which output should be active.
  • If I0 and I1 are true and I2 is false, then Q6 will be activated and all others are not.
  • It does not need K-map and simplification so one step is eliminated to create Ladder Logic Diagram.
  • Realize the 3 to 8 line decoder using Logic Gates.

Truth Table can be written as given below.

Inputs	   Outputs
I2 I1 I0   Q0 Q1 Q2 Q3 Q4 Q5 Q6	Q7
0  0  0	   1  0	 0  0  0  0  0	0
0  0  1	   0  1	 0  0  0  0  0	0
0  1  0	   0  0	 1  0  0  0  0	0
0  1  1	   0  0	 0  1  0  0  0	0
1  0  0	   0  0	 0  0  1  0  0	0
1  0  1	   0  0	 0  0  0  1  0	0
1  1  0	   0  0	 0  0  0  0  1	0
1  1  1	   0  0	 0  0  0  0  0	1

Realization of 3 to 8 line decoder using Logic Gates
plc-program-implement-3-8-line-decoder-01

PLC Program

Here is PLC program to Implement 3 to 8 Line Decoder, along with program explanation and run time test cases.

advertisement
advertisement
List of Inputs and Outputs
 I0=			I:1/0	(Input)
 I1=			I:1/1	(Input)
 I2=			I:1/2	(Input)
 Q0=			O:2/0	(Output)
 Q1=			O:2/1	(Output)
 Q2=			O:2/2	(Output)
 Q3=			O:2/3	(Output)
 Q4=			O:2/4	(Output)
 Q5=			O:2/5	(Output)
 Q6=			O:2/6	(Output)
 Q7=			O:2/7	(Output)

Ladder Diagram for 3 to 8 line decoder
plc-program-implement-3-8-line-decoder-02

Program Description
  • In all the rungs, I0 (I:1/0), I1 (I:1/1) and I2 (I:1/2) are used to determine which output from Q0 to Q7 should go ON..
  • Q0 to Q7 are outputs.
  • When I0 (I:1/0), I1 (I:1/1) and I2 (I:1/2) are low, output 0 O:2/0 will get activated.
  • When I:1/0 and I:1/1 are low and I:1/1 is high that is when I0 and I1 are low and I2 is high, output 1 O:2/1 will get activated.
  • Similarly remaining six different outputs are obtained.
  • In other words, according to bit pattern of I0 I:1/0, I1 I:1/1 and I2 I:1/2, outputs from Q0 to Q7 are activated.
Runtime Test Cases
Inputs	   Outputs
I2 I1 I0   Q0 Q1 Q2 Q3 Q4 Q5 Q6	Q7
0  0  0	   1  0	 0  0  0  0  0	0
0  0  1	   0  1	 0  0  0  0  0	0
0  1  0	   0  0	 1  0  0  0  0	0
0  1  1	   0  0	 0  1  0  0  0	0
1  0  0	   0  0	 0  0  1  0  0	0
1  0  1	   0  0	 0  0  0  1  0	0
1  1  0	   0  0	 0  0  0  0  1	0
1  1  1	   0  0	 0  0  0  0  0	1

Sanfoundry Global Education & Learning Series – PLC Algorithms.
To practice all PLC programs, here is complete set of 100+ PLC Problems and Solutions.

If you find any mistake above, kindly email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.