ICSOC-8.7.5 Binary Arithmetic and Signed Representations (M)

Easy

ICSOC-8.7.5.1 Fundamental Binary Addition: Truth Tables, Carry Propagation, and Multi-Bit Column Summations

Fundamental Binary Addition: Truth Tables, Carry Propagation, and Multi-Bit Column Summations

Binary addition forms the primitive operational cornerstone of digital computing hardware and arithmetic logic units. Operating in base-2, binary addition adheres to four elementary combinational rules: 0 + 0 = 0 (carry 0), 0 + 1 = 1 (carry 0), 1 + 0 = 1 (carry 0), and 1 + 1 = 10_2, which yields a sum bit of 0 and generates a carry-out bit of 1 to the next higher-order bit position. When an incoming carry-in bit is integrated—as in full-adder logic—the condition 1 + 1 + 1 evaluates to 11_2, producing a sum bit of 1 and a carry-out bit of 1. Multi-bit addition proceeds positional column-by-column from the least significant bit (LSB) to the most significant bit (MSB), cascading carries across consecutive bit weights.

In hardware design, the sequential transmission of carries across multi-bit adders introduces a physical propagation delay known as the carry propagation ripple delay. In a simple ripple-carry adder, each subsequent full-adder stage must await the stabilization of the carry-out from its predecessor before generating a valid sum, creating an O(n) latency for an n-bit word. To overcome this computational bottleneck in high-speed microprocessors, arithmetic architectures employ Carry-Lookahead Adders (CLA) that calculate carry generation and propagation signals simultaneously using parallel combinational logic gates, drastically reducing addition latency to logarithmic time.

Easy
In elementary binary addition, what is the result of adding the two bits 1_2 and 1_2?
Option A is correct because in base-2 arithmetic, 1 + 1 equals 2 in decimal, which is represented in binary as 10_2. This produces a local sum bit of 0 and generates a carry-out bit of 1 to the next higher-order bit position. Option B represents 1 + 0 or 0 + 1. Option C represents 1 + 1 + 1 (three 1s with an incoming carry). Option D represents 0 + 0.
Medium
Compute the binary sum of the two 5-bit unsigned integers: 10111_2 + 01101_2.
Option A is correct. Let us add column by column from LSB to MSB: 1) 1 + 1 = 0 (carry 1); 2) 1 + 0 + 1 (carry) = 0 (carry 1); 3) 1 + 1 + 1 (carry) = 1 (carry 1); 4) 0 + 1 + 1 (carry) = 0 (carry 1); 5) 1 + 0 + 1 (carry) = 0 (carry 1); 6) Most significant carry generates 1. Combining these yields 100100_2. In decimal verification: 10111_2 = 16 + 4 + 2 + 1 = 23_10; 01101_2 = 8 + 4 + 1 = 13_10; 23 + 13 = 36_10. In binary, 36_10 = 32 + 4 = 100100_2. Option B (34_10) drops the second carry. Option C (60_10) incorrectly adds bits without carry ripple. Option D (42_10) miscalculates the middle carries.
Tricky
In a multi-bit binary ripple-carry adder, what is the primary architectural limitation that Carry-Lookahead Adders (CLA) are designed to overcome?
Option A is correct. In an n-bit ripple-carry adder, each full adder must wait for the carry-out of the preceding stage, resulting in a cumulative propagation delay proportional to n (O(n) latency). A Carry-Lookahead Adder (CLA) calculates carry-generate (G_i = A_i · B_i) and carry-propagate (P_i = A_i ⊕ B_i) terms concurrently across all bit stages using combinational logic, drastically reducing the delay to O(log n). Option B is incorrect because full adders already utilize XOR gates natively. Option C refers to the Von Neumann bottleneck, not adder circuit latency. Option D is incorrect because fixed-width integer addition produces exact modular arithmetic without floating-point truncation.
Medium

ICSOC-8.7.5.2 Direct Binary Subtraction: Borrow Propagation Dynamics and Algorithmic Verification

Direct Binary Subtraction: Borrow Propagation Dynamics and Algorithmic Verification

Direct binary subtraction evaluates differences between base-2 operands using four foundational positional rules: 0 – 0 = 0, 1 – 0 = 1, 1 – 1 = 0, and 0 – 1 = 1 with a borrow of 1 from the adjacent higher-order column. The fundamental condition 0 – 1 necessitates borrowing a quantum of radix weight 2 (equivalent to 10_2) from the immediate left neighbor, transforming the local calculation into (2 – 1) = 1 while decrementing the lender bit from 1 to 0. When consecutive higher-order columns contain zeros, the borrow operation cascades leftward until encountering the nearest non-zero bit, decomposing each intermediate zero into a 1 and passing the base weight onward across the chain.

Algorithmic verification of binary subtraction relies on the inverse arithmetic identity: Minuend = Subtrahend + Difference. Students and hardware verification units validate computed results by adding the calculated difference back to the subtrahend using standard multi-bit binary addition; the sum must rigorously reconstitute the original minuend without trailing carries. Furthermore, cross-verifying intermediate stages via base-10 decimal conversion safeguards against subtle borrow-propagation slips across multi-zero intervals, reinforcing mathematical fluency in positional radix mechanics.

Easy
When performing direct binary subtraction, what is the result of the operation 0_2 – 1_2 at a single column position?
Option A is correct because 0 is smaller than 1. Borrowing 1 from the adjacent higher-order bit brings a value of 2 (the base radix, 10_2) into the current column. Evaluating (2 – 1) gives a difference of 1, requiring a recorded borrow of 1. Option B is incorrect because 2 – 1 = 1, not 0. Option C represents 1 – 0 = 1. Option D confuses subtraction borrow mechanics with addition carry generation.
Medium
Evaluate the direct binary subtraction: 110010_2 – 011011_2.
Option A is correct. Let us subtract column-by-column from right to left: Column 1 (2^0): 0 – 1 borrows 1 from 2^1 (which becomes 0), computing (2 – 1) = 1. Column 2 (2^1): 0 – 1 borrows across 2^2 and 2^3 from 2^4. The 2^4 bit (1) becomes 0, 2^3 becomes 1, 2^2 becomes 1, and 2^1 becomes 2: (2 – 1) = 1. Column 3 (2^2): 1 – 0 = 1. Column 4 (2^3): 1 – 1 = 0. Column 5 (2^4): 0 – 1 borrows from 2^5 (which becomes 0), yielding (2 – 1) = 1. Column 6 (2^5): 0 – 0 = 0. Result: 010111_2. Verification via decimal: 110010_2 = 32 + 16 + 2 = 50_10; 011011_2 = 16 + 8 + 2 + 1 = 27_10; 50 – 27 = 23_10. In binary: 16 + 4 + 2 + 1 = 23_10 = 010111_2. Option B (29_10), Option C (15_10), and Option D (39_10) represent faulty borrow propagation errors.
Tricky
In the binary subtraction 10000_2 – 00001_2, how do intermediate zero bits behave during borrow propagation?
Option A is correct. When borrowing through a sequence of zeros, the rightmost column needing a borrow (2^0) cannot borrow from 2^1, which cannot borrow from 2^2, etc., until the non-zero bit at 2^4 is reached. The 1 at 2^4 becomes 0 and passes a radix value of 2 to 2^3. Column 2^3 keeps 1 and passes 2 to 2^2, which keeps 1 and passes 2 to 2^1, which keeps 1 and passes 2 to 2^0. Thus, 10000_2 decomposes into 01112 (where 2 is 10_2 in the LSB). Subtracting 1 from the LSB leaves 01111_2 (15_10 = 16_10 – 1_10). Option B is false because 0 cannot lend without borrowing itself. Option C violates binary bit constraints. Option D is false as multi-zero borrowing is completely standard.
Medium

ICSOC-8.7.5.3 Algorithmic Binary Multiplication: Shift-and-Add Methodology and Partial Product Accumulation

Algorithmic Binary Multiplication: Shift-and-Add Methodology and Partial Product Accumulation

Binary multiplication represents an elegant simplification of conventional arithmetic because the base-2 multiplier consists exclusively of binary digits 0 and 1. The fundamental multiplication rules dictate that 0 × 0 = 0, 0 × 1 = 0, 1 × 0 = 0, and 1 × 1 = 1, eliminating the requirement for complex memorized multiplication tables. In paper-and-pencil computation and digital processor architectures alike, multi-bit binary multiplication is executed via the classic ‘shift-and-add’ algorithm. For each bit in the multiplier scanned from right to left (LSB to MSB), an examination is performed: if the multiplier bit is 1, a partial product identical to the multiplicand is generated and left-shifted by the bit’s positional index; if the multiplier bit is 0, the partial product is a row of zeros.

After generating all partial products, their columnar accumulation yields the final product, which requires up to (n + m) bits of precision for an n-bit multiplicand and an m-bit multiplier. In modern central processing units and digital signal processors, hardware multipliers implement optimized variations such as Booth’s Multiplication Algorithm, which groups adjacent multiplier bits to skip consecutive sequences of ones, and Wallace tree networks, which reduce multiple partial product rows simultaneously via carry-save adders rather than slow sequential accumulation.

Easy
In the binary shift-and-add multiplication algorithm, what partial product is generated when the current multiplier bit is 0?
Option A is correct because any value multiplied by 0 equals 0 (0 × Multiplicand = 0). Therefore, when scanning a multiplier bit that is 0, the corresponding partial product is simply a row of zeros aligned at that positional bit weight. Option B is generated only when the multiplier bit is 1. Option C is used in Booth’s algorithm during negative transitions, not standard shift-and-add. Option D violates fundamental multiplication rules.
Medium
Perform binary multiplication of the numbers 1101_2 and 101_2 using the shift-and-add method.
Option A is correct. Multiplicand = 1101_2 (13_10), Multiplier = 101_2 (5_10). Step 1 (LSB bit 0 = 1): 1 × 1101 = 1101. Step 2 (bit 1 = 0): 0 × 1101 shifted left by 1 = 00000. Step 3 (bit 2 = 1): 1 × 1101 shifted left by 2 = 110100. Summing the partial products: 1101 + 00000 + 110100 = 1000001_2. Decimal verification: 13 × 5 = 65_10. In binary, 65_10 = 64 + 1 = 1000001_2. Option B equals 53_10. Option C equals 73_10. Option D equals 121_10.
Tricky
When multiplying an n-bit binary integer by an m-bit binary integer, what is the maximum number of bits required to store the full product without overflow?
Option A is correct. The maximum unsigned value representable in n bits is (2^n – 1) and in m bits is (2^m – 1). Their product is (2^n – 1)(2^m – 1) = 2^(n+m) – 2^n – 2^m + 1 < 2^(n+m) - 1. A number strictly less than 2^(n+m) fits completely within exactly (n + m) bits. For example, multiplying two 4-bit numbers (max 15 × 15 = 225) requires at most 4 + 4 = 8 bits (since 2^8 - 1 = 255). Option B confuses bit-width addition with bit multiplication. Option C applies to addition (which requires max(n, m) + 1 bits), not multiplication. Option D represents the total number of distinct states, not bit length.
Tricky

ICSOC-8.7.5.4 Precision Binary Division: Restoring and Non-Restoring Shift-and-Subtract Algorithms

Precision Binary Division: Restoring and Non-Restoring Shift-and-Subtract Algorithms

Binary long division is the algorithmic process of determining the integer quotient and remainder resulting from the division of a binary dividend by a non-zero binary divisor. Because binary digits are constrained to 0 and 1, the determination of quotient bits is entirely trial-free: at each step, the current partial dividend is compared against the divisor. If the partial dividend is greater than or equal to the divisor, the quotient bit is set to 1, and the divisor is subtracted from the partial dividend; if the partial dividend is smaller, the quotient bit is set to 0, and no subtraction occurs. The next bit of the dividend is then appended (shifted in) to the working remainder, and the cycle repeats iteratively until all dividend bits are exhausted.

At the hardware microarchitecture level, binary division is executed through either restoring or non-restoring division algorithms. In restoring division, the ALU speculatively subtracts the divisor from the partial remainder register; if the result is negative (indicated by a sign bit of 1), the quotient bit is recorded as 0 and the previous remainder value is restored by re-adding the divisor. Non-restoring division eliminates this costly restorative addition by retaining the negative remainder and conditionally adding the divisor in the subsequent iteration, thereby cutting cycle counts and maximizing algorithmic throughput in floating-point and integer math units.

Easy
In binary long division, how is each quotient bit determined when comparing the working partial dividend to the divisor?
Option A is correct. Because binary digits are restricted to 0 and 1, division is strictly binary: either the divisor fits into the current partial dividend (quotient bit = 1, followed by subtraction), or it does not (quotient bit = 0, followed by shifting in the next dividend bit). No trial-and-error estimation is needed. Option B describes decimal long division. Option C and Option D are completely baseless rules.
Medium
Divide the unsigned binary dividend 11110_2 by the divisor 110_2. What are the resulting quotient and remainder?
Option A is correct. Convert to decimal to verify: Dividend = 11110_2 = 16 + 8 + 4 + 2 = 30_10. Divisor = 110_2 = 4 + 2 = 6_10. Evaluating 30 ÷ 6 yields an exact quotient of 5_10 with a remainder of 0. In binary, 5_10 = 101_2, and remainder = 0_2. Binary division steps: 1) Divisor 110 into first 3 bits (111): fits 1 time (quotient 1), remainder 111 – 110 = 001. 2) Bring down 1 -> 011: 110 does not fit (quotient 0), remainder 011. 3) Bring down 0 -> 110: 110 fits 1 time (quotient 1), remainder 110 – 110 = 0. Total quotient = 101_2, remainder = 0_2. Option B (6 R 1), Option C (4 R 3), and Option D (7 R 0) are incorrect divisions.
Tricky
What distinguishes ‘non-restoring’ binary division from ‘restoring’ binary division in CPU arithmetic logic units?
Option A is correct. In restoring division, if subtracting the divisor yields a negative remainder, the ALU must expend an additional clock cycle to ‘restore’ the previous remainder by adding the divisor back. Non-restoring division optimizes this by leaving the negative remainder intact: in the next iteration, after left-shifting, the algorithm adds the divisor instead of subtracting it (since 2×(R – D) + D = 2R – D), eliminating the restorative addition step and increasing execution speed. Option B confuses memory retention with arithmetic algorithms. Option C is false as both are digital algorithms. Option D is incorrect because non-restoring division handles arbitrary remainders accurately.
Easy

ICSOC-8.7.5.5 Radix Complements: Mathematical Foundations of 1’s Complement and 2’s Complement Computations

Radix Complements: Mathematical Foundations of 1's Complement and 2's Complement Computations

Radix complements provide the mathematical foundation that allows digital computers to execute arithmetic subtraction exclusively using addition circuitry, eliminating the need for independent subtractor logic. For an n-bit binary number N, the diminished radix complement—universally designated as the 1’s complement—is mathematically defined as (2^n – 1) – N, which corresponds to bitwise inversion where every 0 is toggled to 1 and every 1 is toggled to 0. The true radix complement—designated as the 2’s complement—is defined as 2^n – N, computed algorithmically by taking the 1’s complement and adding 1 to the least significant bit (LSB): 2’s Complement = (1’s Complement) + 1.

A pivotal computational advantage of 2’s complement over 1’s complement is the resolution of ambiguous zero representations. In 1’s complement arithmetic, an n-bit word produces dual zero states: positive zero (+0, represented as all zeros) and negative zero (-0, represented as all ones), requiring extra control logic and ‘end-around carry’ adjustments during calculations. In contrast, 2’s complement provides a singular, unambiguous zero representation (all zeros) and extends the negative dynamic range by exactly one additional value (-2^(n-1) to +2^(n-1) – 1), making it the universal standard for signed integer representation in modern computing architectures.

Easy
What is the 1’s complement of the 8-bit binary pattern 10110010_2?
Option A is correct. The 1’s complement (diminished radix complement) of a binary number is obtained by bitwise inverting every bit (toggling 1 to 0 and 0 to 1). Inverting each bit of 10110010_2 yields 01001101_2. Option B is the 2’s complement (1’s complement + 1). Option C simply increments the LSB without inverting other bits. Option D incorrectly leaves the first bit unchanged.
Medium
What is the 2’s complement representation of the decimal integer -43 in an 8-bit signed binary register?
Option A is correct. Step 1: Write the 8-bit positive binary magnitude for +43: 43 = 32 + 8 + 2 + 1 = 00101011_2. Step 2: Compute the 1’s complement by inverting all bits: 11010100_2. Step 3: Add 1 to the LSB to find the 2’s complement: 11010100_2 + 1 = 11010101_2. Verification: The MSB has weight -128: -128 + 64 + 16 + 4 + 1 = -128 + 85 = -43. Option B is +43 in binary. Option C is the 1’s complement of +43. Option D is the signed-magnitude representation of -43.
Tricky
Why is 2’s complement representation universally favored over 1’s complement representation for signed integer arithmetic in modern processor hardware?
Option A is correct. In 1’s complement, zero has two distinct representations: +0 (00000000_2) and -0 (11111111_2), which requires special comparison logic and an extra addition step (‘end-around carry’) whenever an addition generates an end-carry. 2’s complement has a single unique zero (00000000_2), discards end-carries cleanly, provides an asymmetric extra negative value (-2^(n-1)), and allows subtraction to use identical adder circuits. Option B is false; both represent approximately the same range (2’s complement gives exactly one extra negative number, not double positive numbers). Option C is false as 1’s complement represents both even and odd numbers. Option D is opposite of reality: 2’s complement unifies addition and subtraction hardware.
Tricky

ICSOC-8.7.5.6 2’s Complement Arithmetic: End-Around Carry Discard, Signed Subtraction, and Hardware Overflow Detection

2's Complement Arithmetic: End-Around Carry Discard, Signed Subtraction, and Hardware Overflow Detection

In digital microprocessors, binary subtraction of the form (A – B) is universally transformed into addition by formulating the expression as A + [2’s complement of B]. When the minuend A is greater than or equal to the subtrahend B (A >= B), the sum generates an end-carry bit beyond the n-bit word boundary; in 2’s complement arithmetic, this end-carry is naturally discarded, and the remaining n bits constitute the true positive difference. Conversely, when the minuend is strictly less than the subtrahend (A < B), no end-carry is generated, signaling that the resulting n-bit sum represents a negative number encoded in 2's complement form; taking the 2's complement of this result and appending a negative sign reveals its true negative magnitude.

In fixed-width signed binary arithmetic, arithmetic overflow occurs when the result of an operation exceeds the representable dynamic range [-2^(n-1), 2^(n-1) – 1]. Hardware arithmetic units detect signed overflow instantaneously using the condition flag V = C_in(MSB) XOR C_out(MSB), meaning overflow transpires if and only if the carry into the sign bit differs from the carry out of the sign bit. Overflow can only occur when adding two operands of identical signs yielding an opposite sign result (e.g., adding two positive numbers produces an apparent negative sum, or adding two negative numbers yields a positive sum), a failure condition that operating systems capture to trigger arithmetic exception interrupts.

Easy
When subtracting two binary numbers using 2’s complement representation via the expression A – B = A + [2’s complement of B], what must be done if an end-carry is generated beyond the fixed word length?
Option A is correct. In 2’s complement subtraction, an end-carry generated out of the most significant bit occurs whenever A >= B. In modular arithmetic modulo 2^n, this carry represents 2^n, which is discarded, leaving the true non-negative difference in the n-bit register. Option B describes 1’s complement subtraction (which requires adding back the end-around carry), not 2’s complement. Option C is absurd. Option D is incorrect because the absence of an end-carry (not its presence) indicates a negative result where A < B.
Medium
Perform the subtraction 00101101_2 – 00010011_2 using 8-bit 2’s complement addition. What is the resulting 8-bit value?
Option A is correct. Minuend A = 00101101_2 (45_10). Subtrahend B = 00010011_2 (19_10). Step 1: Find 2’s complement of B: Invert 00010011 -> 11101100; add 1 -> 11101101_2 (-19_10). Step 2: Add A and [2’s comp of B]: 00101101 + 11101101 = 1 00011010_2. Step 3: Discard the 9th bit end-carry: resulting 8-bit value = 00011010_2. Decimal check: 45 – 19 = 26_10. In binary, 26_10 = 16 + 8 + 2 = 00011010_2. Matches exactly. Option B is 25_10. Option C is -26_10 in 2’s complement. Option D is 34_10.
Tricky
In signed 8-bit 2’s complement arithmetic, adding two numbers produces a carry-in to the sign bit (C_in) of 1 and a carry-out of the sign bit (C_out) of 0. What does this condition indicate?
Option A is correct. In digital hardware arithmetic, the signed overflow flag V is computed by the XOR logic: V = C_in(MSB) ⊕ C_out(MSB). When C_in = 1 and C_out = 0, V = 1 ⊕ 0 = 1, explicitly signaling arithmetic overflow. This occurs, for example, when adding two positive numbers whose sum is >= +128, erroneously flipping the sign bit to 1 (negative). Option B is false because C_in ≠ C_out triggers overflow regardless of whether C_out is 0 or 1. Option C confuses division exceptions with addition overflow. Option D is completely irrelevant.