in reply to Re^2: Bit operations for beginners
in thread Bit operations for beginners
p xor q === [something very long]
Hell's teeth! You weren't kidding.
I remember xor as (p and not q) or (q and not p) and it's been something like 30 years since I played with nand and nor expansions, so I expanded that:
xor === (p and not q) or (q and not p) expand the 'not's === (p and (q nor q)) or (q and (p nor p)) expand the 'and's === ((p nor p) nor ((q nor q) nor (q nor q))) or ((q nor q) nor ((p nor p) nor (p nor p))) expand the 'or's === (((p nor p) nor ((q nor q) nor (q nor q))) nor ((q nor q) nor ((p nor p) nor (p nor p)))) nor (((q nor q) nor ((p nor p) nor (p nor p))) nor ((p nor p) nor ((q nor q) nor (q nor q))))
Then it struck me that ((x nor x) nor (x nor x)) is x, which reduces it to
=== (((p nor p) nor q) nor ((q nor q) nor p)) nor (((q nor q) nor p) nor ((p nor p) nor q))
It's certainly more digestable (just :), but are there any other reductions in there?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Bit operations for beginners
by kaif (Friar) on Jun 28, 2005 at 16:50 UTC |