Chapter 1: Number Systems & Arithmetic - Complete Study Notes

NotebookLM Ingestion Compilation

This merged document contains all 3 study notes for Chapter 1: Number Systems & Arithmetic from ECE 2103 Digital Electronics (Sharif Sir).


Related Concepts: 1.02 Base Complements & Subtraction Mechanics | 1.03 Signed Representation, Overflow & Two’s Complement | 2.01 BCD & Weighted Digital Codes

1.01 Positional Number Systems & Base Conversions

Overview

Digital systems process data in binary (), but human interfaces use decimal (). Practical interfaces also employ octal () and hexadecimal () to condense long binary strings. Understanding the mathematical foundations of positional notation and conversion algorithms is essential for digital logic design.


1. Positional Radix Number Theory

A positional number system represents numbers by a sequence of digits. The position of each digit determines its weight, which is a power of the base (or radix) .

1.1 The Positional Expansion Theorem

Mathematical Definition

Any real number in a base positional number system is represented as:

Where:

  • The dot () represents the radix point (decimal point in base 10, binary point in base 2).
  • is the number of integer digits, and is the number of fractional digits.
  • The digits/coefficients must satisfy:

The quantitative decimal value of is obtained by summing each digit multiplied by its position weight:

For example, in decimal (), digits are . In binary (), digits are strictly . In hexadecimal (), the alphanumeric symbols represent decimal values .


2. Base Conversion Mechanics (Pencil-and-Paper Tutorial)

When converting numbers from decimal (base 10) to a target base , the conversion is split into two distinct algorithms for the integer and fractional components.

graph TD
    Input["Decimal Number N"] --> Split{"Split into Components"}
    
    Split -->|Integer Component| IntDiv["Successive Division by Base r"]
    IntDiv --> CollectRem["Collect Remainders Bottom to Top (MSB to LSB)"]
    
    Split -->|Fractional Component| FracMult["Successive Multiplication by Base r"]
    FracMult --> CollectInt["Collect Integer Carries Top to Bottom (MSB to LSB)"]
    
    CollectRem & CollectInt --> Combine["Combined Base-r Result"]

Part A: Converting Integers (Successive Division Method)

To convert a decimal integer to a target base :

  1. Divide the decimal number by the target radix .
  2. Record the remainder (this becomes a digit of the result, starting from the Least Significant Bit (LSB)).
  3. Take the integer quotient and divide it by again.
  4. Repeat this process until the quotient becomes . The last remainder recorded is the Most Significant Bit (MSB).

Successive Division: Convert to Binary ()

Reading the remainders from bottom to top:


Part B: Converting Fractions (Successive Multiplication Method)

To convert a decimal fraction to a target base :

  1. Multiply the decimal fraction by the target radix .
  2. Record the integer part of the resulting product (this becomes a digit of the result, starting from the MSB).
  3. Take the remaining fractional part of the product and multiply it by again.
  4. Repeat until the fractional part becomes (or until you reach the desired bit precision).

Successive Multiplication: Convert to Binary ()

Reading the integer parts from top to bottom:

Part C: Comparison of Conversion Methods

FeatureSuccessive Division MethodSuccessive Multiplication Method
Target ComponentInteger part of the decimal number.Fractional part of the decimal number.
Mathematical OperationDivision by target base .Multiplication by target base .
Result ExtractionRemainders of the division.Integer carries of the multiplication.
Reading DirectionBottom-to-top (First remainder is LSB, last is MSB).Top-to-bottom (First carry is MSB, last is LSB).
Termination ConditionInteger quotient becomes .Fractional part becomes or desired precision is met.

3. Unsigned Binary Multiplication & Division (Paper-and-Pencil Methodology)

Foundational Concept (Outside Direct PYQ Scope)

Paper-and-pencil binary multiplication and division are foundational mathematical topics required to understand computer arithmetic circuits (like multipliers and dividers in Chapter 5), but they are rarely tested directly as calculation problems in ECE 2103 examinations.

To build arithmetic logic units (ALUs), we must understand paper-and-pencil multiplication and division for unsigned binary numbers.

3.1 Unsigned Binary Multiplication (Shift-and-Add)

Unsigned binary multiplication is identical to decimal long multiplication. Since binary digits are only 0 or 1, the partial products are either equal to the multiplicand or zero.

Step-by-Step Algorithm:

  1. Align the multiplicand and multiplier.
  2. For each bit of the multiplier, from Least Significant Bit (LSB) to Most Significant Bit (MSB):
    • If the multiplier bit is 1, write down the multiplicand as a partial product, shifted left according to the bit position.
    • If the multiplier bit is 0, write down a row of 0s (or simply shift the next partial product).
  3. Sum all the partial products using binary addition rules.

Unsigned Multiplication: Multiply by () [Syllabus Week 2]

       1011   (Multiplicand = 11_10)
     x 0101   (Multiplier = 5_10)
     ------
       1011   (Partial Product 1: Multiplier LSB = 1)
      0000.   (Partial Product 2: Multiplier bit = 0, shifted left)
     1011..   (Partial Product 3: Multiplier bit = 1, shifted left 2)
    0000...   (Partial Product 4: Multiplier MSB = 0, shifted left 3)
    -------
    0110111   (Binary Sum = 110111_2 = 32 + 16 + 4 + 2 + 1 = 55_10)

3.2 Unsigned Binary Division (Long Division Method)

Binary division is performed using long division, matching the decimal algorithm.

Step-by-Step Algorithm:

  1. Align the divisor with the most significant bits of the dividend.
  2. Compare the divisor with the selected portion of the dividend:
    • If the dividend portion divisor, write 1 in the quotient, subtract the divisor from the dividend portion, and bring down the next bit of the dividend.
    • If the dividend portion divisor, write 0 in the quotient and bring down the next bit.
  3. Repeat this process until all bits of the dividend are processed.

Unsigned Division: Divide by () [Syllabus Week 2]

           000101   (Quotient = 5_10)
        _________
  1001 | 101101   (Dividend = 45_10)
       - 1001     (1011 >= 1001 -> Quotient bit = 1, subtract 1001)
       ------
         00100    (Remainder is 0010; bring down next dividend bit '0')
       - 00000    (0100 < 1001 -> Quotient bit = 0, subtract 0)
       -------
          1001    (Remainder is 0100; bring down next dividend bit '1')
        - 1001    (1001 >= 1001 -> Quotient bit = 1, subtract 1001)
        ------
          0000    (Remainder = 0; Stop. Result: Quotient = 101_2 = 5_10)

4. Conversions to “Unusual” Radices (Base-3, Base-4, Base-7, Base-12) [PYQ: 2015, 2016, 2022, 2023, 2025]

Examiners test your grasp of these algorithms by asking for conversions to non-standard bases.

Worked Exam Problem: Convert to Base-4 and Base-7 (2015, 2016, 2022, 2023, 2025 - 10 Marks)

A. Converting to Base-4

  1. Integer Part () Successive Division by 4:
    • Integer Result:
  2. Fractional Part () Successive Multiplication by 4:
    • (repeats infinitely…)
    • Fractional Result:

B. Converting to Base-7

  1. Integer Part () Successive Division by 7:
    • Integer Result:
  2. Fractional Part () Successive Multiplication by 7:
    • Fractional Result:


5. Hexadecimal Fractions to Binary, Octal, and Decimal

When converting between bases that are powers of 2 (, , ), we can convert directly by grouping bits.

graph LR
    Hex["Hexadecimal (Base-16)"] -->|4-Bit Expansion| Binary["Binary (Base-2)"]
    Binary -->|3-Bit Grouping| Octal["Octal (Base-8)"]
    Hex -->|Polynomial Expansion| Decimal["Decimal (Base-10)"]

Worked Exam Problem: Convert to Binary, Octal, and Decimal (2015, 2017, 2025 - 12 Marks)

Step 1: Hexadecimal to Binary (4-Bit Expansion)

Replace each hex digit with its 4-bit binary equivalent:

Step 2: Binary to Octal (3-Bit Grouping)

Group the binary bits in clusters of 3, starting from the binary point:

  • Integer (Left of point):
  • Fractional (Right of point):

Step 3: Hexadecimal to Decimal (Polynomial Expansion)

Evaluate the polynomial weight sum:


6. Fractional Binary Equivalence & Precision Analysis

Converting decimal fractions to binary can introduce precision errors (quantization noise), as non-terminating binary fractions must be truncated.

Worked Exam Problem: The "2/3" Fraction Analysis (2021, 2023 - 13 Marks)

Question: Calculate the binary equivalent of out to eight places. Convert the binary result back to decimal. How close is the result to ? Convert the binary result into hexadecimal, then convert that result to decimal. Is the answer the same?

Solution:

Part A: Binary Equivalent of to 8 Places

Decimal

  • (pattern repeats)

Part B: Convert back to Decimal & Find Error

  • Precision Loss (Error):

Part C: Convert to Hexadecimal & Back to Decimal

  • Group binary bits:
  • Convert Hex to Decimal:
  • Conclusion: The decimal values are identical. Grouping bits between base 2 and base 16 does not introduce any additional precision loss.

Past Year Questions (PYQs)

  • [PYQ 2015, 2016, 2022, 2023, 2025]: Convert integer/fraction decimals to base-3, base-4, base-7, base-12. (08 Marks)
  • [PYQ 2015, 2017, 2025]: Convert hexadecimal with fractions to decimal, octal, binary. (08 Marks)
  • [PYQ 2021, 2023]: Calculate binary equivalent of fractions (e.g., out to 8 places) and verify accuracy through hex conversions. (13 Marks)

Related Concepts: 1.01 Positional Number Systems & Base Conversions | 1.03 Signed Representation, Overflow & Two’s Complement | 2.04 Error Control, Parity Generators & Checkers

1.02 Base Complements & Subtraction Mechanics

Overview

Complement arithmetic allows computers to perform subtraction using only addition operations. This eliminates the need for physical subtraction circuitry, enabling a single binary adder circuit to perform both addition and subtraction.


1. Formal Mathematics of Complements

For a positive number represented in base with an integer part of digits and a fractional part of digits, we define two types of complements.

1.1 The Radix Complement (‘s Complement)

The radix complement (‘s complement) of a number in base is defined as:

Binary Implementation (2’s Complement, )

For a binary integer (), the 2’s complement of an -bit number is .

  • Pencil-and-Paper Shortcut: Starting from the right (Least Significant Bit), copy all bits up to and including the first 1 exactly as they are. Then, invert all remaining bits to the left.

Decimal Implementation (10’s Complement, )

For a decimal integer, the 10’s complement of is .

  • Pencil-and-Paper Shortcut: Subtract the least significant non-zero digit from , and subtract all other digits to the left from .

1.2 The Diminished Radix Complement (‘s Complement)

The diminished radix complement (‘s complement) of a number in base is defined as:

If has no fractional part (), this simplifies to:

Binary Implementation (1’s Complement, )

For a binary integer, the 1’s complement of is .

  • Pencil-and-Paper Shortcut: Simply invert every single bit of the binary string ( and ).

Decimal Implementation (9’s Complement, )

For a decimal integer, the 9’s complement of is .

  • Pencil-and-Paper Shortcut: Subtract each individual digit of the number from .

Key Relationship:

(For integers, ‘s complement is simply the ‘s complement plus 1 in the LSB position).

1.3 Comparison Table: Radix vs. Diminished Radix Complements

FeatureRadix (‘s) ComplementDiminished Radix (‘s) Complement
Mathematical Definition (for )
Binary Equivalent ()2’s Complement1’s Complement
Decimal Equivalent ()10’s Complement9’s Complement
Mathematical Relationship’s Complement = ‘s Complement ‘s Complement = ‘s Complement
Ease of Hardware GenerationSlightly harder (requires an addition step in the LSB).Very easy (requires only inverting NOT gates in binary).
Complement Subtraction Carry ActionDiscard overflow carry ().End-Around Carry (add back to LSB).
Representation of Zero in BinarySingle unique representation (0000...0000).Two representations: (0000...0000) and (1111...1111).

2. Complement Subtraction Mechanics [PYQ: 2015, 2018, 2019]

Subtraction of two numbers in base is executed by adding the complement of the subtrahend () to the minuend ().

graph TD
    Sub["Subtraction M - N"] --> Pad["Pad M and N to Equal n-bit Length"]
    Pad --> Method{"Complement Type"}
    
    Method -->|r's Complement| Add2["Add M + r's Comp of N"]
    Add2 --> Carry2{"Carry generated?"}
    Carry2 -->|Yes: Cout = 1| Disc2["Discard Carry. Result is Positive & in True Form"]
    Carry2 -->|No: Cout = 0| Neg2["Result is Negative. Take r's Comp of Sum & add - sign"]
    
    Method -->|r-1's Complement| Add1["Add M + (r-1)'s Comp of N"]
    Add1 --> Carry1{"Carry generated?"}
    Carry1 -->|Yes: Cout = 1| EndAround["End-Around Carry: Add 1 to LSB. Result is Positive"]
    Carry1 -->|No: Cout = 0| Neg1["Result is Negative. Take (r-1)'s Comp of Sum & add - sign"]

2.1 The Radix (‘s) Complement Subtraction Algorithm ()

  1. Pad both and with leading zeros so they have the exact same number of digits ().
  2. Compute the ‘s complement of the subtrahend : .
  3. Add the minuend to the complement:
  4. Check the end carry digit ():
    • Case A: Carry Occurs () Discard the carry (which mathematically subtracts ). The remaining digits represent the correct positive result:
    • Case B: No Carry Occurs () The result is negative. The remaining digits are in their complemented form. To find the true magnitude, take the ‘s complement of the sum and prefix a negative sign:

3. Step-by-Step Worked Subtraction Examples

Worked Exam Problem: Perform using 1's and 2's Complement, verified by Straight Subtraction (2015, 2018, 2019 - 10 Marks)

Let (Decimal ) and (Decimal ).

  • Step 1: Pad to equal bit length (8-bit standard):

Part A: Subtraction Using 2’s Complement (‘s complement)

  1. Find 2’s Complement of ():
    • 1’s complement =
    • Add 1 to LSB =
  2. Add :
       00000100   (M)
     + 11010000   (2's Comp of N)
     ----------
     0 11010100   (Sum)
     ^
     Cout = 0 (No Carry)
  3. Evaluate Result: Since , the result is negative and in 2’s complement form.
    • Take 2’s complement of the sum ():
      • 1’s complement =
      • Add 1 to LSB = (Decimal )
    • Prefix a negative sign.

Part B: Subtraction Using 1’s Complement (‘s complement)

  1. Find 1’s Complement of ():
    • 1’s complement =
  2. Add :
       00000100   (M)
     + 11001111   (1's Comp of N)
     ----------
     0 11010011   (Sum)
     ^
     Cout = 0 (No Carry)
  3. Evaluate Result: Since , the result is negative.
    • Take 1’s complement of the sum ():
      • 1’s complement = (Decimal )
    • Prefix a negative sign.

Part C: Verification by Straight Subtraction

Since , perform using direct binary borrowing:

   110000   (N = 48)
 - 000100   (M = 4)
 --------
   101100   (Result = 44)

Prefixing the negative sign and padding to 8-bit gives . All three methods yield the same result.


4. Non-Decimal Base Multiplication

Performing arithmetic directly in bases other than decimal is a common exam requirement.

Worked Exam Problem: Multiply directly in Base-8 without converting to Decimal (2024 - 08 Marks)

Direct Octal Arithmetic Rule: Perform standard digit-by-digit multiplication. When a product exceeds the base (), divide the product by . Record the remainder in the current column and carry the quotient to the next column.

Step-by-Step Multiplication:

  1. Multiply by (first digit of multiplier):

    • with remainder (write 3, carry 4)
    • with remainder (write 2, carry 4)
    • with remainder (write 3, carry 2)
    • First partial product:
  2. Multiply by (second digit of multiplier):

    • Second partial product: (shifted left one space)
  3. Multiply by (third digit of multiplier):

    • with remainder (write 1, carry 6)
    • with remainder (write 0, carry 6)
    • with remainder (write 3, carry 3)
    • Third partial product: (shifted left two spaces)
  4. Add the partial products in Base-8:

       002323
       003670
     + 330100
     --------
       336313
    • Column 0:
    • Column 1: rem (write 1, carry 1)
    • Column 2: rem (write 3, carry 1)
    • Column 3: (write 6)
    • Column 4: (write 3)
    • Column 5: (write 3)


Past Year Questions (PYQs)

  • [PYQ 2015, 2018, 2019]: Subtraction of binary numbers using 1’s and 2’s complement verified by straight subtraction. (10 Marks)
  • [PYQ 2024]: Direct non-decimal multiplication in base-6 and base-8 without converting to decimal. (08 Marks)

Related Concepts: 1.01 Positional Number Systems & Base Conversions | 1.02 Base Complements & Subtraction Mechanics | 2.04 Error Control, Parity Generators & Checkers

1.03 Signed Representation, Overflow & Two’s Complement

Overview

Since physical circuits cannot store ”+” or ”-” characters, digital systems dedicate the Most Significant Bit (MSB) of a binary word to represent the sign of a number. The universally adopted system for signed integers in computers is the Signed 2’s Complement System.


1. Signed Binary Representations and Ranges

For an -bit binary word, there are three primary methods used to represent positive and negative integers:

  1. Sign-Magnitude Representation:
    • The MSB is the sign bit (0 for positive, 1 for negative). The remaining bits store the absolute magnitude in true binary.
    • Range:
    • Drawback: Dual representation of zero ( is and is ), complicating arithmetic logic.
  2. Signed 1’s Complement Representation:
    • Positive numbers are identical to Sign-Magnitude. Negative numbers are created by inverting all bits of their positive counterpart.
    • Range:
    • Drawback: Still has dual representation of zero ( and ).
  3. Signed 2’s Complement Representation:
    • Positive numbers are written in true binary. Negative numbers are represented by taking the 2’s complement of the positive value.
    • Range:
    • Benefit: Unique representation of zero (). It also enables subtraction to be handled by standard addition hardware.

1.1 Differences between Signed Binary Representations

FeatureSign-MagnitudeSigned 1’s ComplementSigned 2’s Complement
MSB Function0 = Positive, 1 = Negative0 = Positive, 1 = Negative0 = Positive, 1 = Negative
Negative Number FormulaKeep MSB as 1, copy magnitude.Invert all bits of positive number.Take 2’s complement of positive number.
Range (for bits)
Representation of ZeroTwo representations: (00...0) and (10...0).Two representations: (00...0) and (11...1).One unique representation: 00...0 (always positive).
Hardware Arithmetic ComplexityHigh. Requires separate addition and subtraction circuits.Medium. Requires “End-Around Carry” addition.Low. Single standard adder handles both addition and subtraction.
Mathematical AsymmetrySymmetric range around zero.Symmetric range around zero.Asymmetric. Has one extra negative number (e.g. in 4-bit).

1.2 Comparison Table ( bits)

DecimalSign-MagnitudeSigned 1’s ComplementSigned 2’s Complement
(not defined)
(not defined)(not defined)

2. 8-Bit Signed Arithmetic Tutorial

In an 8-bit computer register, addition and subtraction are handled by standard 8-bit binary addition. Any carry beyond the 8th bit (the sign bit) is discarded.

graph TD
    Start["Setup Operands"] --> trueA["Write +A in 8-bit Binary"]
    Start --> trueB["Write +B in 8-bit Binary"]
    
    trueA --> compA["Find -A (2's Comp of +A)"]
    trueB --> compB["Find -B (2's Comp of +B)"]
    
    compA & compB & trueA & trueB --> Add["Perform 8-bit Addition Only"]
    Add --> Carry{"Carry-out from 8th bit?"}
    Carry -->|Yes| Disc["Discard Carry"]
    Carry -->|No| Check["Check MSB of Sum"]
    Disc --> Check
    
    Check -->|MSB = 0| Pos["Result is Positive. Convert directly to Decimal"]
    Check -->|MSB = 1| Neg["Result is Negative. Take 2's Comp to read magnitude"]

Worked Exam Problem: Signed Arithmetic (2016, 2017, 2020, 2021, 2025 - 13 Marks)

Question: Given the decimal integers and , show how an 8-bit signed 2’s complement computer computes: (i) , (ii) , (iii) , and (iv) .

Step 0: Pre-Calculation Operand Setup

Convert the absolute magnitudes to 8-bit binary first:

Now write the four required operands:


Case 1: Compute (i.e. )

00011001_2 \quad (+25) \\ + 11010000_2 \quad (-48) \\ \hline 11101001_2 \end{array}$$ - **Evaluation:** No end carry. The MSB is `1`, indicating a **negative** result. - **Find Magnitude:** Take the 2's complement of the sum $11101001_2$: - 1's complement = $00010110_2$ - Add 1 = $00010111_2$ ($23_{10}$) - **Answer:** **$-23_{10}$** (Verifies: $25 - 48 = -23$). --- ### Case 2: Compute $A - B$ (i.e. $25 - (-48) = 25 + 48$) $$\begin{array}{r@{\quad}l} 00011001_2 \quad (+25) \\ + 00110000_2 \quad (+48) \\ \hline 01001001_2 \end{array}$$ - **Evaluation:** No end carry. The MSB is `0`, indicating a **positive** result. - **Find Magnitude:** Convert $01001001_2$ directly to decimal: - $64 + 8 + 1 = 73_{10}$ - **Answer:** **$+73_{10}$** (Verifies: $25 - (-48) = 73$). --- ### Case 3: Compute $B - A$ (i.e. $-48 - 25$) $$\begin{array}{r@{\quad}l} 11010000_2 \quad (-48) \\ + 11100111_2 \quad (-25) \\ \hline (1)\ 10110111_2 \end{array}$$ - **Evaluation:** Carry occurs. Discard the end carry. - The remaining 8-bit sum is $10110111_2$. MSB is `1` $\implies$ **negative** result. - **Find Magnitude:** Take the 2's complement of $10110111_2$: - 1's complement = $01001000_2$ - Add 1 = $01001001_2$ ($73_{10}$) - **Answer:** **$-73_{10}$** (Verifies: $-48 - 25 = -73$). --- ### Case 4: Compute $-A - B$ (i.e. $-25 - (-48) = -25 + 48$) $$\begin{array}{r@{\quad}l} 11100111_2 \quad (-25) \\ + 00110000_2 \quad (+48) \\ \hline (1)\ 00010111_2 \end{array}$$ - **Evaluation:** Carry occurs. Discard the end carry. - The remaining 8-bit sum is $00010111_2$. MSB is `0` $\implies$ **positive** result. - **Find Magnitude:** Convert $00010111_2$ directly to decimal: - $16 + 4 + 2 + 1 = 23_{10}$ - **Answer:** **$+23_{10}$** (Verifies: $-25 + 48 = 23$). $\blacksquare$ --- ## 3. Arithmetic Overflow Conditions When performing signed arithmetic inside an $n$-bit register, the result can exceed the range of representable values: $$\text{Range Limit} = [-2^{n-1} \quad \text{to} \quad +2^{n-1}-1]$$ For an 8-bit system, the valid range is **$-128$ to $+127$**. If the true algebraic sum of two numbers falls outside this range, an **Overflow** occurs, corrupting the sign bit. ### 3.1 The Sign-Bit Check Rule Overflow can **only** occur when adding numbers of the same sign: 1. Adding two positive numbers yields a negative result: $$(+X) + (+Y) = -Z \implies \text{Overflow}$$ 2. Adding two negative numbers yields a positive result: $$(-X) + (-Y) = +Z \implies \text{Overflow}$$ > [!note] Why Adding Opposite Signs Never Causes Overflow > > For an 8-bit signed system: > - Positive range: $[0 \text{ to } +127]$ > - Negative range: $[-1 \text{ to } -128]$ > > Adding any positive $X$ to negative $Y$ is bounded by: > - Maximum possible sum: $(+127) + (-1) = +126$ (safe) > - Minimum possible sum: $(0) + (-128) = -128$ (safe) > > The result is mathematically guaranteed to remain within the $[-128, +127]$ range, making overflow physically impossible. --- ### 3.2 ALU Hardware Detection of Overflow In the Arithmetic Logic Unit (ALU), overflow ($V$) is detected instantly by monitoring the carry bits of the sign-bit position (MSB) using a single XOR gate. ```text Carry-out (Cout) ^ | +----+----+ | XOR Gate| ----> Overflow Flag (V = Cin ⊕ Cout) +----+----+ ^ | Operand A --->| (MSB) Operand B --->| (MSB) | ^ Carry-in (Cin) ``` > [!abstract] Overflow Logic Equation > > > $$\mathbf{V = C_{in} \oplus C_{out}}$$ > > Where: > * $C_{in}$ is the carry-in to the sign-bit position (the carry from column $n-2$ to the MSB column $n-1$). > * $C_{out}$ is the carry-out from the sign-bit position (the final carry beyond the MSB). > * If **$V = 1$**, the sign of the result is incorrect, indicating an **Overflow Error**. --- > [!question] Past Year Questions (PYQs) > > * **[PYQ 2016, 2017, 2020, 2021, 2025]:** Given decimal integers $A = 25$ and $B = -48$, show how an 8-bit two's complement computer computes $A+B$, $A-B$, $B-A$, and $-A-B$. (13 Marks) ---