Half Adder and Full Adder

With a so called half adder you can add two bits, and with a full adder there bits. We will use this as a building block for adding bit pattern with 4 and 8 bits in the next section.

You will also face some theoretical background. For example, the difference between numerals and numbers and the positional numeral system for non-negative integers (also called unsigned integers).

Video tutorial

Errata

In the video (at about 10:00) I forgot the subscript \(b\) in the general notation for the positional notation. This should be

\[(a_{n-1}, \dots, a_0)_b:=\sum\limits_{k=0}^{n-1} a_k \cdot b^k\]

Supplement

Just some notes on notational conventions used for writing numerals. Furthermore some remarks that the half and full adder are actually vector valued Boolean functions (and I did not define that previously).

Conventions for the positional system

I am sure that for the decimal system you are used to the convention

\[1234 := (1, 2, 3, 4)_{10}\]

So you don't explicitly specify the base \(b=10\), you do not separate the digits with commas and you don't put the digit inside some parenthesis.

For other frequently used bases there are also conventions common that simplify the notation:

  • For hexadecimal numerals, i.e. base \(b=16\), the notation

    \[0x1234 := (1, 2, 3, 4)_{16}\]

    is common. So you use the prefix \(0x\) to distinguish it.

  • For binary numerals it is common to avoid the commas, e.g.

    \[(1011)_2 := (1,0,1,1)_{2}\]

    and if it is clear from the context you can also just write down the bit pattern \(1011\).

Vector valued Boolean functions

Both, the half adder and the full adder, implement vector valued Boolean functions. The half adder is of type \(f: B^2 \to B^2\) and the full adder of type \(f: B^3 \to B^2\).

It actually no big deal, in general you consider vector valued function component wise and then re-use the definition for scalar valued functions. The definition

\[f: B^n \to B^m, x \mapsto f(x) = \left(\begin{array}{c} f_1(x) \\ \vdots \\ f_m(x) \end{array}\right)\]

falls back to the definition of functions \(f_1, \dots, f_m\) with \(f_k : B^n \to B\) for \(k=1, \dots, m\).

So for example, the half adder consists of \(f_1\) which is an XOR function and \(f_2\) is an AND function.