--- theme: metropolis header-includes: | \usepackage{tabu} \let\tightlist\relax --- ## \faIcon{comments} Wiederholung: Informationsübertragung \hfill 1/3 Nimm Stellung zu folgender Aussage: \vspace{0.4cm} > Information kann übertragen werden, wenn sie durch Codierung in eine feste Darstellung gebracht wurde. \pause \boldred{Falsch!} Wir brauchen auch ein \boldred{Medium}. ## \faIcon{comments} Wiederholung: Informationsübertragung \hfill 2/3 {.t} Nimm Stellung zu folgender Aussage: ::: {.columns align=center} :::: {.column width=60%} \vspace{-0.4cm} > Der Zaubertrick funktioniert für eine beliebige Anzahl an Karten. \only<2->{ \boldred{Jein!} Die Zahl der ausgelegten Karten ist egal nicht die Anzahl der umgedrehten. } :::: :::: {.column width=40%} \begin{tikzpicture}[card/.style={minimum width=1cm, minimum height=1.75cm, rounded corners=3pt, draw}] \node[card, fill=red] (c11) {}; \node[card, fill=black, right=0.1cm of c11] (c12) {}; \node[card, fill=red, right=0.1cm of c12] (c13) {}; \node[card, fill=red, right=0.1cm of c13] (c14) {}; \node[card, fill=red, below=0.1cm of c11] (c21) {}; \node[card, fill=black, right=0.1cm of c21] (c22) {}; \node[card, fill=black, right=0.1cm of c22] (c23) {}; \node[card, fill=black, right=0.1cm of c23] (c24) {}; \node[card, fill=red, below=0.1cm of c21] (c31) {}; \node[card, fill=black, right=0.1cm of c31] (c32) {}; \node[card, fill=red, right=0.1cm of c32] (c33) {}; \node[card, fill=red, right=0.1cm of c33] (c34) {}; \node[card, fill=blue, below=0.1cm of c31] (c41) {}; \node[card, fill=red, right=0.1cm of c41] (c42) {}; \node[card, fill=red, right=0.1cm of c42] (c43) {}; \node[card, fill=red, right=0.1cm of c43] (c44) {}; \end{tikzpicture} :::: ::: ## \faIcon{comments} Wiederholung: Informationsübertragung \hfill 3/3 Nimm Stellung zu folgender Aussage: \hspace{0.4cm} > Da die IBAN eine Prüfziffer hat, können keine zwei IBANs mit gleicher Prüfziffer existieren. \pause \boldred{Falsch!} Es gibt viel mehr IBANs als Prüfziffern. Vielfache von 97 haben die selbe Prüfziffer. ## Informationen digital speichern und weitergeben {.t} **Bekannt:** Informationen brauchen eine physische Repräsentation, ein \boldred{Medium}, zur Übertragung \pause ### Wie machen das Computer? \vspace{0.2cm} ::: {.columns align=center} :::: {.column width=50%} ![](img/Copyrighted/ram.png) :::: :::: {.column width=50%} ![](img/Copyrighted/wire.png) :::: ::: \pause Wir brauchen ein \boldred{binäres} Signal (**an** oder **aus**). ## \faIcon{pencil-alt} Die kleinste Einheit von Information {.t} \vspace{1.5cm} \begin{merke} Die kleinste Einheit der digitalen Information nennt man \boldred{Bit}. \pause Ein \boldred{Bit} kann genau `1` oder `0` speichern. \pause Bit ist ein \textit{Kunstwort} aus \textbf{binary} und \textbf{digit}. \end{merke} \vfill \only<4>{ Schon ganz ok aber wir wollen doch mehr speichern. } ## Zurück zur Codierung Um beliebige Informationen mit mehreren \boldred{Bits} darzustellen, müssen diese erst in Zahlen umgewandelt werden. Diese Zahlen werden dann in einem Zahlensystem codiert das nur mit **Einsen** und **Nullen** auskommt: Das \boldred{Binärsystem}. \vspace{0.5cm} \pause ### Digitale Informationen `Information -> Codiert als Zahl -> Zahl codiert im Binärsystem` ## \faIcon{pencil-alt} Stellenwertsysteme {.t} \begin{merke} Das Binärsystem ist, genau wie das uns bekannte Dezimalsystem, ein \boldred{Stellenwertsystem}. \pause In einem \boldred{Stellenwertsystem} hängt der Wert einer Ziffer von ihrer Position und der \boldred{Basis} des Zahlensystems ab. \end{merke} \vspace{0.5cm} \only<3->{ \textbf{\large Dezimalsystem (Basis 10)} \begin{tabular}{l c c c c} \textcolor{purple}{Dezimalzahl:} & \textcolor{purple}{4} & \textcolor{purple}{3} & \textcolor{purple}{0} & \textcolor{purple}{3} \\ \textcolor{green!70!black}{Stellenwert:} & \textcolor{green!70!black}{$10^3$} & \textcolor{green!70!black}{$10^2$} & \textcolor{green!70!black}{$10^1$} & \textcolor{green!70!black}{$10^0$} \\ \end{tabular} } \only<4->{ \vspace{0.5cm} $\textcolor{purple}{4} \cdot \textcolor{green!70!black}{1000} + \textcolor{purple}{3} \cdot \textcolor{green!70!black}{100} + \textcolor{purple}{0} \cdot \textcolor{green!70!black}{10} + \textcolor{purple}{3} \cdot \textcolor{green!70!black}{1} = 4303_{10}$ } ## \faIcon{pencil-alt} Binärsystem Das Binärsystem ist ein Stellenwertsystem mit \boldred{Basis 2}. \begin{tabu}{l c c c c} \rowfont{\color{purple}}Binärzahl: & 1 & 0 & 0 & 1 \\ \rowfont{\color{green!70!black}}Stellenwert: & $2^3$ & $2^2$ & $2^1$ & $2^0$ \\ \end{tabu} \vspace{0.5cm} ### Binärzahl $\rightarrow$ Dezimalzahl $1001_2 = \textcolor{purple}{1} \cdot \textcolor{green!70!black}{8} + \textcolor{purple}{0} \cdot \textcolor{green!70!black}{4} + \textcolor{purple}{0} \cdot \textcolor{green!70!black}{2} + \textcolor{purple}{1} \cdot \textcolor{green!70!black}{1} = 9_{10}$ \pause \vspace{0.5cm} ### Dezimalzahl $\rightarrow$ Binärzahl $22_{10} = \textcolor{purple}{1} \cdot \textcolor{green!70!black}{16} + \textcolor{purple}{0} \cdot \textcolor{green!70!black}{8} + \textcolor{purple}{1} \cdot \textcolor{green!70!black}{4} + \textcolor{purple}{1} \cdot \textcolor{green!70!black}{2} + \textcolor{purple}{0} \cdot \textcolor{green!70!black}{1} = 10110_2$ ## Peinliche Informatiker*innen Witze ::: {.columns align=center} :::: {.column width=50% align=center} \centering \huge $1 + 1 = 10$ :::: :::: {.column width=50%} ![](img/Copyrighted/tshirt_joke.png) :::: ::: ## \faIcon{pencil-alt} Arbeitsauftrag: Zahlenumwandlung \hfill 7 min \Large 1. Rechne die Dezimalzahl $42_{10}$ in ihre Binärdarstellung um 2. Rechne die Binärzahl $110101_2$ in ihre Dezimaldarstellung um ## \faIcon{pencil-alt} Arbeitsauftrag - Lösung \Large 1. $42_{10} = 1\cdot 32 + 0 \cdot 16 + 1\cdot 8 + 0 \cdot 4 + 1 \cdot 2 + 0 \cdot 1 = 10101_2$ \pause 2. $110101_2 = 1 \cdot 32 + 1 \cdot 16 + 0 \cdot 8 + 1 \cdot 4 + 0 \cdot 2 + 1 \cdot 1 = 53$ ## \large Wie stellen wir mehrere Binärzahlen in Folge dar? \pause Ähnliches Problem wie beim Morse code! Wo endet die eine wo beginnt die Andere? \pause ### Lösung Wir stellen Binärzahlen immer in festen Blöcken dar. \faIcon{pencil-alt} Der kleinste solche Block besteht aus 8 Bit und wird \pause \boldred{Byte} genannt ## \faIcon{pencil-alt} Arbeitsauftrag: BYTE_MAX \hfill 7 min \large Begründe was die größte Dezimalzahl ist, die eine Byte darstellen kann. \pause ### Lösung >* Jedes Bit kann zwei Werte darstellen (1 und 0). >* Jedes Zusätzliche Bit verdoppelt die Anzahl der darstellbaren Zahlen >* Ein Byte (8 Bits) kann deshalb $2^8$ Zahlen darstellen >* Die kleinste ist Null >* Die größte ist $2^8 - 1 = 255$ ## Was ist mit den Menschen? Die Binärdarstellung wird durch die Funktionsweise von Computern erzwungen. Für den Menschen ist sie aber schwer verständlich und sehr lang. Deshalb existiert das \boldred{Hexadezimalzahl} als Mittelweg. ## \faIcon{pencil-alt} Hexadezimalsystem {.t} \begin{merke} Das Hexadezimalzahl ist ein \textbf{Stellenwertsystem} mit der \boldred{Basis 16}. \pause Dabei bilden die \textbf{11.} bis zur \textbf{16.} Ziffer die Großbuchstaben \boldred{A} bis \boldred{F}. \end{merke} \only<3->{ \begin{tabu}{l c c c} \rowfont{\color{purple}}Hex-Zahl: & D & 2 & E \\ \rowfont{\color{green!70!black}}Stellenwert: & $16^2$ & $16^1$ & $16^0$ \\ \end{tabu} } \only<4->{ $D2E_{16} = \textcolor{purple}{13} \cdot \textcolor{green!70!black}{256} + \textcolor{purple}{2} \cdot \textcolor{green!70!black}{16} + \textcolor{purple}{14} \cdot \textcolor{green!70!black}{1} = 3374_{10}$ } \only<5->{ \textbf{\large Vorteil} Ein Byte ist mit zwei Ziffern darstellbar. \begin{tabular}{c c} $\textcolor{blue}{1110}\textcolor{orange}{0111}_2$ & $\textcolor{blue}{2}\textcolor{orange}{A}_{16}$ \\ = & = \\ $\textcolor{blue}{E}\textcolor{orange}{7}_{16}$ & $\textcolor{blue}{0010}\textcolor{orange}{1010}_2$ \\ \end{tabular} } ## Arbeitsauftrag: Text im Dezimalsystem (ASCII) Um Text in Zahlen umzuwandeln gibt es den ASCII-Standard. Dieser definiert Tabellen zur Umwandlung von Zeichen in Zahlen. 1. Öffne eine ASCII-Tabelle aus dem Internet 2. Wandle die Zahlenfolgen in Text um * $00111010_2$, $00101101_2$, $01110000_2$ * $3A_{16}$, $27_{16}$, $7D_{16}$ 3. ASCII verwendet nur 7 Bit. Wie viele Zeichen lassen sich damit darstellen? 4. Kodiere das Wort "Hallo" im Dezimalsystem