Binary Adder-Subtractor
The subtraction of binary numbers can be done most conveniently by means of complements as discussed in Sec. 3-2. Remember that the subtraction A - B can be done by taking the 2's complement of B and adding it to A. The 2's complement can be obtained by taking the 1' s complement and adding one to the least significant pair of bits. The 1's complement can be implemented with inverters and a one can be added to the sum through the input carry.
These Topics Are Also In Your Syllabus | ||
---|---|---|
1 | Three-State Bus Buffers | link |
2 | Memory Transfer | link |
You May Find Something Very Interesting Here. | link | |
3 | Binary Adder | link |
4 | Binary Adder-Subtractor | link |
5 | Binary lncrementer | link |
These Topics Are Also In Your Syllabus | ||
---|---|---|
1 | Input-Output and Interrupt | link |
2 | Input - output Register | link |
You May Find Something Very Interesting Here. | link | |
3 | Complete Computer Description | link |
4 | Design of Basic Computer | link |
5 | Types Of Systems | link |
The addition and subtraction operations can be combined into one common circuit by including an exclusive-OR gate with each full-adder. A 4-bit adder-subtractor circuit is shown in Fig. 4-7. The mode input M controls the operation. When M = 0 the circuit is an adder and when M = 1 the circuit becomes a subtractor. Each exclusive-OR gate receives input M and one of the inputs of B. When M = 0, we have B a1 0 = B. The full-adders receive the value of B, the input carry is O, and the circuit performs A plus B. When M = 1, we have B a1 1 = B' and C0 = 1. The B inputs are all complemented and a 1 is added through the input carry. The circuit performs the operation A plus the 2's complement of B. For unsigned numbers, this gives A - B if A '" B or the 2's complement of (8 - A) if A < B. For signed numbers, the result is A - B provided that there Is no overflow.