I need to design an ALU with two 8-bit inputs A and B and control inputs x, y, and z that supports the following operations:
x y z | operation
0 0 0 | S = A-B
0 0 1 | S = A+B
0 1 0 | S = A*8
0 1 1 | S = A/8
1 0 0 | S = A NAND B (bitwise)
1 0 1 | S = A XOR B (bitwise)
1 1 0 | s = reverse the bits of A
1 1 1 | S = NOT A (bitwise)
This is supposed to be done with an 8-bit adder and an arithmetic-logic extender. Reading through my textbook, I see that the purpose of an AL-extender is to alter the input bits so that an adder, rather than a lot of extra components, can be used to do everything (or at least that's what I understand from it). For example, the AL-extender could put the bits in two's complement so that the adder does a subtraction. Likewise, for the bitwise logical operations, the bits could be altered appropriately and one of the adder inputs could just be zero so that the result comes through properly.
But what exactly do I do about multiplication? My book is very vague, so I'm not sure if an AL-extender would require me to do something clever to make the adder do the work (just add 8 times in my case? ...ha ha), or if I can just throw a multiplier in there. I'll have to read up on division, but I bet it's similar to multiplication.
Well, anyway, the bottom line is still, what is an AL-extender "allowed" to be/able to have in it? Is its only purpose to alter input so that it can be fed to an adder?
*EDIT: Well, it is multiplication/division by 8, so this can be easily performed with shifting left or right by 3. Would I still have a real/proper AL-extender if I added some shifters in there? (Maybe I'm overthinking this as a complete beginner...)