195k views
5 votes
Your ALU can add its two input registers, and it can logically complement the bits of either input register, but it cannot subtract. Numbers are to be stored in twos complement representation. List the micro-​operations your control unit must perform to cause a subtraction.

User Banica
by
8.8k points

1 Answer

3 votes

Final answer:

To perform subtraction with an ALU that can only add and complement bits, we can use twos complement representation. The control unit performs two micro-operations: logical complement on the bits of the number to be subtracted, and addition using the ALU's addition operation.

Step-by-step explanation:

In order to perform subtraction using an ALU (Arithmetic Logic Unit) that can only add and logically complement bits, we can use the twos complement representation. Here are the micro-operations performed by the control unit:

  1. Take the bits of the number to be subtracted and perform logical complement on each bit.
  2. Add the logical complemented number to the other number using the ALU's addition operation.

For example, to subtract 3 from 5, we would first complement the bits of 3 to get -3, and then add -3 to 5 using the ALU's addition operation. The result will be 2.

User Mohammad Hosseini
by
8.2k points