What Is End-Around Carry in One’s Complement?
End-around carry is an arithmetic adjustment technique used in one’s complement binary systems, where an overflow carry generated from the most significant bit (MSB) during addition is looped back and added to the least significant bit (LSB). This article explains the fundamentals of one’s complement arithmetic, illustrates why standard binary addition produces an off-by-one discrepancy when handling negative numbers, and details the mathematical necessity of the end-around carry to ensure correct results.
Understanding One’s Complement Representation
In binary systems, negative numbers can be represented using one’s complement notation. To find the one’s complement of a positive binary number, every bit is inverted (0s become 1s, and 1s become 0s).
A key characteristic of this system is that it possesses two distinct
representations for zero: * Positive Zero (+0):
Represented by all 0s (e.g., 0000 in a 4-bit
system). * Negative Zero (-0): Represented by all
1s (e.g., 1111 in a 4-bit system).
Because of these two states for zero, an \(n\)-bit one’s complement system represents \(2^n - 1\) unique values, ranging from \(-(2^{n-1} - 1)\) to \(+(2^{n-1} - 1)\).
The Origin of the Discrepancy
Standard binary adders operate using modulo \(2^n\) arithmetic. However, because one’s complement has two representations of zero, true arithmetic in one’s complement must operate modulo \(2^n - 1\).
When you add two numbers in one’s complement and the operation
crosses the zero boundary (such as adding a positive and a negative
number where the positive magnitude is larger), standard binary addition
traverses both the positive zero (0000) and the negative
zero (1111). Because the hardware counts standard
positional weights, crossing this dual-zero state causes the raw binary
sum to fall short by exactly \(1\).
Whenever this zero boundary is crossed in a way that generates a carry out of the most significant bit (MSB), that discarded carry represents a value of \(2^n\). In modulo \(2^n - 1\) arithmetic, \(2^n \equiv 1 \pmod{2^n - 1}\). Therefore, losing the carry out of the MSB effectively subtracts \(2^n\), which is one unit too many. To balance the equation, that \(1\) must be re-added to the least significant bit.
How End-Around Carry Works
When performing addition in one’s complement: 1. Add the two binary numbers using standard binary addition. 2. Check if a carry bit is produced from the most significant bit (the leftmost bit). 3. If a carry is generated, remove it from the MSB and add it to the least significant bit (the rightmost bit) of the result. 4. If no carry is generated, the initial sum is the final answer.
Example: Adding 5 and -2 (4-bit System)
- Positive 5 (\(+5\)) in binary:
0101 - Positive 2 (\(+2\)) in binary:
0010 - Negative 2 (\(-2\)) in one’s
complement:
1101
Step 1: Standard Addition
0101 (+5)
+ 1101 (-2)
-------
1 0010 (Intermediate result with a carry-out of 1)
The raw 4-bit result is 0010 (decimal \(2\)), which is incorrect since \(5 + (-2) = 3\).
Step 2: Apply End-Around Carry Take the carry bit
(1) from the MSB and add it to the LSB:
0010
+ 1
-------
0011 (Final result)
The binary value 0011 represents decimal \(3\), which is the correct mathematical
result.
Why End-Around Carry Is Required
End-around carry is required because standard hardware binary addition inherently ignores the duplicate zero in one’s complement. Without wrapping the overflow carry back into the LSB: * Operations resulting in a carry-out would always be off by \(-1\). * The mathematical relationship \(A + (-B) = A - B\) would fail whenever \(A > B\).
While effective, the requirement for end-around carry introduces extra propagation delay and circuit complexity because the addition hardware may need to execute two addition passes. This limitation is one of the primary reasons modern computing architectures favor two’s complement arithmetic, which has a single representation for zero and discards the MSB carry without needing correction.