========================= Half Adder and Full Adder [TOC] ========================= 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 ============== ---- VIDEO ------------------------------ https://www.youtube.com/embed/oEvRAAXbQP8 ----------------------------------------- Errata ====== In the video (at about 10:00) I forgot the subscript $b$ in the general notation for the positional notation. This should be ---- LATEX --------------------------------------------------------------------- (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 ---- LATEX --------------------------------------------------------------------- 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 ---- LATEX --------------------------------------------------------------------- 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. ---- LATEX --------------------------------------------------------------------- (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 ---- LATEX --------------------------------------------------------------------- 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. :links: half adder -> https://en.wikipedia.org/wiki/Adder_(electronics)#Half_adder full adder -> https://en.wikipedia.org/wiki/Adder_(electronics)#Full_adder numerals -> https://en.wikipedia.org/wiki/Numeral_system numbers -> https://en.wikipedia.org/wiki/Number positional numeral system -> https://en.wikipedia.org/wiki/Positional_notation non-negative integers -> https://en.wikipedia.org/wiki/Natural_number :navigate: up -> doc:index next -> doc:session01/page04 back -> doc:session01/page02