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 :(

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 :(

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

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 ) ;)

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 :)

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

the result for:

1 1 | ?

1 1 | 1

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.

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.

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.

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.

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.

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.

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.

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.

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

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

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

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?

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?

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.

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.

What about (xy)'(x+y) then?

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.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

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

probably the same as (x or y) or ~(x and y)

AceEmbler,

What does the '~' symbol mean? Ratch

probably the same as (x or y) or ~(x and y)

What does the '~' symbol mean? Ratch

the '~' is here used as a negation (a "not")

in c it's used as symbol for binary negation as well.

in c it's used as symbol for binary negation as well.

hartyl,

So would it not be more clear to write is as (x+y)+(xy)' ? Ratch

So would it not be more clear to write is as (x+y)+(xy)' ? 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.