Logic operators as numbers

Interested in Robotics? Here's the place to be.
Post Reply
hlreed
Posts: 349
Joined: Wed Jan 09, 2002 1:01 am
Location: Richmond, TX
Contact:

Logic operators as numbers

Post by hlreed »

X = A o B where o is some logic operator like AND.
Write the truth table for A,B and name the pairs. Write some operators for the pairs.
A B * >
0 0 Z 0 0 0 ... and so on.
0 1 L 0 0 0
1 0 G 0 0 1
1 1 E 0 1 0
As you see, we are making a four bit number. Lets make a truth table of that.
Z L G E
0 0 0 0
0 0 0 1 AND, *, Min
0 0 1 0 GT, >
0 0 1 1 GTE, >=
0 1 0 0 LT, <
0 1 0 1 LTE, <=
0 1 1 0 XOR, -
0 1 1 1 OR, + ; end of standard logic and arith.
1 0 0 0 NAND
1 0 0 1 IS ; from Hal algebra
and so on, mostly new names or inverses of the first 8.<p>You can do arithmetic with these numbers and it makes sense, although I do not have any notion of what good it does.
Note that we have a new truth table from the 4 bits, creating 65335 new numbers.
Hope this amuses you.
Harold L. Reed
Microbes got brains
dyarker
Posts: 1919
Joined: Fri Aug 22, 2003 1:01 am
Location: Izmir, Turkiye; from Rochester, NY
Contact:

Re: Logic operators as numbers

Post by dyarker »

Do you have a bar bet with a freshman math major?<p>Kind of interesting. Wierd, but interesting.<p>I don't see any use for it either. In a strange twisted way it looks like FPGA programming. "A" and "B" as input pins. "Z L G E" as flash register bits inside setting what operation to do.<p>Binary optical illusion?<p>What-ever, amused :)
Dale Y
bwts
Posts: 229
Joined: Tue Jun 11, 2002 1:01 am
Location: britain
Contact:

Re: Logic operators as numbers

Post by bwts »

Crazy! like it!<p>question does IS=NXOR ?<p>B)
"Nothing is true, all is permitted" - Hassan i Sabbah
hlreed
Posts: 349
Joined: Wed Jan 09, 2002 1:01 am
Location: Richmond, TX
Contact:

Re: Logic operators as numbers

Post by hlreed »

IS = NXOR ?
Z 1 0
L 0 1
G 0 1
E 1 0
If N = complement, yes. But I am not sure bit Not is Not of operator. NAND is 1000 from logic. Depends on where you put the Not.
Arithmetically XOR and OR are complements since XOR is - and OR is +.
I suppose that is the real use for this. You see these kinds of patterns.<p>IS was developed because 0 = 0 or 1=1 are both equals. IS is really = as an operator. It is because I say A = B is C instead of A = B = C. = is not really an operator, it is a transfer machine that feeds output.<p>There is no / in here. Is it in MPY, 0001 ?
Harold L. Reed
Microbes got brains
hlreed
Posts: 349
Joined: Wed Jan 09, 2002 1:01 am
Location: Richmond, TX
Contact:

Re: Logic operators as numbers

Post by hlreed »

Here are all the numbers cleaned up.
Z L G E Op
0 0 0 0 Z
0 0 0 1 AND,*,Min
0 0 1 0 GT, >
0 0 1 1 GTE, >=
0 1 0 0 LT, <
0 1 0 1 LTE, <=
0 1 1 0 XOR, -
0 1 1 1 OR, +
1 0 0 0 NOR
1 0 0 1 NXOR, IS
1 0 1 0 NLTE
1 0 1 1 NLT
1 1 0 0 NGTE
1 1 0 1 NGT
1 1 1 0 NAND
1 1 1 1 NZ, X+NX<p>So there are 14 operators and complements. There are 7 operators and I would say that completes them. What are derived from the truth table:
AND GT GTE LT LTE XOR OR
0 0 0 0 0 0 0 Z
0 0 0 0 0 0 1 OR only
0 0 0 0 0 1 0 XOR only
0 0 0 0 0 1 1 OR+XOR = OR
0 0 0 0 1 0 0 LTE only
and so on. What is the logic of adding operators?
Since I have nothing better to do, I will work this out and get back to you.
Harold L. Reed
Microbes got brains
hlreed
Posts: 349
Joined: Wed Jan 09, 2002 1:01 am
Location: Richmond, TX
Contact:

Re: Logic operators as numbers

Post by hlreed »

If you make the number from the operators AND, GT, GTE, LT, LTE, XOR, OR and make all those 128 numbers, then you have:
1 o 2 o 3 o 4 o 5 o 6 o 7 where o is some operator like MIN, MAX. (Addtition rearanges the bits.)
What happens is that the AND, GT, ... OR operarators come back to you. One AND, Lots of ORs if you use MAX. 0 if you use MIN.<p>Conclusion. There are no more binary operators out there.
Harold L. Reed
Microbes got brains
Post Reply

Who is online

Users browsing this forum: No registered users and 49 guests