Trying to figure out how to explain xor. Manual does a poor job of even mentioning the command. Weregoose explained it to me, and now I *think* I have an understanding of it. We shall see...

Code:

a = 1
b = 2
if (a == 1 xor  b==2)  //this will return false)
if (a == 1 xor b==3) //this will return true

I hope that helps.
So it pretty much returns true if only 1 condition is true?
it is exclusive or.
truth tables ftw

==========
|p--------|0|1|0|1|
==========
|q--------|0|0|1|1|
==========
|p xor q|0|1|1|0|
==========
I think your truth table is wrong... if both variables are "true" than xor returns 0, if only one is "true", than it returns 1. That is what the table shows in the manual anyways...
yes, and if both are 0 I think xor returns 0. So the last line should be 0110, not 1111 Smile
http://tifreakware.net/tutorials/83p/b/tifw/les4.htm

I am hoping that someone might have some time to look it over, see what they think. I am trying to make sure I have covered all the angles, at least from what has been shown so far. I am only holding back info on things that the person has not yet learned about, that would tie in with the commands.
Look good to me; other than the disclaimer you already mentioned on the missing function extensions, I see nothing omitted.
whoops, I posted the OR truth table *sheepish* typoed.
elfprince13 wrote:
whoops, I posted the OR truth table *sheepish* typoed.
No you didn't, that's the NOR truth table. Methinks you need to take a digital logic course. Very Happy
lol, its all good. Razz

I am just glad that I got the explanation correct in the tutorial...

Kerm, could you point out the "disclaimers" plx? Smile
tifreak8x wrote:
...I am only holding back info on things that the person has not yet learned about, that would tie in with the commands.
oh, you had me confused there... Razz I thought you meant it was posted twice in the lesson... >.<

Twould be nice if I could find the & ; codes for >= and <=... Anyone happen to know those? Smile
KermMartian wrote:
elfprince13 wrote:
whoops, I posted the OR truth table *sheepish* typoed.
No you didn't, that's the NOR truth table. Methinks you need to take a digital logic course. Very Happy


no, I think edited it, and didn't realise I had typed the entire first column as ones, and I also need to stop doing these things at 3 in the morning
You had this:

|p--------|0|1|0|1|
==========
|q--------|0|0|1|1|
==========
|p xor q|1|1|1|0|


That's NOR.
The first time he had all 1s at the bottom... which is... umm... nothing that I know of Razz (certainly nothing useful if it does exist)
All 1's is "p or q or 1". Razz
Well, if we all agree that the information that is on lesson 4 is complete and accurate, I will begin work on lesson 5. Lesson 5 is about Lbl's and Goto's so it should not take long to rewrite that lesson, and move onto the next.

I am hopefully going to the library for an hour or so tonight, so I might even get most of the way complete with lesson 6. I have a 4.3GB file that I am torrenting, so hopefully an hour at the library will help speed that along, as I have about 8 hours on dialup, and only 1.2% of the download completed.
You're torrenting a 4gig file via 56k? Yeah, let us know in 3 years if that's finished yet. Razz
Sounds like a plan re: lessons 5 and 6. Standing by to proofread.
  
Page 3 of 5
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement