Why I like ladder logic for boolean expressions

ganutenator

Lifetime Supporting Member
Join Date
May 2002
Location
kansas
Posts
1,440
Example:
Take this boolean algebraic expression:

note: I'm using a single quote to denote negation as I can't place a bar over the letter.

(CA + B' + C + D') * C

When you reduce this expression:
1) CA + CB' + C*C + CD' // multiply C by what is in parens
2) CA + CB' + C + CD' // we replace (C * C) with C because: C * C = C because: C AND C = C
3) CA + CB' + C * (1 + D') // we factor out C from (C + CD').
4) CA + CB' + C * 1 // (1 + D') = 1 because: (1 OR NOT D) = 1
5) CA + CB' + C // because: C * 1 = C or C AND 1 = C
6) CA + C * (B' + 1) // we know that (B' + 1) = 1 because NOT B OR 1 = 1
7) CA + C * 1
8) CA + C // (C * 1) = C because C AND 1 = C
9) C * (A + 1) // (A + 1) also known as A OR 1 = 1
10) C * 1 // C AND 1 = C
= C

Not immediately apparent that (A + B' + C + D') * C = C

Now in ladder as (CA + CB' + CC + CD'):

ladder example.PNG
 
Yes, it is easy to see that OR'ing w/ C will make the output true if C is true;
Not as apparent if C is False.
It is not a perfect example, I just found it interesting.
 
Not immediately apparent that (A + B' + C + D') * C = C
It is to me. It is as simple as factoring out C. Also 20 years ago Terry Wood would show you how to use Karnaugh maps to simplify boolean equations.
https://en.wikipedia.org/wiki/Karnaugh_map

There are also some basic rules like de Morgan's theorem.
https://en.wikipedia.org/wiki/De_Morgan's_laws


The good think about ladder is that you can see what contacts are active. In my programming IDEs I can set up a watch window or just hold my cursor over the variable I want to check.
 
It is to me. It is as simple as factoring out C. Also 20 years ago Terry Wood would show you how to use Karnaugh maps to simplify boolean equations.
https://en.wikipedia.org/wiki/Karnaugh_map

There are also some basic rules like de Morgan's theorem.
https://en.wikipedia.org/wiki/De_Morgan's_laws


The good think about ladder is that you can see what contacts are active. In my programming IDEs I can set up a watch window or just hold my cursor over the variable I want to check.

Well, if I remember correctly, you are quite the math genius. You in my opinion are not the norm.
 
I am not a math genius. I am good but not that good. I am at the point of "the more you know, the more you know you don't know".

"Always be skeptical of those who claim to be the best"

-Dunning Kruger














or what would have been said if there was ever a quote :D
 
Karnough maps are for analyzing and possibly reducing logic.
Ladder (and other languages) is to implement the logic, reduced or not.
I agree that Ladder is the best language for logic. Sometimes and with a little practice you can cut down unnecessary logic just by looking at the Ladder rung. But .. sometimes I leave unnecessary logic in, because commenting more is better than cutting down to the minimum. When you remove unnecessary code, you actually hide the considerations that were the reason behind the removal of the unnecessary code.
Ease of throubleshooting and maintaining trumps perfect optimization.

By the way, Siemens have added a new language to their TIA programming platform called "cause-effect matrix" aka CEM. Does sound similar to karnough maps. But I dont think the intention is to optimize the logic, only to make it very simple to program.
Someone asked on Siemens own forum "do you find CEM language useful? Will you use it?". No-one anwered.
https://support.industry.siemens.co...17-cause-effect-matrix-will-you-use-it/277410
 

Similar Topics

So hey guys, new here. Long time listener first time poster. Have a question for you. I'm looking to get into some rudimentary programming...
Replies
12
Views
5,208
I have a machine which is undergoing upgradation. As part of the process two SEW drives are being replaced., existing Gen B with new Gen C. The...
Replies
3
Views
183
Good morning crew! Ok my logic works but I am missing something. When the start button is pushed it should like the red light for 4sec then shut...
Replies
13
Views
409
Working on project will update after it is completed.
Replies
2
Views
351
Can someone help me piece this problem together. I have a lot of it down I think but cannot seem to get it right. Probably an easy one for most on...
Replies
1
Views
301
Back
Top Bottom