# Implement a 3-input function using only two 2-input LUTs

This is my homework: "Given the function $f(x_1, x_2,x_3) = \sum (2,3,4,6,7)$ Show how it can be realized using two 2-input LUTs. Give the truth table implemented in each LUT."

At the beginning it seems very simple, but this is a beast! I don't want you to solve it, but just show me a way to come up with a general formula to solve these kinds of LUT optimization problems.

I only know that an n-input LUT can be used to implement a $2^n$ input function, so in this case we have 3 inputs so we need a 3-input LUT. Meanwhile if we are forced to use 2-input LUT, then I can see that we can divide the function output values into two LUTs with $x_1, x_2$ as their inputs, and then put a MUX with $x_3$ as its selector to produce the function $f$. But in this problem we are not allowed to use the MUX, but only two 2-input LUTs. How can it be?!

• Have you tried using Karnaugh diagrams? This might simplify your function quite radically. After that you could use de Morgan's law and other laws to get a function you want Commented Aug 28, 2016 at 14:08
• This problem is not about function optimization. It is about implementation of a function using LUTs with constraints. Commented Aug 28, 2016 at 14:11
• ... which is the same problem, @Ehsan. Commented Aug 28, 2016 at 14:16
• For example, 2,3, 6 and 7 look like could be grouped and written by two or even one variable which would make everything so much easier, wouldn't it? Commented Aug 28, 2016 at 14:24
• No. In LUT implementation, optimization do not have an effect on the number of LUTs being used. There is no need for Boolean optimization here. Commented Aug 28, 2016 at 14:28