|
PowerBASIC Forums
![]() Cafe PowerBASIC
![]() A Logical Puzzle
|
| next newest topic | next oldest topic |
| Author | Topic: A Logical Puzzle |
|
Charles Pegge Member |
A minimalist programming language called has only 2 operators.One is NOT the other is OR. examples: You can use any number of A B and nesting pairs of brackets How would you express A AND B ? ------------------ IP: Logged |
|
Eros Olmi Member |
...
[This message has been edited by Eros Olmi (edited January 18, 2007).] IP: Logged |
|
Simon Morgan Member |
((A) (B)) IP: Logged |
|
David Roberts Member |
Without spending too much time on this my first thought is that we cannot. 'AND' is independent and thus cannot be represented by 'NOT' and 'OR'. 'XOR' is not independent but does require 'AND'. IP: Logged |
|
Donald Darden Member |
When CDC (Computer Data Corporation) built the 1604, 1604a, and C160a computers for the Navy back in the 1950s, they only employed one type of logic gate, the NOR (Not OR) gate. You can build any other type of logic gate by stringing NOR gates together in various combinations. ------------------ IP: Logged |
|
Maciej NEYMAN Member |
Hi Charles, 1.)I think there is typographic mistake in the first line of your examples: it is : (A) means NOT (A) I think it should be: (A) means NOT A Please confirm. 2.) It seems to me that there is only one operator in yours Very interesting, regards, Edited: [This message has been edited by Maciej NEYMAN (edited January 18, 2007).] IP: Logged |
|
David Roberts Member |
That's interesting Donald. It may have been only one gate but it is a combination of NOT and OR ie two independent logics. I may have to look at it again. ![]() There is no typing error - the third line follows from the first two and wasn't required. Added: No need. Just checked Simon's post. Well done, Simon. [This message has been edited by David Roberts (edited January 18, 2007).] IP: Logged |
|
Aleksandr Dobrev Member |
quote: Replace "AND" and "XOR" with OR-NOT combination:
------------------ [This message has been edited by Aleksandr Dobrev (edited January 19, 2007).] IP: Logged |
|
Charles Pegge Member |
Thank you everybody. The answers that Simon produced are correct. By applying NOT to both inputs and output OR is turned into AND, and vice-versa. AND ( (A) (B) ) and Alex has demostrated the PB equivalent. If you are interested in this kind of minimalism then: ------------------ IP: Logged |
|
Aleksandr Dobrev Member |
Yes, operation XOR can be done in a various way, depend what kind of chip I have on a shelf for replace XOR-chip (when i don't have XOR-chip at time when i need it) it can be done as
result is the same. More intersting result can be done with help of card of Carno
Sometimes its very helpful for optimization by speed. ------------------ [This message has been edited by Aleksandr Dobrev (edited January 19, 2007).] IP: Logged |
All times are EasternTime (US) | next newest topic | next oldest topic |
![]() |
|
Copyright © 1999-2006 PowerBASIC, Inc. All Rights Reserved.