Find a boolean expression from a truth table (several bits)

170 Views Asked by At

I have the following truth table (a and b being my inputs and r the result):

a b r
00 00 00
00 01 01
00 11 01
01 00 01
01 01 01
01 11 01
11 00 01
11 01 01
11 11 11

The issue is that I can't find the boolean expression to express this truth table. Another similar thread pointed out that karnaugh maps could solve it, but I can't find any implementation working with several bits inputs.


Note that to my model, the second bit doesn't matter is the first one is set for a specific input, thus if it facilitates the boolean expression, I can force it to 0, to 1, or not even force it.

1

There are 1 best solutions below

0
On

Truth Table (given):

a0 a1 b0 b1  r0 r1
0  0  0  0   0  0
0  0  0  1   0  1
0  0  1  1   0  1
0  1  0  0   0  1
0  1  0  1   0  1
0  1  1  1   0  1
1  1  0  0   0  1
1  1  0  1   0  1
1  1  1  1   1  1

Kmaps:

r0:
    \a0a1
b0b1 \ | 00| 01  11  10
00     | 0 | 1   1   1
        ---
01       1   1   1   1

11       1   1   1   1
        ---
10     | x | x   x   x
       |   |


r1:
    \a0a1
b0b1 \   00  01  11  10
00       0   0   0   0

01       0   0   0   0
                ---  
11       0   0 | 1 | 0
               |   |
10       x   x | x | x
                ---

Boolean Expressions:

r0 = a0 + a1 + b1

r1 = a0a1b0