Prof. Dr. Thorsten Jungmann (last updated 2026-11-02)

Relates to DET-01 Introduction to the module and its content

Task

Calculate the following sums and differences of unsigned binary numbers. The numbers have 4 bits in a) and d) and 8 bits in the other subtasks. Check each result by converting the numbers into the decimal number system, and state for each addition whether a carry out occurs.

Addition: a) , b) , c)

Subtraction: d) , e) , f)

◀️ Back to the task


Solution

Given

Given explicitly:

  • a) , unsigned, 4 bits
  • b) , unsigned, 8 bits
  • c) , unsigned, 8 bits
  • d) , unsigned, 4 bits
  • e) , unsigned, 8 bits
  • f) , unsigned, 8 bits

Known:

  • Addition of one position (DET-01): , , , i.e. sum 0 and carry 1
  • With a carry from the position on the right, a position may have to add three ones: , i.e. sum 1 and carry 1
  • Carry out (DET-01): a carry out of the most significant position; the result then needs one more bit
  • Subtraction (DET-01): if the digit of the minuend is smaller than that of the subtrahend, the position borrows a 1 from the next higher position; in the current position, this 1 is worth two:
  • Range of an unsigned number with bits (DET-01): , e.g. 0 to 15 with 4 bits and 0 to 255 with 8 bits

Required

a) to c) the sums, each with the statement whether a carry out occurs
d) to f) the differences

Addition

The numbers are written one below the other and added position by position, starting with the least significant bit. The row ‘carry’ shows the carry that each position receives from the position on its right.

a)

From the right: in the first position, , i.e. sum 0 and carry 1; in the second position, , i.e. sum 0 and carry 1; in the third position, , i.e. sum 1 and carry 1; in the fourth position, .

The most significant position produces no carry: no carry out occurs, and the sum fits into 4 bits.

Check: , , and ✓

b)

The most significant position also produces a carry: a carry out occurs. The sum needs 9 bits; with 8 bits, the result would not fit.

Check: , , and ✓ The sum exceeds 255, the largest unsigned number with 8 bits – hence the carry out.

c)

The most significant position produces no carry: no carry out occurs, and the sum fits into 8 bits.

Check: , , and ✓

Subtraction

The subtrahend is subtracted from the minuend position by position, starting with the least significant bit. The row ‘borrow’ marks each position that lends a 1 to the position on its right: there, the 1 is worth two, and the lending position itself loses 1.

Two school methods for borrowing

The row ‘borrow’ follows the decomposition method (German: Entbündelungsverfahren): each marked position reduces the digit of its minuend by 1. If you learnt the equal-additions method (German: Ergänzungsverfahren) at school, add the 1 to the digit of the subtrahend in the same position instead. Both methods mark the same positions and give the same difference, because reducing the minuend by 1 and increasing the subtrahend by 1 change the difference in the same way.

d)

From the right: in the first position, is not possible, so the position borrows from the second: ; the second position has lent a 1 and now holds only 0: ; in the third position, ; in the fourth position, .

Check: , , and ✓

e)

Check: , , and ✓

f)

Check: , , and ✓

Borrowing across zeros

If the position that has to lend holds a 0, it first borrows from the next higher position itself. A borrow can therefore run across several positions, as in f) – exactly as in the decimal system, where borrows across three zeros.