Stellenwertsystemen, Konvertierungen und Genauigkeit

Positional notations, Conversation and Precision.

Notizen auf Vorlesung [RA]

Stellenwertsystemen, Begriffe und Schreibweise

$B$ : Basis des Stellenwertsystems, oft auch Radix $r$ genannt

$Z=z_{n-1}…z_{1}z_{0},z_{-1}…z_{-m}$ :

  • eine Zahl wird als Vektor von Ziffern dargestellt
  • eine Komma markiert ggf. die Einer-Stelle

$z_i$ eine Ziffer, in konventionellen Stellenwertsystemen gilt: $z_i \in [0,B)$

Der Zahlenwert berechnet sich zu:

$Z = \sum_{i=-m}^{n-1}B^i\cdot z_i$

Basis Name bsp. Form ProgramSprache
2 Binär,Dual (Binary) $1011,1101_2$
8 Oktal (octal) &123_8& 0123
10 Dezimal (decimal) $10,23_{10}$
16 Hexadezimal (hexadecimal) $AFF_{16}$ 0xAFF

Konvertierungen

Dual, Oktal, Hexadezimal —> Dezimal

Konvertierung mit Zahlenwertberechnung

$Z = \sum_{i=-m}^{n-1}B^i\cdot z_i$

Bsp.

$AFF.1B_{16} = 10\cdot 16^2 + 15\cdot 16^1 + 15\cdot 16^0 + 1\cdot 16^{-1} + 11\cdot 16^{-2}$

$1001.0110_2 = 1\cdot 2^3 + 1\cdot 2^0 + 1\cdot 2^{-2} + 1\cdot 2^{-3}=(8+1+0.25+0.125)_{10}$

Dezimal —> Dual, Oktal, Hexadezimal

ganzzahliger Teil

teilen durch B, nehme den Rest als Ziffer, rechts nach links.

Bsp. 75(dez) zu Dual

75 % 2 = 37 Rest 1
37 % 2 = 18 Rest 1
18 % 2 = 9  Rest 0
9  % 2 = 4  Rest 1
4  % 2 = 2  Rest 0
2  % 2 = 1  Rest 0
1  % 2 = 0  Rest 1

75(dez) = 1001011(Dual)

Bsp. 75(dez) zu Hex:

75 % 16 = 4 Rest 11 (B)
4 % 16 = 0 Rest 4

75(dez) = 0x4B

Bsp. 75(dez) zu Oktal:

75 % 8 = 9 Rest 3
9  % 8 = 1 Rest 1
1  % 8 = 0 Rest 1

75(dez) = 0113

gebrochene Zahl

multiplizieren B, nehme Den ganzzahliger Teil als Ziffer, links nach rechts.

Bsp. 0.741(dez) zu Dual:

0.741 x 2 = 1.482  Rund 1
0.482 x 2 = 0.964  Rund 0
0.964 x 2 = 1.928  Rund 1
0.928 x 2 = 1.856  Rund 1
0.856 x 2 = 1.712  Rund 1
0.712 x 2 = 1.424  Rund 1
0.424 x 2 = 0.848  Rund 0
0.848 x 2 = 1.696  Rund 1
0.696 x 2 = 1.392  Rund 1
...
...
...
usw.

0.741(dez) = 0.101111011...(Dual)

Bsp. 0.742(dez) zu Hex:

0.742 x 16 = 11.872 Rund 11 (B)
0.872 x 16 = 13.952 Rund 13 (D)
0.952 x 16 = 15.232 Rund 15 (F)
0.232 x 16 = 3.712  Rund 3
...
...
usw.

0.742(dez) = 0.BDF3...(hex)

Dual, Oktal und Hex

  • Jede 3 Ziffern Dual = 1 Ziffer Okt
  • Jede 4 Ziffern Dual = 1 Ziffer Hex
Bin Oct Dec Hex
0000 000 0 0x0
0001 001 1 0x1
0010 002 2 0x2
0011 003 3 0x3
0100 004 4 0x4
0101 005 5 0x5
0110 006 6 0x6
0111 007 7 0x7
1000 010 8 0x8
1001 011 9 0x9
1010 012 10 0xA
1011 013 11 0xB
1100 014 12 0xC
1101 015 13 0xD
1110 018 14 0xE
1111 017 15 0xF

z.B.1001110.1001101(Dual) Zu Okt und Hex

Zusatz Null               Zusatz Null
|                                 |
0 1 0 0  1 1 1 0 . 1 0 0 1  1 0 1 0
-------  -------   -------  -------
8        E       . 9        A


1001110.1001101(Dual) = 8E.9A (Hex)


Zusatz Null                   Zusatz Null
| |                                   | |
0 0 1  0 0 1  1 1 0 . 1 0 0  1 1 0  1 0 0
-----  -----  -----   -----  -----  -----
1      1      6     . 4      6      4

1001110.1001101(Dual) = 116.464(Okt)

z.B. F1A3.B5(hex) zu Dual und Okt

F    1    A    3    . B    5
---- ---- ---- ----   ---- ----
1111 0001 1010 0011 . 1011 0101

F1A3.B5(hex) = 1111000110100011.10110101(dual)


001 111 000 110 100 011 . 101 101 010
--- --- --- --- --- ---   --- --- ---
1   7   0   6   4   3   . 5   5   2

F1A3.B5(hex) = 170643.552(okt)

Genauigkeit

Wie viele Stellen nach denm Komma sollten berechnet bei der Konvertierung?

Für jeden Dezimal Ziffer gibt es 10 möglichkeiten, d.h. $log_2{10}$ bits informationen. Deshalb bedeutet einer Dez-Ziffer ungefähr 3.322 Ziffern Binär.

z.B. bei Konvertierung von 35,274729(dez) in Dualsystem.

Es gibt 6 Stellen nach dem Komma.

$$ log_{2}{10^6} = 6log_2{10} \approx 19.932 $$

d.h. mindestens sind 20 Stellen (nach dem Komma) zu rechnen, um die Genauigkeit der Wertangabe zu erhalten.

edited 20.04.2024
created 11.11.2020
EOF

[+] click to leave a comment [+]
the comment system on this blog works via email. The button
below will generate a mailto: link based on this page's url 
and invoke your email client - please edit the comment there!

[optional] even better, encrypt the email with my public key

- don't modify the subject field
- specify a nickname, otherwise your comment will be shown as   
  anonymous
- your email address will not be disclosed
- you agree that the comment is to be made public.
- to take down a comment, send the request via email.

>> SEND COMMENT <<




2024-05-04 ♦ Live A/V Show in Rochester via Paloma Kop ♦ RSS Feed April 21, 2024
Live audiovisual show in Rochester, NY... Read more↗

2024-04-21 via mrshll.com April 21, 2024
Well, it's real now. We are moving to Nashville. I came to Boston in 2009 to study computer science and stayed for the career opportunities, loud and then quiet music scene (where I met Alejandra), and the wonderful friends we've made over the ye…

Āyen, Pōm, and ITGBTW Remixes via Helvetica Blanc April 19, 2024
The newest Wormsong entry, Āyen, marks the beginning of a little interactivity in the narrative. After each entry goes live, I'll post a choice on Patreon. All patrons can vote, and their choices will allow us to explore the Realms together! I don'…

Generated by openring from webring