Originally Posted by
tabstop
So, what is function(A, S) supposed to do, exactly? Why is there a B all the time? Where does Input go? I could guess, but it's more fun to make you figure it out.
the function (a,S) should create the 4 loops, and using the printvalues, print them out. The B is one of the 2nd set of the values, can be explained using this:
The truth table is as follows:
Code:
Line A3 A2 A1 A0 B3 B2 B1 B0 S Y3 Y2 Y1 Y0
0 0 0 0 0 x x x x 0 0 0 0 0
1 0 0 0 1 x x x x 0 0 0 0 1
2 0 0 1 0 x x x x 0 0 0 1 0
...................................................................................
15 1 1 1 1 x x x x 0 1 1 1 1
16 x x x x 0 0 0 0 1 0 0 0 0
17 x x x x 0 0 0 1 1 0 0 0 1
...................................................................................
31 x x x x 1 1 1 1 1 1 1 1 1
A and B are inputs, Y is output, S is Select. x means “do not care”
The S and Y's got a little left-shifted in my example.
And as I mentioned, there is no User input needed. It should just run thru the loops and print the values.