First of all sorry if this is not aproperiate place for this post.


So for example i have to make XOR using Boolean logic.

I made it but the method i have used is good for children (gues and play till everything works)

I know that one can solve this problem with mathematic using de'Morghan's law but i couldn manage it :(
Posted on 2004-01-06 13:04:30 by AceEmbler

First of all sorry if this is not aproperiate place for this post.


So for example i have to make XOR using Boolean logic.

I made it but the method i have used is good for children (gues and play till everything works)

I know that one can solve this problem with mathematic using de'Morghan's law but i couldn manage it :(


See:
http://webster.cs.ucr.edu/Page_AoAWin/HTML/DigitalDesign.html#362

This explains boolean logic and describes how to synthesize XOR as a logic equation,
e.g.,
XOR = AB' + A'B
Cheers,

Randy Hyde
Posted on 2004-01-06 15:15:07 by rhyde



See:
http://webster.cs.ucr.edu/Page_AoAWin/HTML/DigitalDesign.html#362

This explains boolean logic and describes how to synthesize XOR as a logic equation,
e.g.,
XOR = AB' + A'B
Cheers,

Randy Hyde



thx a lot :alright:

im not stupid but still it took me a lot of time to figure it out (even now i dont know what is this F53504 and F248 ) ;)
Posted on 2004-01-06 20:40:43 by AceEmbler

First of all sorry if this is not aproperiate place for this post.


So for example i have to make XOR using Boolean logic.

I made it but the method i have used is good for children (gues and play till everything works)

I know that one can solve this problem with mathematic using de'Morghan's law but i couldn manage it :(


Do you mean make XOR using and, or, not as basis?
Or what?
For example it can be:
x xor y = (x or y) - (x and y)
shorter that Randal's one :)
Posted on 2004-01-07 05:58:03 by The Svin
By the way, xor come from or, when was defined boolean logic, there will or was? some operations that need be defined, this one:

a and b



a b | a and b
0 0 | 0 -> No set
0 1 | 0 -> No set
1 0 | 0 -> No set
1 1 | 1 -> Set all or true all
This is like a bit tester if is turned on or not, now was needed a operation that can alternate the result, this was (the before or):



a b | a alternator b
0 0 | 0 -> Cant alternate....
0 1 | 1 -> Alternate a 1
1 0 | 1 -> Alternate a 1
1 1 | ? -> How we alternate two 1's???
Here like you see, the alternator dont have a result for 1 and 1, because alternate mean alternate a 0 with 1, then come the OR and XOR, see that if you use inclusive or exclusive OR and when you select one of this two, you have the exclusive-OR, or the inclusive-OR

the result for:
1 1 | ?

inclusive-OR
1 1 | 1

exclusive-OR
1 1 | 0

Inclusive -or include the case where the alternator is a=1 b=1 for give a result of 1 and
Exclusive -or exclude the case where the alternator is a=1 b=1 for give a result of 0

and is for that the names of exclusive and inclusive.......


By the way ;), can be more easy make a alternator and decide if for 1 to 1 use inclusive or exclusive.

Nice day or night.
Posted on 2004-01-07 08:29:01 by rea
There might be different ways how one can understand XOR.
I'll give just few of them.

1. OR that EXCLUDE Truth for AND.
OR talking about True gives the same result only in case
True OR True = True AND True.
XOR exclude this simuliarity giving False in the case of
True XOR True (1 xor 1 = 0), for the rest it gives the same result as OR.

It's classical way in The West.

In Russia for example, usual way to understand was this one:

2. Addition modulo 2.
Really if you add two bits and take only low bit of result (remider of division by 2) you get the same as with XOR.


1+1= 1[b]0[/b] 0= 1 XOR 1
1+0= [b]1[/b] 1= 1 XOR 0
0+1= [b]1[/b] 1= 0 XOR 1
0+0= [b]0[/b] 0= 0 XOR 0

3. I prefer 3rd way to explain. (I invent it myself, but have no doubt someone could figureout it too, and might have done it a long way before I did :)

NOT EQUAL.
If a = b then a xor b = 0
If a <>b then a xor b = 1
By a and b I mean only booleans, not booleans sets.

As to Randy book, I think, among many other assembly books his boolean math basics explonations are very good and worthy too read for a beginner to the subject.
Posted on 2004-01-07 18:49:00 by The Svin
x xor y = (x or y) - (x and y) this is like the 1 that you put there ;).
The two is interesting, but I think in the alternator, when it not have problems given a result for alternate two zeros or a zero and an one in any order, but the 'problem' to what to choice?, is when you have two ones, like yo know 1+1 = 10, here you see two posibilities, with a normal or, you take the first binary digit, with the exclude way, you take the right binary digit.

And for get the third, maybe some logic guy in the past, is more fast that what I can think, or see:
not (a <=> b), like you see here you sholve first a<=>b, and then negate it, the third is more brief than this.


What I say from the alternator whas taked from a book of whitehead, I think. Also he say in his book that in the text, dont like that the people say that exclusive or is taked like: and/or (in spanish y/o), because is wrong that way... about how is writed, for example in a text.. simple text you will not see a XOR b, you will see a and/or b.

----------------
Also I think than in a text, if you are good, you can understand where a or is XOR, example: you can be dead or with live. Is easy to see that one exclude the other, and not need the specification of and/or.

Have a nice day or night.
Posted on 2004-01-07 20:12:52 by rea
The Svin: Why is (x or y) - (x and y) shorter?

With digital electronics, it takes 5 nand gates to implement AB' + A'B

xor is great for conditional inversion, or inverting with bit mask.
Posted on 2004-01-08 00:33:40 by eet_1024

The Svin: Why is (x or y) - (x and y) shorter?

With digital electronics, it takes 5 nand gates to implement AB' + A'B

xor is great for conditional inversion, or inverting with bit mask.


You can do it with 4 gates
Posted on 2004-01-08 06:55:47 by AceEmbler
You could do it with one gate, xor. But it used to be cheaper to use only nands for glue logic. Of course now we have xPLD's that replace descrete logic.

In reality, that circuit is the same as the 5 NAND I speak of. I'm just want to know what that equation is shorter?
Posted on 2004-01-08 15:28:11 by eet_1024
With some circuits, such as flipflops, you can get the complemented output for free. In that case, the AB'+A'B combination only needs three gates.

There is also a special two-input XOR circuit. There is a schematic for it in an old TTL manual that I have buried somewhere.
Posted on 2004-01-08 16:25:11 by tenkey
What about (xy)'(x+y) then?
Posted on 2004-01-24 09:31:21 by The Svin
With some circuits, such as flipflops, you can get the complemented output for free. In that case, the AB'+A'B combination only needs three gates.
I dont know what FlipFlops have to do with Xor operation. But yes you can do it with 3 gates with NAND gate. And The Svin example shows it perfectly.
Posted on 2004-01-26 15:15:01 by AceEmbler
To All,
It takes just four 2-input NAND gates to implement a 2-input XOR gate. By the way, what does the minus sign in (x or y) - (x and y) mean? Ratch
Posted on 2004-01-26 20:28:05 by Ratch
probably the same as (x or y) or ~(x and y)
Posted on 2004-01-27 06:08:23 by AceEmbler
AceEmbler,
probably the same as (x or y) or ~(x and y)


What does the '~' symbol mean? Ratch
Posted on 2004-01-27 12:09:29 by Ratch
the '~' is here used as a negation (a "not")
in c it's used as symbol for binary negation as well.
Posted on 2004-01-27 12:39:24 by hartyl
hartyl,
So would it not be more clear to write is as (x+y)+(xy)' ? Ratch
Posted on 2004-01-27 13:34:01 by Ratch

The Svin: Why is (x or y) - (x and y) shorter?

With digital electronics, it takes 5 nand gates to implement AB' + A'B

xor is great for conditional inversion, or inverting with bit mask.


It takes 5 gates yet 2 inverters.

Look at it this way:
(AB)'(A+B) vs AB'+A'B.
(AB)' is nand element. =|)0
Let's say (AB) is X and (A+B) is Y

You just implement it to disconnect elect. to X of (X Y) "and" element
if AB line is active and pass it if it's inactive.
It's like in el. relay times - elmag. might be used as disconector not always connector.
Posted on 2004-05-23 08:11:40 by The Svin