Boolean expression sought for



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.

.



Relevant Pages

  • Re: Boolean expression sought for
    ... > For a private programming project, ... I need a boolean expression which will compute ... > I initially thought this was a case of "multiple XOR", ... However, if you don't know about Karnaugh maps, they might help ...
    (sci.logic)
  • Re: Boolean expression sought for
    ... > For a private programming project, ... I need a boolean expression which will compute ... >I initially thought this was a case of "multiple XOR", ... & means bitwise and, ...
    (sci.logic)
  • Re: Boolean expression sought for
    ... xadrezus wrote: ... > For a private programming project, ... I need a boolean expression which will compute ... > I initially thought this was a case of "multiple XOR", ...
    (sci.logic)

Loading