1
$\begingroup$

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
$\endgroup$
1
$\begingroup$

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.

$\endgroup$
  • $\begingroup$ Edited my post, is that the truth table we're looking for? $\endgroup$ – KJ3 Sep 24 '14 at 5:59
  • $\begingroup$ Yes, you got the idea. $\endgroup$ – Yuval Filmus Sep 24 '14 at 6:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.