# Logic algebra minimalization

Discussion in 'Math' started by spursfan, Jun 8, 2016.

1. ### spursfan Thread Starter New Member

Jun 8, 2016
4
0
Hi, I have a problem to understand this equation. The underline means it is negative. I try every possible rule to simplify. I don´t know about the last bold part.

F=x1*x2+x2*x3+x1*x2=x1*x2+(x1+x1)*x2*x3+x1*x2+x1*x2

Thanks for help.

2. ### MrAl AAC Fanatic!

Jun 17, 2014
5,356
1,148
Hi,

Are you allowed to use the xor operation?

3. ### spursfan Thread Starter New Member

Jun 8, 2016
4
0
It is possible to solve without? But I take every solution

4. ### MrAl AAC Fanatic!

Jun 17, 2014
5,356
1,148
Hi,

Well the solution i see right away for the equivalent (n=negate):
a*bn+b*c+an*b

is:
a xor b + b*c

because:
a xor b=a*bn+an*b

5. ### DGElder Member

Apr 3, 2016
351
87
OP, Can you state the problem as it was presented to you? I don't understand what you are trying to do.
You have three equivalents, are those given or is the second string of terms your partial reduction of the right hand string?
Does "F" mean False? Is that given and are you supposed to determine X1,X2 and X3, i.e. true or false?

6. ### WBahn Moderator

Mar 31, 2012
23,208
6,997
The more conventional notation for negation when writing in text is the apostrophe. So your problem would be written as:

F = x1*x2' + x2*x3' + x1'*x2

Where did that part in bold come from? Ask yourself if it makes sense. That term says that the expression is True (not might be True, but IS True) if both x1 and x2 are False. Look at the original expression and see if that claim is correct. In fact, if both x1 and x2 are False, the original expression CAN'T be True.

Unless you can use XOR, I don't see how the original expression can be simplified any further.

Can you see which two terms for an XOR?

7. ### spursfan Thread Starter New Member

Jun 8, 2016
4
0
Thanks for answers. I try to write as many info as possible.
Problem is to make a combinational logical circuit by multiplexer. The multiplexer should be describe by equation.
for example:

where G is activation. A and B are adressing inputs. I are data inputs.
Problem is I don't understand how I get the result here.

By result I can make wires for data and adresses and get the expected output. but I would like to understand the alteration of equation.
By original task I assume that it should be the same equation without using XOR and similiar alterations.

8. ### WBahn Moderator

Mar 31, 2012
23,208
6,997
Thanks for finally letting us know that your goal isn't to "simplify" the equation, but rather to recraft it into a form that is compatible with using multiplexer to implement the logic. There's a HUGE difference between the two.

Do you understand why the equation for Y represents the logic function implemented by a 4:1 MUX?

9. ### spursfan Thread Starter New Member

Jun 8, 2016
4
0
Well it's the representation of multiplexer and how it works. It get you the value of output according to inputs. I see a difference, but still don't understand the recrafting.

10. ### MrAl AAC Fanatic!

Jun 17, 2014
5,356
1,148
Hi,

Yeah i hate that notation
Makes it look almost like a derivative, and the ' is so small it's hard to see sometimes
I do try to use it anyway though when the OP uses it.

I have seen a lot of variations here:
_a
a_
a_bar
not(a)
not a

I chose to use "an" because it retains the low symbolic complexity of a 'normal' variable such as "R1", so it enters into program constructs just as easily.
In programmatical computations i have to use not(a) because either the function 'not' has already been defined to negate 'a' or i have to define it myself, unless i already calculated it as 'an'.

"an=not(a)"
"if an==1 then"
//etc.

"a'=not(a)"
"Error: variable not formed correctly or illegal variable name: <a'>"

11. ### WBahn Moderator

Mar 31, 2012
23,208
6,997
There's no "best" notation, that's for sure, particularly if you are limited to pure text.

I liked MicroSim's convention (or rather came to like it) in which signal names that were prefixed by an underscore (which is Spice-compatible) were rendered with an overbar on the schematic. Of course, people that were used to using underscore in their netlists for any other reason (such as local signals having the same name as a global signal) had to change their ways.

12. ### MrAl AAC Fanatic!

Jun 17, 2014
5,356
1,148
Hi again,

I like the overscore of course, but almost everything i write has to be in text or else i have to make an accompanying bitmap/gif picture drawing with the bars over the variables for negation. Looks nice when done, but takes more work on the part of the author.

This led me to other conventions too which are very readable and easy to type. The best one i could come up with so far is limited to 26 letters, but that's usually more than enough. The new convention is upper case for non negation and lower case for negation. Works really nice.

("C" appears negated and also non negated in this expression)
Y=A*B*c*D+C*E

This works out really well for reading as well as programmatically when i want to do some program that has to read and interpret logic statements.

13. ### WBahn Moderator

Mar 31, 2012
23,208
6,997
I'd be really leery of using upper and lower case to distinguish complemented from uncomplemented signals. If it works for you, great. But it's too easy to make case mistakes for my taste, particularly with letters that look the same, such as c and C or s and S. Of course with longer names the case becomes much more obvious, but I prefer shorter, even single character, names where possible. Since SPICE is case-insensitive, this convention would not allow you to use the same names in a simulation as are used in other programming environments. However, both SPICE and most programming environments accept the use of the underscore. Since MicroSim schematics has pretty much gone away (we had to move away from it beforehand anyway because we needed a SPICE engine that supported the higher level BSIM models) we adopted the convention of following negated signals with '_b'. That worked pretty well for us, though there are invariably times when a signal name might naturally end in '_b', such as a group of signals named 'chan_a', 'chan_b', and 'chan_c', but it doesn't take too much to choose a different, but reasonable, set of names.

14. ### MrAl AAC Fanatic!

Jun 17, 2014
5,356
1,148
Hello again,

Well, it's a little late now, i already have several programs that work with upper case for non and lower case for negation. The very reason i took this method on was because i wanted to be able to show a variable as a SINGLE character but still be able to show if it is negated. In normal writing, the upper bar shows negation and so that does not take up more than one character space. I wanted something similar but could not type a bar over the variables letters A through Z or even a through z. That's the reasoning behind it.
What this does is simplify the programming also, and i always use a non proportional font during source code authoring which also shows upper case and lower case distinct enough for every problem i've come across. Dont forget in this text you're reading the chars are not necessarily in the font i use, and i never use the typical font used here. Typical fonts i dont use are Arial, MS Sans Serif, etc. Those are not as clear as say Courier New for technical stuff. For example, consider upper and lower case "L"
Of course we can always skip that one, as with "C", but i never have a problem with C and i never had to do a problem that went up to "L" either.
If you remember the old connectors long ago that skipped the "i" and i think the "O" so they could not be confused with other letters or numbers.

Example of xor gate with underscores:
y=_AB+_BA

Just a little cryptic looking.

Example using upper and lower case:
y=aB+bA

Quite compact

15. ### djsfantasi AAC Fanatic!

Apr 11, 2010
3,549
1,289
I guess it's a matter of personal preference, since there is no standard, but I personally find

Y=aB+bA

...a little cryptic!

16. ### WBahn Moderator

Mar 31, 2012
23,208
6,997
So would you call the two outputs of an RS latch Q and q? Or would you use different letters for them?

17. ### MrAl AAC Fanatic!

Jun 17, 2014
5,356
1,148
Hi,

Yes maybe you could say that too. Mainly i wanted a notation where i could use just one letter per variable regardless of whether it was negated or not.

Note we do already have conventions like this for example:
dy/dx
dT/dx

where one is change in a spacial dimension with another x, and one is change in temperature with spacial dimension x, and here upper/lower case have to be recognized also.

18. ### MrAl AAC Fanatic!

Jun 17, 2014
5,356
1,148
Hi again,

Different physical logic outputs would always have totally different letters not upper/lower case difference. So in this case Q might be variable A and Qbar might be B. That would be the same with an inverter driving another inverter, where the output of one might be A and the other B. The fact that they are the negation of the other does not matter.

Another example where case usually matters is:
dy/dx
dT/dx
dy/dT
dy/dt

and note that T is temperature which distinguishes it from time t.

The main thing though it that it works pretty well in programs. For example to negate any single variable just check to see if it is upper case, and if it is then make it lower case by added 32. If it is lower case then subtract 32. It can also be done the other way where lower case is non negated and upper case is negated.

Note we also use upper/lower case to indicate the difference between variables and constants in regular math:
z=x*K1+y*K2

and that is fairly common.

19. ### KeepItSimpleStupid Distinguished Member

Mar 4, 2014
2,922
511
Then there's: A + ~B

20. ### djsfantasi AAC Fanatic!

Apr 11, 2010
3,549
1,289
@MrAl - How would you code the following:
'(A+B)​
?