Boolean expression sought for
- From: "xadrezus" <xadrezus@xxxxxxxxx>
- Date: 7 Jun 2005 09:13:14 -0700
Hi, all:
For a private programming project, I need to compute the
following boolean expression. Given n "rows" of 9 bits each
as arguments, I need a boolean expression which will compute
the following:
"Columns", i.e. bit positions
1 2 3 4 5 6 7 8 9
"Rows"
---------------------------------------
1 0 0 1 0 0 0 0 1 0
2 0 0 1 0 0 1 1 1 0
3 0 1 1 0 0 1 1 0 0
4 0 0 0 0 0 0 1 0 0
5 0 0 0 1 0 1 0 1 0
6 0 0 0 0 1 1 0 0 0
Result: 0 1 0 1 1 0 0 0 0
where the result has a bit set if and only if its "column"
has just one and only one bit set. So, in this example,
the result has just three bits set, corresponding to the
fact that column 2 has just a bit set (namely for row 3),
and the same for column 4 (row 5) and column 5 (row 6).
I've tried to get some boolean expression to compute this,
but despite using all kinds of combinations of ANDs, ORs,
NOTs, and XORs, the resulting expression is incredibly
long and weird-looking, not to mention inefficient to
compute.
I initially thought this was a case of "multiple XOR",
but the definitions I've seen consider an odd number
of 1s to be true, while I want it true if there's
exactly one "1" in that column, no more, no less.
If any of you could provide such an expression either
for the general case of N rows or particularized to 9
rows, I would be very obligued indeed.
Best regards.
.
- Follow-Ups:
- Re: Boolean expression sought for
- From: Martin Shobe
- Re: Boolean expression sought for
- From: Ken Quirici
- Re: Boolean expression sought for
- From: Candida Ferreira
- Re: Boolean expression sought for
- From: Peter Webb
- Re: Boolean expression sought for
- From: Ken Pledger
- Re: Boolean expression sought for
- Prev by Date: Re: FOL, ZFC, NGB and Prolog
- Next by Date: Re: FOL, ZFC, NGB and Prolog
- Previous by thread: FOL, ZFC, NGB and Prolog
- Next by thread: Re: Boolean expression sought for
- Index(es):
Relevant Pages
|
Loading