Autor Beitrag
abi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 121

Windows 2000
Delphi 5
BeitragVerfasst: Mo 28.06.04 12:16 
Hallo
und schon wieder hab ich ein umwandlungs und adier Problem.

Ich habe ein Hex zahl: "404" in Binär.: 100 0000 0100
Dann habe ich noch einen Integer Wert 32: 10 0000

Jetzt soll des nicht wie man am einfachsten denkt andiert werden.
Also nicht 100 0000 0100
+ 10 0000
=100 0010 0100

Nein so brauche ich das nicht.

Sondern es muss so adiert werden mit verschiebung.
So halt 100 0000 0100
+ 1 0000 0
=101 0000 0100

So muss dann mein ergebnis aussehen.

Mein Problem ist, das ich nicht weiss wie ich meine Zahlen in binär umwandle.
Und wie ich meine zweite zahl verschiebe.

Ach und umwandlen will ichs auch wieder und zwar in einen hex wert.

Des ergenis sollte dann 504 sein.

mfg
abi
P.S.: Link kommt gleich muss ihn erst noch erstellen.

_________________
Die lansamste Schnecke kommt auch irgendwann an.
abi Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 121

Windows 2000
Delphi 5
BeitragVerfasst: Mo 28.06.04 12:28 

_________________
Die lansamste Schnecke kommt auch irgendwann an.
abi Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 121

Windows 2000
Delphi 5
BeitragVerfasst: Mo 28.06.04 12:29 
Falls des jemand andersum schafft, dann erklär mal bitte wie.

Alles was ich versucht habe ging schief.
abi

_________________
Die lansamste Schnecke kommt auch irgendwann an.
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Mo 28.06.04 14:01 
Das verschieben geht mit shl und shr. In der Delphi-Hilfe mehr. Prinzipiell ist das eine Muliplikation oder Division mit 2er-Potenzen.
Z.B. ist 32 shl 1 = 64, denn
ausblenden Quelltext
1:
2:
32 = 00100000
64 = 01000000

Mit ist aber schleierhaft, wie da 504 rauskommen soll. Ich würde ehr denken: 532 (2 Stellen verschoben, 32+2^2=128, 404+128= 532).
Ich hoffe, das verwirrt nicht.

_________________
We are, we were and will not be.
abi Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 121

Windows 2000
Delphi 5
BeitragVerfasst: Mo 28.06.04 14:08 
Hallo Gausi
ich habs rausgefunden.

Du musst es erst mal mit 8 multiplizieren, dann kommt 256 raus.

Jetzt des ganze in Hex umrechnen gibt 100h und dieses dann + 404h ergibt 504h.

mfg
abi

_________________
Die lansamste Schnecke kommt auch irgendwann an.
orakel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 92

Win XP

BeitragVerfasst: Mo 28.06.04 14:15 
Zitat:

www.delphipraxis.net...aerzahl+adieren.html



Crossposting!!Wird in Foren nicht so gerne gesehen :!:

_________________
Nicht verzagen, orakel fragen!
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Mo 28.06.04 14:16 
ahso...die 404 und 504 sind Hex-Zahlen...Tja nu, vielleicht würde es mir helfen, wenn ich beim nächsten Mal genauer lese, bevor ich was nicht verstehe. Egal, Hauptsache, es klappt jetzt bei dir.

_________________
We are, we were and will not be.