Binary division: I'm stuck at the moment. Can someone take a look and explain?
Hello,
It is about the following task:
25 / 5 = 5 In the binary system this would look like this
11001 ÷ 101 = 101
So the result and the binary numbers are available.
Now to the procedure:
– first write down the divisor and the dividend:
11001 : 101 =
- Now check from left to right whether a part of the dividend is equal to or greater than the divisor and then put a 1 before everything zero
1 < 101 = 0
11 < 101 = 0
110 > 110 = 1
11001 : 101 = 001
101
_____
001
From top to bottom we subtract (110 – 101 = 1 (6-5=1))
Now we check when the number under the fraction bar is greater than or equal to the divisor
1 < 101 = 0
10 < 101 = 0
101 = 101 = 1
11001 : 101 = 001001
101
_______
00101
00101
_______
0
So now I have a wrong result.
1001 in binary results in the number 9 in decimal.
And that can't be true, the result would have to be the binary number 101.
Can someone please give me a correction in this regard and explain how it is calculated exactly and where the error lies.
In dem Schritt, in dem die 1 übrig bleibt, darf keine 0 an das Zwischenergebnis angehängt werden.
Also:
Zum Vergleich im Dezimalsystem:
und nicht
was ???
25 / 5 = 5 oder
Ich habe nur ein Beispiel im Dezimalsystem angegeben, bei dem mit deiner Methode der gleiche Fehler auftreten würde. Bei 25 / 5 wäre das nicht der Fall.
Also das vorgehen ist wie folgt ?!?
Erst prüfen bis wann eine zahl des dividenden = oder größer dem divisor ist dann eine 1 im Ergebnis eintragen.
da der rest unter dem strich nicht größer oder gleich dem divisor sein kann nächste zahl vom dividenden herunterholen und prüfen ob größer oder gliech divisor ist.
in dem Fall 10 < 101 = 0
wenn der letztze scritt wiederholt wird so steht unten links nun eine 101
welche = oder größer ist also im Ergenis 1 hinschrieben.
Also ergebnis 101
ist das Vorgehen soweit richtig?
Ja. Genau gleich wie im Dezimalsystem.
Na klar. Wenn du im Dezimalsystem eine Ziffer ungleich Null in das Ergebnis schreibst und die nächste Ziffer von oben an den Rest anfügst, hängst du ja auch nicht noch eine zusätzliche Null an das Ergebnis an.
alsokommt mir irgendiwe nicht so vor wie im Dezimalsystem