# How to construct a truth table

Yes this is a homework problem, but I only need help setting it up, there are 7 parts to the question once I set it up:

We want to build a function Y = 2X + 3 where X denotes a 3-bit unsigned value(x2x1x0) and Y = y4..y0 is a 5-bit value in hardware. Contruct its truth table where input bits are x2, x1, and x0 and output bits are y4 through y0.

The homework problem then asks for a bunch of other things which I can get. I just don't understand the question, how do you create a truth table based on a function and these input bits?

Should the truth table look something like this?

x2 x1 x0 y4 y3 y2 y1 y0
0  0  0  0  0  0  1  1
0  0  1  0  0  1  0  1
0  1  0  0  0  1  0  1
0  1  1  0  0  1  1  1
1  0  0  0  1  0  1  1
1  0  1  0  1  1  0  1
1  1  0  0  1  1  1  1
1  1  1  1  0  0  0  1


For each of the eight inputs, you compute the output. You will get a table with eight rows and $3+5=8$ columns, containing the three input bits and the five output bits.