I have to create a 1-bit ALU and then use that to create a 4-bit ALU. But I am having a lot of problems when handling the carry out.
The 4-bit ALU can only have 2 selection lines and carry in it uses carry in order to generate 8 different cases.
The 4-bit ALU can only have 2 selection line and carry in. My problem is how do I handle the carry out correctly in order to input into the other ALU.
For example if I have to add "0011" with "0011" You will notice that the first ALU which is assigned to add first bit from both 4 bit WORD will produce a carry of 1. But when that carry pass into the other ALU the function table will switch from addition to subtraction. Since a Cin = 1 produces a subtraction.
I would suggest that you ignore the parenthetical comments in the selection table. The first "subtract" comment doesn't make any sense to me unless there is a missing bar over the
B
term. If you do that then you have a pretty straigtforward multibit adder...except for the increment/decrement functions. Those will take a little more thinking. I am suspicious that there are errors in the table.