Four bit adder: Difference between revisions

m
→‎{{header|Quackery}}: tweaked commentary
m (→‎{{header|Quackery}}: tweaked commentary)
m (→‎{{header|Quackery}}: tweaked commentary)
Line 5,509:
After this, <code>over</code> does its thing again, again working on the topmost items on the stack, and then <code>and</code> takes two arguments from the stack and returns one result to the stack. By convention, words other than stack management words consume their arguments. Words can take zero or more arguments, and leave zero or more results.
 
<code>unrot</code> is another stack operatormanagement word, which moves the top of stack down below the third on stack, the third and second on stack becoming the second on stack and top of stack respectively. (The converse action is <code>rot</code>. It moves the third on stack to the top of stack.)
 
Finally <code>and</code> and <code>or</code> both take two items from the stack and return one, leaving one item. So we can see from the diagram that <code>xor</code> takes two items and returns one. The stack comment <code>( b b --> b )</code> reflects this, with the <code>b</code>'s standing for "Boolean".
1,462

edits