The circuit to the right is a completed 4 Bit ALU. The sensor input at the bottom will select the ALU function, to implement subtract, the 2’s complement requires that the A input be inverted, which was taken care of in the circuit above, but also the addition of a +1. This is accomplished by forcing the carry in to bit 0 of the ALU to 1, hence the reason for the decoder on the bottom right. LEDs have been placed on the carry outs and the ALU outs to make it easier to see what is happening. As a quick exercise replace that decoder with explicit logic gates, which will output a 1 when the input is 2.
The circuit to the right is a completed 4 Bit ALU. The sensor input at the bottom will select the ALU function, to implement subtract, the 2’s complement requires that the A input be inverted, which was taken care of in the circuit above, but also the addition of a +1. This is accomplished by forcing the carry in to bit 0 of the ALU to 1, hence the reason for the decoder on the bottom right. LEDs have been placed on the carry outs and the ALU outs to make it easier to see what is happening. As a quick exercise replace that decoder with explicit logic gates, which will output a 1 when the input is 2.
2P12%20Lab%203%20-%20ALU.docx