Question: 5. (Modular Approach for Building 2's Complement Circuit) Recall that the 2's complement of an n-bit binary number A can be obtained by complementing all
5. (Modular Approach for Building 2's Complement Circuit) Recall that the 2's complement of an n-bit binary number A can be obtained by complementing all the bits and then adding 1. By carrying out this process, we notice that the following quick inspection method can equivalently lead to the 2's complement of A: working from the LSB to the MSB, write doun each bit up to and including e first 1 and then complement each bit thereafter. Based on this method, we can develop the following procedure to determine the 2's complement of a 4-bit binary number A a3a2aiao (here A is the input; let us call the output T which is a 4-bit binary number T = tatto) (a) Start at the LSB of A. (b) If this is the first (least significant) 1, flip all bits to the left (c) If this is not the first 1, leave the bit alone. (d) If this is the MSB, finish; otherwise, move one bit to the left, and go to step (b)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
