Codierung
Encoding
Aus der letzten Sitzung: Merkmale eines Computers
Quelle: bpb.de
From the last session: Characteristics of a Computer
→ Computers only work internally with 0 and 1. How can numbers, letters, images be represented this way?
Codierung = Zuordnung von Zeichen eines Zeichenvorrats zu Zeichen eines anderen nach einer festgelegten Vorschrift.
Analogie: menschliche Kommunikation
💭 A* — Gedanken
Alles was ein Mensch meinen oder fühlen kann
🗣️ Codierung = Sprache
Nur vereinbarte Wörter & Gesten sind gültige Codewörter
🔇 b3, b5 = Rauschen
Unbekannte Worte, Missverständnisse — kein gültiges Codewort
Encoding = mapping characters from one character set to another according to a defined rule.
Analogy: human communication
💭 A* — Thoughts
Everything a person can mean or feel
🗣️ Encoding = Language
Only agreed words & gestures are valid codewords
🔇 b3, b5 = Noise
Unknown words, misunderstandings — not a valid codeword
Quelle: stadt.muenchen.de
Drei Codierungen auf einem Bild:
🚶 Fußgängerampel
● Rot = Stehen | ● Grün = Gehen
2 Zustände → 2 Farben
🚗 Autoampel
● Rot | ● Gelb | ● Grün
3 Zustände → 3 Farben
↰ Grüner Abbiegepfeil
Eigenes Schild: Rechtsabbiegen trotz roter Ampel erlaubt
Zusatzinformation → eigenes Symbol
Source: stadt.muenchen.de
Three encodings in one image:
🚶 Pedestrian light
● Red = Stop | ● Green = Walk
2 states → 2 colours
🚗 Car traffic light
● Red | ● Yellow | ● Green
3 states → 3 colours
↰ Green turning arrow
Separate sign: right turn allowed despite red light
Extra information → dedicated symbol
Alle meine Entchen — abcjs (MIT)
Jedes Symbol = codierter Ton:
© Stefan Leitner / hohenlohe.de
Auflösung & Pixel
255 / 87 / 51 = OrangeBildschirmpixel unter Mikroskop — elmar-baumann.de
© Stefan Leitner / hohenlohe.de
Resolution & Pixels
255 / 87 / 51 = OrangeScreen pixels under microscope — elmar-baumann.de
Quelle: verbraucherzentrale-niedersachsen.de
Source: verbraucherzentrale-niedersachsen.de
Aufbau eines QR-Codes
ph-weingarten.de
Structure of a QR code
ph-weingarten.de
Quelle: stadtwerke-solingen.de
Source: stadtwerke-solingen.de
Zahlen werden durch Stellen dargestellt — jede Stelle hat einen Wert.
Quelle: studyflix.de
Im Dezimalsystem zählen wir mit 10 Ziffern (0–9) — im Binärsystem nur mit 2 Ziffern (0 und 1).
Numbers are represented by digits — each position has a value.
Source: studyflix.de
In the decimal system we count with 10 digits (0–9) — in the binary system with only 2 digits (0 and 1).
Jede Stelle ist eine Potenz von 10:
| 10³ | 10² | 10¹ | 10⁰ |
|---|---|---|---|
| 1000 | 100 | 10 | 1 |
| 3 | 7 | 4 | 2 |
Ziffern: 0 1 2 3 4 5 6 7 8 9 — danach beginnt eine neue Stelle
Each position is a power of 10:
| 10³ | 10² | 10¹ | 10⁰ |
|---|---|---|---|
| 1000 | 100 | 10 | 1 |
| 3 | 7 | 4 | 2 |
Digits: 0 1 2 3 4 5 6 7 8 9 — then a new position begins
Dasselbe Prinzip — aber nur 2 Ziffern: 0 und 1
| 2⁷ | 2⁶ | 2⁵ | 2⁴ | 2³ | 2² | 2¹ | 2⁰ |
|---|---|---|---|---|---|---|---|
| 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
Ziffern: nur 0 oder 1 — danach beginnt eine neue Stelle
Quelle: studienkreis.de
Same principle — but only 2 digits: 0 and 1
| 2⁷ | 2⁶ | 2⁵ | 2⁴ | 2³ | 2² | 2¹ | 2⁰ |
|---|---|---|---|---|---|---|---|
| 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
Digits: only 0 or 1 — then a new position begins
Source: studienkreis.de
Welche Stellen sind gesetzt (= 1)? Deren Werte addieren.
| 2⁵ | 2⁴ | 2³ | 2² | 2¹ | 2⁰ |
|---|---|---|---|---|---|
| 32 | 16 | 8 | 4 | 2 | 1 |
| 1 | 0 | 1 | 1 | 0 | 0 |
Quelle: studienkreis.de
Which positions are set (= 1)? Add their values.
| 2⁵ | 2⁴ | 2³ | 2² | 2¹ | 2⁰ |
|---|---|---|---|---|---|
| 32 | 16 | 8 | 4 | 2 | 1 |
| 1 | 0 | 1 | 1 | 0 | 0 |
Source: studienkreis.de
Methode: Wiederholt durch 2 teilen — Reste von unten nach oben lesen
| Division | Ergebnis | Rest |
|---|---|---|
| 44 ÷ 2 | 22 | 0 |
| 22 ÷ 2 | 11 | 0 |
| 11 ÷ 2 | 5 | 1 |
| 5 ÷ 2 | 2 | 1 |
| 2 ÷ 2 | 1 | 0 |
| 1 ÷ 2 | 0 | 1 |
Quelle: studienkreis.de
Divide repeatedly by 2 — read remainders bottom to top
| Division | Result | Rem. |
|---|---|---|
| 44 ÷ 2 | 22 | 0 |
| 22 ÷ 2 | 11 | 0 |
| 11 ÷ 2 | 5 | 1 |
| 5 ÷ 2 | 2 | 1 |
| 2 ÷ 2 | 1 | 0 |
| 1 ÷ 2 | 0 | 1 |
Source: studienkreis.de
1 Bit
Kleinste Informationseinheit
Wert: 0 oder 1
1 Byte = 8 Bit
2⁸ = 256 mögliche Werte (0–255)
z.B. ein ASCII-Zeichen oder ein RGB-Kanal
Größenordnungen:
Ein Foto mit 12 Megapixel × 3 Farbkanäle × 1 Byte = ~36 MB unkomprimiert
1 Bit
Smallest unit of information
Value: 0 or 1
1 Byte = 8 Bits
2⁸ = 256 possible values (0–255)
e.g. one ASCII character or one RGB channel
Orders of magnitude:
A 12 megapixel photo × 3 colour channels × 1 byte = ~36 MB uncompressed
Basis 16 — Ziffern: 0–9 und A–F
| Dezimal | Binär | Hex |
|---|---|---|
| 0 | 0000 | 0 |
| 9 | 1001 | 9 |
| 10 | 1010 | A |
| 15 | 1111 | F |
| 255 | 1111 1111 | FF |
Anwendung: Farben im Web — #FF5733 = R:255, G:87, B:51
Base 16 — digits: 0–9 and A–F
| Decimal | Binary | Hex |
|---|---|---|
| 0 | 0000 | 0 |
| 9 | 1001 | 9 |
| 10 | 1010 | A |
| 15 | 1111 | F |
| 255 | 1111 1111 | FF |
Application: Web colors — #FF5733 = R:255, G:87, B:51
American Standard Code for Information Interchange (1963)
'A' = 65 = 0100 0001₂'a' = 97 = 0110 0001₂' ' = 32 (Leerzeichen)Problem: Keine Umlaute (ä, ö, ü), keine Sonderzeichen anderer Sprachen
American Standard Code for Information Interchange (1963)
'A' = 65 = 0100 0001₂'a' = 97 = 0110 0001₂' ' = 32 (space)Problem: No umlauts (ä, ö, ü), no special characters for other languages
Unicode
UTF-8
Unicode
UTF-8
Wir möchten die reale Welt digital nutzen:
Aber: Ein Computer kennt nur 0 und 1.
Codierung ist die Brücke zwischen unserer Welt und der digitalen Verarbeitung.
© Sergey Nivens / computerwissen.de
We want to use the real world digitally:
But: a computer only knows 0 and 1.
Encoding is the bridge between our world and digital processing.
© Sergey Nivens / computerwissen.de
Überprüfung anhand der vier Kriterien (Schwill, 1993):
Horizontalkriterium
Codierung findet sich in Zahlen, Text, Bild, Ton, QR-Codes, DNA, Brailleschrift …
Vertikalkriterium
Von der Grundschule (Geheimschriften) bis zur Informatik-Forschung (Kryptographie)
Zeitkriterium
Seit der Antike (Hieroglyphen, Morse) bis heute — bleibt relevant
Sinnkriterium
Stellvertretung & Darstellung — im Alltag verankert (Ampel, Noten, Ziffern)
Evaluation using the four criteria (Schwill, 1993):
Horizontal Criterion
Encoding appears in numbers, text, images, audio, QR codes, DNA, Braille …
Vertical Criterion
From primary school (secret codes) to CS research (cryptography)
Temporal Criterion
From antiquity (hieroglyphs, Morse) to today — remains relevant
Significance Criterion
Representation & substitution — rooted in everyday life (traffic lights, notes, digits)
franke-lab.de/lehre/sose/fundidee/reflexion.html?sitzung=3
Artefakte & Reflexion verfassen → HTML kopieren → in Mahara einfügen
franke-lab.de/lehre/sose/fundidee/reflexion.html?sitzung=3
Write artifacts & reflection → copy HTML → paste into Mahara