396
Bearbeitungen
Ngb (Diskussion | Beiträge) Keine Bearbeitungszusammenfassung |
Ngb (Diskussion | Beiträge) |
||
(2 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
Zeile 15: | Zeile 15: | ||
{| width="80%" | {| width="80%" | ||
|'''4-Bit VzD''': || <math>(0011)_2 = (3)_{10}</math> || <math>(1011)_2 = (-3)_{10}</math> | |'''4-Bit VzD''': || <math>(0011)_2 = (3)_{10}</math> || <math>(1011)_2 = (-3)_{10}</math> | ||
|- | |||
|'''7-Bit VzD''': || <math>(0001000)_2 = (8)_{10}</math> || <math>(1001000)_2 = (-8)_{10}</math> | |'''7-Bit VzD''': || <math>(0001000)_2 = (8)_{10}</math> || <math>(1001000)_2 = (-8)_{10}</math> | ||
|} | |} | ||
Zeile 45: | Zeile 46: | ||
== Das Zweierkomplement == | == Das Zweierkomplement == | ||
Das ''Einerkomplement'' einer Dualzahl wird gebildet, indem die Zahl invertiert wird (aus <code>0</code> wird <code>1</code> und aus <code>1</code> wird <code>0</code>). | Das ''Einerkomplement'' einer Dualzahl wird gebildet, indem die Zahl invertiert wird (aus <code>0</code> wird <code>1</code> und aus <code>1</code> wird <code>0</code>). Für das ''Zweierkomplement'' (ZkD) wird zum Einerkomplement noch <code>1</code> addiert. | ||
Bei Dualzahlen in ''Zweierkomplement-Darstellung'' (ZkD) sind negative Zahlen das Zweierkomplement ihrer positiven Gegenzahl. Das hat den zusätzlichen Vorteil, dass das höchstwertige Bit auch hier anzeigt, ob die Zahl positiv (<code>0</code>) oder negativ (<code>1</code>) ist. | |||
{| width="80%" | {| width="80%" | ||
| || Binärzahl || Einerkomplement || Zweierkomplement | | || Binärzahl || Einerkomplement || Zweierkomplement | ||
|- | |||
|'''4-Bit ZkD''': || <math>(0011)_2 = (3)_{10}</math> || <math>(1100)_2</math> || <math>(1101)_2 = (-3)_{10}</math> | |'''4-Bit ZkD''': || <math>(0011)_2 = (3)_{10}</math> || <math>(1100)_2</math> || <math>(1101)_2 = (-3)_{10}</math> | ||
|- | |||
|'''7-Bit ZkD''': || <math>(0001000)_2 = (8)_{10}</math> || <math>(1110111)_2</math> || <math>(1111000)_2 = (-8)_{10}</math> | |'''7-Bit ZkD''': || <math>(0001000)_2 = (8)_{10}</math> || <math>(1110111)_2</math> || <math>(1111000)_2 = (-8)_{10}</math> | ||
|} | |} | ||
{{Aufgabe:Start}} | |||
Bilde das Zweierkomplement der 4-Bit Zahlen (denke an den Überlauf). Notiere darunter auch jeweils die Dezimalzahldarstellung der Zahlen. | |||
# <math>(0001)_2</math> | |||
# <math>(1010)_2</math> | |||
# <math>(0000)_2</math> | |||
{{Aufgabe:End}} | |||
{{Aufgabe:Start}} | |||
Berechne die Summe der '''4-Bit ZkD Zahlen''' und kontrolliere die Rechnung im Dezimalsystem. | |||
# <math>(0001)_2 + (1110)_2</math> | |||
# <math>(1001)_2 + (0111)_2</math> | |||
# <math>(1011)_2 + (1000)_2</math> | |||
# <math>(1011)_2 + (0000)_2</math> | |||
{{Aufgabe:End}} | |||
{{Aufgabe:Start}} | |||
Vergleiche die beiden Darstellungen für negative Dualzahlen miteinander. Wo liegen Vorteile, was sind Probleme der Darstellungen? | |||
{{Aufgabe:End}} |