From 1da5f4a88a84c3a6bd134be5ef244d0f3d14aab5 Mon Sep 17 00:00:00 2001 From: Friedrich Beckmann Date: Tue, 8 Sep 2026 10:09:59 +0200 Subject: initial version --- dt-zahlensysteme.tex | 570 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 570 insertions(+) create mode 100644 dt-zahlensysteme.tex (limited to 'dt-zahlensysteme.tex') diff --git a/dt-zahlensysteme.tex b/dt-zahlensysteme.tex new file mode 100644 index 0000000..0560ee0 --- /dev/null +++ b/dt-zahlensysteme.tex @@ -0,0 +1,570 @@ +% !TEX root = dt-slides-dt.tex + +\section{Zahlenkodierung} + +\begin{frame} +\frametitle{Zahlenkodierung} +\center +\Huge Zahlenkodierung +\end{frame} + +\begin{frame} +\frametitle{Zahlendarstellung - Vorzeichenlose Zahlen - Dualdarstellung} +\begin{columns} +\column[T]{0.3\textwidth} +\begin{tabular}{c|c} +Binärcode & Vorzeichenlos\\\hline +0000 & 0 \\ +0001 & 1 \\ +0010 & 2 \\ +0011 & 3 \\ +0100 & 4 \\ +0101 & 5 \\ +0110 & 6 \\ +0111 & 7 \\ +1000 & 8 \\ +1001 & 9 \\ +1010 & 10 \\ +1011 & 11 \\ +1100 & 12 \\ +1101 & 13 \\ +1110 & 14 \\ +1111 & 15 +\end{tabular} +\column[T]{0.7\textwidth} +\begin{equation*} +z_{n-1} z_{n-2} ... z_{1} z_{0} = z_{n-1} \cdot 2^{n-1} + z_{n-2} \cdot 2^{n-2} + ... + z_{1} \cdot 2^{1} + z_{0} \cdot 2^{0} +\end{equation*} + +\begin{block}{Wertebereich: n-Bit Zahl} +Mit einer n-Bit vorzeichenlosen Zahl lassen sich Zahlen im Bereich 0 bis $2^n-1$ darstellen. +\end{block} +\end{columns} +\end{frame} + +\begin{frame} +\frametitle{Zahlenkreis - Vorzeichenlose Zahlen - Addition} +\begin{tikzpicture}[scale=0.7] +\foreach \dez / \bin / \zahl in +{0/0000/0, 1/0001/1, 2/0010/2, 3/0011/3, 4/0100/4, 5/0101/5, 6/0110/6, 7/0111/7, 8/1000/-8, 9/1001/-7, 10/1010/-6, +11/1011/-5, 12/1100/-4, 13/1101/-3, 14/1110/-2, 15/1111/-1} +{ +\draw (90 - \dez * 22.5:4) node {\bin}; +\draw (90 - \dez * 22.5:3) node {\dez}; +%\draw (90 - \dez * 22.5:5) node {\zahl}; +} +%\draw[->, blue, thick] (90:4.5) arc[start angle = 90, end angle = 90 - 7 * 22.5 , radius=4.5] ; +%\draw[->, red, thick] (90:4.5) arc (90:270:4.5); +\draw[->, green, thick] (90:3.5) arc (90:-250:3.5); +\end{tikzpicture} +\end{frame} + +\begin{frame} +\frametitle{Zahlenkreis - Sign/Magnitude - Betrags- / Vorzeichendarstellung} +\begin{tikzpicture}[scale=0.7] +\foreach \dez / \bin / \zahl in +{0/0000/0, 1/0001/1, 2/0010/2, 3/0011/3, 4/0100/4, 5/0101/5, 6/0110/6, 7/0111/7, 8/1000/-0, 9/1001/-1, 10/1010/-2, +11/1011/-3, 12/1100/-4, 13/1101/-5, 14/1110/-6, 15/1111/-7} +{ +\draw (90 - \dez * 22.5:4) node {\bin}; +\draw (90 - \dez * 22.5:3) node {\dez}; +\draw (90 - \dez * 22.5:5) node {\zahl}; +} +%\draw[->, blue, thick] (90:4.5) arc[start angle = 90, end angle = 90 - 7 * 22.5 , radius=4.5] ; +%\draw[->, red, thick] (90:4.5) arc (90:270:4.5); +\draw[->, green, thick] (90:3.5) arc (90:-250:3.5); +\end{tikzpicture} +\end{frame} + +\begin{frame} +\frametitle{Zahlenkreis - Zweierkomplement} +\begin{columns} +\column[T]{0.5\textwidth} +\begin{tikzpicture}[scale=0.6] +\foreach \dez / \bin / \zahl in +{0/0000/0, 1/0001/1, 2/0010/2, 3/0011/3, 4/0100/4, 5/0101/5, 6/0110/6, 7/0111/7, 8/1000/-8, 9/1001/-7, 10/1010/-6, +11/1011/-5, 12/1100/-4, 13/1101/-3, 14/1110/-2, 15/1111/-1} +{ +\draw (90 - \dez * 22.5:4) node {\bin}; +\draw (90 - \dez * 22.5:3) node {\dez}; +\draw (90 - \dez * 22.5:5) node {\zahl}; +} +\draw[->, blue, thick] (90:4.5) arc[start angle = 90, end angle = 90 - 7 * 22.5 , radius=4.5] ; +\draw[->, red, thick] (90:4.5) arc (90:270:4.5); +\draw[->, green, thick] (90:3.5) arc (90:-250:3.5); +\end{tikzpicture} +\column[T]{0.5\textwidth} +\begin{block}{Wertebereich: n-Bit Zweierkomplementzahl} +Mit einer n-Bit Zahl im Zweierkomplement lassen sich Zahlen im Bereich $-2^{n-1}$ bis $2^{n-1}-1$ darstellen. +\end{block} + +\begin{block}{Kodierung Zahl im Zweierkomplement} +Positive Zahlen wie Vorzeichenlose Zahlen kodiert. Negative Zahlen werden durch das Zweierkomplement des Betrags der Zahl dargestellt. +\end{block} + +\begin{block}{Zweierkomplement} +Das Zweierkomplement einer Zahl x ist $R-x$. R ist $2^n$ für eine n-Bit Zahl. Bei einer 4 Bitzahl ist R = $2^4=16$. Die Zahl -3 wird als 16 - 3 = 13 = 1101 kodiert. +\end{block} + +\end{columns} +\end{frame} + +\begin{frame} +\frametitle{Zweierkomplement - Alternative Berechnung } +\begin{tabular}{rccccccc} +$X = $ & & $x_{n-1}$ & $x_{n-2}$ & ... & $x_1$ & $x_0$ & \\ ++ $\overline{X} = $ & & $\overline{x_{n-1}}$ & $\overline{x_{n-2}}$ & ... & $\overline{x_1}$ & $\overline{x_0}$ & \\\hline + & & 1 & 1 & ... & 1 & 1 & \\ ++1$_D$ & & 0 & 0 & ... & 0 & 1 & \\\hline + & 1 & 0 & 0 & ... & 0 & 0 & $= 2^n = R$ \\ +\end{tabular} + +\begin{align} +& X + \overline{X} + 1_D = 2^n = R \label{equ:alter2} \\ +\iff & \overline{X} + 1_D = R - X = 2er(X) \label{equ:alttwo} +\end{align} + +\begin{block}{Zweierkomplement} +Das Zweierkomplement kann durch die zwei Schritte +\begin{enumerate} +\item Bitweises Invertieren +\item Addieren von +1 +\end{enumerate} +berechnet werden. +\end{block} + +\begin{block}{Umkehrfunktion 2er Komplement } +\begin{equation} +2er(2er(X)) = R - (R - X) = X \Rightarrow 2er^{-1}(X) = 2er(X) \label{equ:umk2} +\end{equation} +\end{block} + + +\end{frame} + +\begin{frame} +\frametitle{Zahlenkreis - Zweierkomplement - Addition} +\begin{tikzpicture}[scale=0.8] +\foreach \dez / \bin / \zahl in +{0/0000/0, 1/0001/1, 2/0010/2, 3/0011/3, 4/0100/4, 5/0101/5, 6/0110/6, 7/0111/7, 8/1000/-8, 9/1001/-7, 10/1010/-6, +11/1011/-5, 12/1100/-4, 13/1101/-3, 14/1110/-2, 15/1111/-1} +{ +\draw (90 - \dez * 22.5:4) node {\bin}; +\draw (90 - \dez * 22.5:3) node {\dez}; +\draw (90 - \dez * 22.5:5) node {\zahl}; +} +\draw[->, blue, thick] (90:4.5) arc[start angle = 90, end angle = 90 - 7 * 22.5 , radius=4.5] ; +\draw[->, red, thick] (90:4.5) arc (90:270:4.5); +\draw[->, green, thick] (90:3.5) arc (90:-250:3.5); +\end{tikzpicture} +\end{frame} + +\begin{frame} +\frametitle{Zahlendarstellung} +\begin{tabular}{c|ccc} +Binärcode & Vorzeichenlos & Sign/Magnitude & Zweierkomplement \\\hline +0000 & 0 & 0 & 0 \\ +0001 & 1 & 1 & 1 \\ +0010 & 2 & 2 & 2 \\ +0011 & 3 & 3 & 3 \\ +0100 & 4 & 4 & 4 \\ +0101 & 5 & 5 & 5 \\ +0110 & 6 & 6 & 6 \\ +0111 & 7 & 7 & 7 \\ +1000 & 8 & -0 & -8 \\ +1001 & 9 & -1 & -7 \\ +1010 & 10 & -2 & -6 \\ +1011 & 11 & -3 & -5 \\ +1100 & 12 & -4 & -4 \\ +1101 & 13 & -5 & -3 \\ +1110 & 14 & -6 & -2 \\ +1111 & 15 & -7 & -1 +\end{tabular} + +\end{frame} + + +\begin{frame} +\frametitle{Hexadezimalzahlen - Basis 16} +\begin{equation} +1F2_H = 1 \cdot 16^2 + 15 \cdot 16^1 + 2 \cdot 16^0 = 1 \cdot 256 + 15 \cdot 16 + 2 \cdot 1 = 498_D \label{equ:hexsys} +\end{equation} + +\vspace{2cm} + +\center +\begin{tikzpicture} +\draw (0,0) node {$498_D = $} ++(right:1.5) node (z2) {0001}; +\draw (z2.east) ++(right:0.001) node[anchor=west] (z1) {1111}; +\draw (z1.east) ++(right:0.001) node[anchor=west] (z0) {$0010_B$}; + +\draw (z2.south) -- ++ (down:1) node[anchor=north] {1}; +\draw (z1.south) -- ++ (down:1) node[anchor=north] {F}; +\draw (z0.south) -- ++ (down:1) node[anchor=north] {$2_H$}; +\end{tikzpicture} +\end{frame} + +\section{Arithmetische Schaltungen} + +\begin{frame} +\frametitle{Arithmetische Schaltungen} +\center +\Huge Arithmetische Schaltungen +\end{frame} + +\subsection{Carry Ripple Adder} + +\begin{frame} +\frametitle{Carry Ripple Adder - Schulrechenmethode} +\begin{columns} +\begin{column}{0.5\textwidth} +\begin{tabular}{rr} +28 = & 11100 \\ ++22 = & 10110 \\\hline +Übertrag (Carry) = & 111000 \\\hline +Summe = & 110010 +\end{tabular} + +\vspace{1cm} + +\begin{tikzpicture} +\draw (0,1.5) +\foreach \i in {3, 2, 1, 0} +{ +++(right:1) node (a\i) {$a_\i$} +}; +\draw (0,1) +\foreach \i in {3, 2, 1, 0} +{ +++(right:1) node (b\i) {$b_\i$} +}; +\draw (0,0.5) +\foreach \i in {3, 2, 1, 0} +{ +++(right:1) node (c\i) {$c_\i$} +}; +\draw (0,-0.25) +\foreach \i in {3, 2, 1, 0} +{ +++(right:1) node (s\i) {$s_\i$} +}; +\draw (0,0.75) -- (5,0.75); +\draw (0,0.25) -- (5,0.25); +\draw[orange, thick] (a0.north west) -- (a0.north east) -- (b0.south east) -- (b0.south west) -- (a0.north west); +\draw[orange, ->, thick] (b0.south west) -- (c1); +\draw[orange, ->, thick] (b0.south) -- (s0); +\draw[magenta, thick] (a1.north west) -- (a1.north east) -- (c1.south east) -- (c1.south west) -- (a1.north west); +\draw[magenta, ->, thick] (c1) -- (c2); +\draw[magenta, ->, thick] (c1) -- (s1); + +\draw (a0.north) -- ++(105:0.5) node[anchor=south west]{Halbaddierer}; +\draw (a1.north west) -- ++(125:1) node[anchor=south ]{Volladdierer}; +\end{tikzpicture} +\end{column} +\begin{column}{0.5\textwidth} +\pause +\begin{block}{Halbaddierer} +\begin{columns} +\begin{column}{0.5\textwidth} +\center +\begin{tabular}{cc|cc} +a & b & c & s \\\hline +0 & 0 & 0 & 0\\ +0 & 1 & 0 & 1\\ +1 & 0 & 0 & 1\\ +1 & 1 & 1 & 0 +\end{tabular} +\end{column} +\begin{column}{0.5\textwidth} +\begin{align} +c &= a \cdot b \nonumber\\ +s &= a \oplus b \nonumber +\end{align} +\end{column} +\end{columns} +\end{block} +\pause +\begin{block}{Volladdierer} +\center +\begin{tabular}{ccc|cc} +a & b & $c_i$ & $c_o$ & s\\\hline +0 & 0 & 0 & 0 & 0 \\ +0 & 0 & 1 & 0 & 1\\ +0 & 1 & 0 & 0 & 1\\ +0 & 1 & 1 & 1 & 0 \\ +1 & 0 & 0 & 0 & 1\\ +1 & 0 & 1 & 1 & 0\\ +1 & 1 & 0 & 1 & 0 \\ +1 & 1 & 1 & 1 & 1\\ +\end{tabular} +\pause +\begin{align} +c_o &= a \cdot (b \oplus c_i) + b \cdot c_i \nonumber \\ +s &= a \oplus b \oplus c_i \nonumber +\end{align} +\end{block} + +\end{column} +\end{columns} + +\end{frame} + +\begin{frame} +\frametitle{Carry Ripple Adder} +\begin{tikzpicture}[circuit logic IEC, circuit ee IEC] +\draw (8,0) node[rectangle, draw, minimum width = 2cm, minimum height = 2cm] (ha) {HA}; +\draw (5,0) node[rectangle, draw, minimum width = 2cm, minimum height = 2cm] (va1) {VA}; +\draw (2,0) node[rectangle, draw, minimum width = 2cm, minimum height = 2cm] (va2) {VA}; +\draw (-1,0) node[rectangle, draw, minimum width = 2cm, minimum height = 2cm] (va3) {VA}; +\draw (ha.north east) ++(left:0.5) -- ++(up:0.5) node [anchor=south] {$b_0$} ++(down:1) node[anchor=south] {$b$}; +\draw (ha.north west) ++(right:0.5) -- ++(up:0.5) node [anchor=south] {$a_0$} ++(down:1) node[anchor=south] {$a$}; +\draw (ha.west) node[anchor=west] {$c_o$}; +\draw (ha.south) node[anchor=south] {$s$} -- ++(down:1) node[anchor=north] {$s_0$}; +\foreach \i in {1,2,3} +{ +\draw (va\i.north east) ++(left:0.5) -- ++(up:0.5) node [anchor=south] {$b_\i$} ++(down:1) node[anchor=south] {$b$}; +\draw (va\i.north west) ++(right:0.5) -- ++(up:0.5) node [anchor=south] {$a_\i$} ++(down:1) node[anchor=south] {$a$}; +\draw (va\i.west) node[anchor=west] {$c_o$}; +\draw (va\i.east) node[anchor=east] {$c_i$}; +\draw (va\i.south) node[anchor=south] {$s$} -- ++(down:1) node[anchor=north] {$s_\i$}; +\draw (va\i.east) -- node[above] {$c_\i$}++(right:1); +} +\end{tikzpicture} +\begin{block}{Komplexität n-Bit Addition: 5n-3 Gatter} +Für eine Addition von zwei n-Bit Zahlen mit dem Carry Ripple Adder werden 5n-3 Gatter benötigt. In Bezug auf die Anzahl der Gatter ist die Addition also in der Klasse der linearen Komplexität. Die Schaltungstiefe wird durch die Überträge (Carry) bestimmt und steigt linear mit n. Daher der Name "Carry-Ripple", weil bei einer Änderung der niederwertigen Bits das Übertragsbit durch die gesamte Schaltung "ripplen" kann. Der Carry Ripple Adder ist die Schaltung mit der kleinsten möglichen Anzahl von Gattern für die Addition. +\end{block} +\end{frame} + +\begin{frame} +\frametitle{Multiplikation mit -1 = 2er Komplement} +\begin{tikzpicture}[circuit logic IEC, circuit ee IEC] +\draw (0,0) node[rectangle, draw, minimum width = 2cm, minimum height = 8cm] (cra) {+}; +\draw (cra.north west) +\foreach \i in {3,2,1,0} +{ +++(down:1) node[anchor=west] (craa\i) {$a_\i$} +}; +\draw (cra.south west) +\foreach \i in {0,1,2,3} +{ +++(up:0.5) node[anchor=west] (crab\i) {$b_\i$} +}; +\draw (cra.east) ++(down:1.25) +\foreach \i in {0,1,2,3} +{ +++(up:0.5) node[anchor=east] (cray\i) {$y_\i$} +}; +\foreach \i in {0,1,2,3} +{ +\draw (cray\i) -- ++(right:1) node[anchor=west] {$y_\i$}; +\draw (craa\i) -- ++(left:1) node[not gate, anchor=output] (inv\i) {}; +\draw (inv\i.input) -- ++(left:1) node[anchor=east] {$x_\i$}; +} +\foreach \i in {1,2,3} +{ +\draw (crab\i) -- ++(left:1) node[anchor=east] {0}; +} +\draw (crab0) -- ++(left:1) node[anchor=east] {1}; +\end{tikzpicture} +\end{frame} + +\begin{frame} +\frametitle{Subtrahierer} +\begin{tikzpicture}[circuit logic IEC, circuit ee IEC] +\draw (8,0) node[rectangle, draw, minimum width = 2cm, minimum height = 2cm] (va0) {VA}; +\draw (5,0) node[rectangle, draw, minimum width = 2cm, minimum height = 2cm] (va1) {VA}; +\draw (2,0) node[rectangle, draw, minimum width = 2cm, minimum height = 2cm] (va2) {VA}; +\draw (-1,0) node[rectangle, draw, minimum width = 2cm, minimum height = 2cm] (va3) {VA}; + +\foreach \i in {0,1,2,3} +{ +\draw (va\i.north east) ++(left:0.5) ++(up:0.1) circle (0.1) ++(up:0.1) -- ++(up:0.3) node [anchor=south] {$b_\i$} ++(down:1) node[anchor=south] {$b$}; +\draw (va\i.north west) ++(right:0.5) -- ++(up:0.5) node [anchor=south] {$a_\i$} ++(down:1) node[anchor=south] {$a$}; +\draw (va\i.west) node[anchor=west] {$c_o$}; +\draw (va\i.east) node[anchor=east] {$c_i$}; +\draw (va\i.south) node[anchor=south] {$s$} -- ++(down:1) node[anchor=north] {$s_\i$}; +\draw (va\i.east) -- node[above] {$c_\i$}++(right:1); +} +\draw (va0.east) ++(right:1) node[anchor=west] {1}; + +\end{tikzpicture} +\end{frame} + +\begin{frame} +\frametitle{Sign Extension - Stellenerweiterung Vorzeichenlos} +\begin{tikzpicture}[circuit logic IEC, circuit ee IEC] +\foreach \i in {4,3,2,1,0} +{ +\draw (0,\i) node[anchor=east] {$x_\i$} -- ++(right:5) node[anchor=west] {$y_\i$}; +} +\foreach \i in {7,6,5} +{ +\draw (4,\i) node[anchor=east] {0} -- ++(right:1) node[anchor=west] {$y_\i$}; +} +\end{tikzpicture} +\end{frame} + +\begin{frame} +\frametitle{Sign Extension - Stellenerweiterung Zweierkomplement} +\begin{tikzpicture}[circuit logic IEC, circuit ee IEC] +\foreach \i in {4,3,2,1,0} +{ +\draw (0,\i) node[anchor=east] {$x_\i$} -- ++(right:5) node[anchor=west] {$y_\i$}; +} +\draw (4,4) node[contact] (c) {}; +\draw (4,5) node[contact] {} -- ++(right:1) {}; +\draw (4,6) node[contact] {} -- ++(right:1) {}; +\draw (5,7) -| (c); +\foreach \i in {7,6,5} +{ +\draw (5,\i) node[anchor=west] {$y_\i$}; +} +\end{tikzpicture} +\end{frame} + +\begin{frame} +\frametitle{Arithmetisches Schieben nach Links - Multiplikation mit Zwei} +\begin{tikzpicture}[circuit logic IEC, circuit ee IEC] +\foreach \i in {0,1,2} +{ +\newcount\mycount +\mycount=\numexpr(\i+1) +\draw (0,\i) node[anchor=east] {$x_\i$} -- ++(right:4-\i) -- ++(1,1) -- ++(right:3) -- ++(right:\i) node[anchor=west] {$y_\the\mycount$}; +} +\draw (8,0) node[anchor=west] {$y_0$} -- ++(left:1) node[anchor=east] {0}; +\draw (0,3) node[anchor=east] {$x_3$}; +\end{tikzpicture} +\end{frame} + +\begin{frame} +\frametitle{Arithmetisches Schieben nach Rechts - Zweierkomplement - Division durch Zwei} +\begin{tikzpicture}[circuit logic IEC, circuit ee IEC] +\foreach \i in {3,2,1} +{ +\newcount\mycount +\mycount=\numexpr(\i-1) +\draw (0,\i) node[anchor=east] {$x_\i$} -- ++(right:1+\i) -- ++(1,-1) -- ++(right:5-\i) node[anchor=west] {$y_\the\mycount$}; +} +\draw (7,3) node[anchor=west] {$y_3$} -- ++(left:3) node[contact] {}; +\draw (0,0) node[anchor=east] {$x_0$}; + +\end{tikzpicture} + +\end{frame} + +\begin{frame} +\frametitle{Arithmetisches Schieben nach Rechts - Vorzeichenlos - Division durch Zwei} +\begin{tikzpicture}[circuit logic IEC, circuit ee IEC] +\foreach \i in {3,2,1} +{ +\newcount\mycount +\mycount=\numexpr(\i-1) +\draw (0,\i) node[anchor=east] {$x_\i$} -- ++(right:1+\i) -- ++(1,-1) -- ++(right:5-\i) node[anchor=west] {$y_\the\mycount$}; +} +\draw (7,3) node[anchor=west] {$y_3$} -- ++(left:1) node[anchor=east] {0}; +\draw (0,0) node[anchor=east] {$x_0$}; + +\end{tikzpicture} +\end{frame} + +\begin{frame} +\frametitle{Zahlenvergleich gegen Konstante} +\begin{block}{Vergleich gegen Konstante als Minterm} +Ein Vergleich einer Zahl auf eine Konstante kann als Minterm implementiert werden. +\end{block} +Beispiel: X ist eine 4 Bit vorzeichenlose Zahl. Wie kann man testen ob $X = 13_D = 1101_B$ ist? +\begin{equation*} +y = f(x) = \left\{ +\begin{array}{ll} +0 & \textrm{wenn}\, x \neq 13\\ +1 & \textrm{wenn}\, x = 13\\ +\end{array} +\right. +\end{equation*} +\begin{center} +\begin{tabular}[t]{cc} +Idee: Minterm, der bei 1101 den Wert '1' hat: & \\ +& +\begin{circuitikz} +\draw node[european and port, number inputs = 4] (a0) {}; +\draw (a0.bin 3) node[notcirc, anchor = right] {}; +\draw (a0.in 1) node[anchor=east] {$x_3$}; +\draw (a0.in 2) node[anchor=east] {$x_2$}; +\draw (a0.in 3) node[anchor=east] {$x_1$}; +\draw (a0.in 4) node[anchor=east] {$x_0$}; +\draw (a0.out) node[anchor=west] {$y$}; +\end{circuitikz} +\end{tabular} +\end{center} +\end{frame} + +\begin{frame} +\frametitle{Zahlenvergleich negative Zahl} +\begin{block}{Test $X < 0$ ist das MSB der Zweierkomplementzahl} +Im Zweierkomplementcode ist die Zahl negativ, wenn das höchstwertige Bit '1' ist. +\end{block} +Beispiel: X ist eine 8 Bit Zahl im Zweierkomplement. Wie kann man testen ob $X < 0_D$ ist? +\begin{equation*} +y = f(x) = \left\{ +\begin{array}{ll} +0 & \textrm{wenn}\, x \geq 0_D\\ +1 & \textrm{wenn}\, x < 0_D\\ +\end{array} +\right. +\end{equation*} +\begin{center} +\begin{tikzpicture} +\draw (0,0) node (x7) {$x_7$} +\foreach \i in {6,5,...,0} { +++(down:0.3) node {$x_\i$} +} +; +\draw (x7.east) -- ++(right:3) node[anchor=west] {$y$}; +\end{tikzpicture} +\end{center} +\end{frame} + + +\begin{frame} +\frametitle{Zahlenvergleich allgemein} +\begin{block}{Test $X < K$ wird auf $... < 0$ zurückgeführt } +Die Ungleichung $X < K$ wird umgeformt bis auf $... < 0$ getestet wird. Dazu ist eine Addition oder Subtraktion notwendig. +\end{block} +Beispiel: X ist eine 4 Bit Zahl im Zweierkomplement. Wie kann man testen ob $X < K$ ist? +\begin{align*} +X &< K & |-K\\ +X - K &< 0 +\end{align*} +\begin{center} +\begin{tikzpicture} +\draw (0,0) node[rectangle, draw, minimum width = 2cm, minimum height = 4cm] (cra) {-}; +\draw (cra.north west) +\foreach \i in {3,2,1,0} +{ +++(down:0.3) node[anchor=west] (craa\i) {$a_\i$} -- +(left:1) node[anchor=east] {$x_\i$} +}; +\draw (cra.south west) +\foreach \i in {0,1,2,3} +{ +++(up:0.3) node[anchor=west] (crab\i) {$b_\i$} -- +(left:1) node[anchor=east] {$k_\i$} +}; +\draw (cra.east) ++(down:0.6) +\foreach \i in {0,1,2,3} +{ +++(up:0.3) node[anchor=east] (cray\i) {$y_\i$} +}; +\draw (cray3.east) -- +(right:1) node[anchor=west] {y}; + +\end{tikzpicture} +\end{center} +\end{frame} + +\begin{frame} +\frametitle{Beispiel: Berechnung des Betrags} +\begin{block}{Beispiel: Berechnung des Betrags} +Entwerfen Sie eine Schaltung, die den Betrag $y=|x|$ berechnet. Verwenden Sie Addierer, Multiplexer und Grundgatter nach Bedarf. Nehmen Sie eine Bitbreite von 8 an. +\end{block} +\vspace{0.9\textheight} + +\end{frame} + -- cgit v1.2.3