493
Bearbeitungen
Ngb (Diskussion | Beiträge) Keine Bearbeitungszusammenfassung |
Ngb (Diskussion | Beiträge) Keine Bearbeitungszusammenfassung |
||
| Zeile 1: | Zeile 1: | ||
Betrachte erneut 4-Bit Dualzahlen. Mit vier Bit können insgesamt 16 Zahlen dargestellt werden. Von <math>(0000)_2 = (0)_{10}</math> bis <math>(1111)_2 = (15)_{10}</math>. | |||
Was aber, wenn wir auch negative Zahlen im Binärsystem darstellen wollen? | Was aber, wenn wir auch negative Zahlen im Binärsystem darstellen wollen? | ||
| Zeile 10: | Zeile 10: | ||
== Die Vorzeichenbit-Darstellung == | == Die Vorzeichenbit-Darstellung == | ||
Bei n-Bit Zahlen in ''Vorzeichenbit-Darstellung'' (VzD) wird das höchstwertige Bit (das Bit ganz links für die Potenz <math>2^{n−1}</math>) für das Vorzeichen reserviert (<code>0</code>=positiv, <code>1</code>=negativ). Es verbleiben also <math>n − 1</math> Bit für die Darstellung des Zahlwertes. | |||
{| width="80%" | |||
|'''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> | |||
|} | |||
Für die VzD ist also von Bedeutung, wie viele Bit eine Dualzahl maximal haben kann. | |||
{{Aufgabe:Start}} | |||
Forme die '''6-Bit VzD Zahlen''' ins Dezimalsystem um: | |||
# <math>(010101)_2</math> | |||
# <math>(101010)_2</math> | |||
# <math>(000000)_2</math> | |||
# <math>(100000)_2</math> | |||
{{Aufgabe:End}} | |||
{{Lösung:Start}} | |||
Forme die '''6-Bit VzD Zahlen''' ins Dezimalsystem um: | |||
# <math>(010101)_2 = (21)_{10}</math> | |||
# <math>(101010)_2 = (-10)_{10}</math> | |||
# <math>(000000)_2 = (0)_{10}</math> | |||
# <math>(100000)_2 = (-0)_{10}</math> (!!) | |||
{{Lösung:End}} | |||
== Das Zweierkomplement == | == Das Zweierkomplement == | ||