AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren

Rätselhafte Binärcodierung

Offene Frage von "Torphyr"
Ein Thema von Torphyr · begonnen am 28. Mai 2004 · letzter Beitrag vom 1. Jun 2004
Antwort Antwort
Torphyr

Registriert seit: 7. Nov 2003
Ort: Filderstadt
8 Beiträge
 
#1

Rätselhafte Binärcodierung

  Alt 28. Mai 2004, 16:30
Hallo zusammen,
ich hab hier ein kleines Binärrätsel. Eine Zahl ist in vier Byte kodiert, und ich komme nicht dahinter, wie die Codierung aufgebaut ist. Hier eine Zahlenreihe als Beispiel:

Byte 1: 00000000
Byte 2: 00000000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***0***

Byte 1: 00111111
Byte 2: 10000000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***1***

Byte 1: 01000000
Byte 2: 00000000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***2***

Byte 1: 01000000
Byte 2: 01000000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***3***

Byte 1: 01000000
Byte 2: 10000000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***4***

Byte 1: 01000000
Byte 2: 10100000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***5***

Byte 1: 01000000
Byte 2: 11000000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***6***

Byte 1: 01000000
Byte 2: 11100000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***7***

Byte 1: 01000001
Byte 2: 00000000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***8***

Byte 1: 01000001
Byte 2: 00010000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***9***

Byte 1: 01000001
Byte 2: 00100000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***10***

Byte 1: 01000001
Byte 2: 00110000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***11***

Byte 1: 01000001
Byte 2: 01000000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***12***

Byte 1: 01000001
Byte 2: 01010000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***13***

Byte 1: 01000001
Byte 2: 01100000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***14***

Byte 1: 01000001
Byte 2: 01110000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***15***

Byte 1: 01000001
Byte 2: 10000000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***16***

...

Byte 1: 01000010
Byte 2: 11000000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***96***

Byte 1: 01000010
Byte 2: 11000010
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***97***

Byte 1: 01000010
Byte 2: 11000100
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***98***

Byte 1: 01000010
Byte 2: 11000110
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***99***

Byte 1: 01000010
Byte 2: 11001000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***100***

Byte 1: 01000010
Byte 2: 11001010
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***101***

Byte 1: 01000010
Byte 2: 11001100
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***102***

Byte 1: 01000010
Byte 2: 11001110
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***103***

Byte 1: 01000010
Byte 2: 11010000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***104***

Byte 1: 01000010
Byte 2: 11010010
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***105***

Kommt jemand dahinter?
  Mit Zitat antworten Zitat
Benutzerbild von gmarts
gmarts

Registriert seit: 4. Apr 2004
Ort: Templin
290 Beiträge
 
Delphi 6 Enterprise
 
#2

Re: Rätselhafte Binärcodierung

  Alt 29. Mai 2004, 13:07
Hallo!
Bei den Zahlen 96 bis 105 liegt die Information in Byte2 (1.-7. bit, von vorn gezählt).
Byte 1 gibt an, wie byte 2 ausgelesen werden muss.

Kannst du mal ein paar Beispiele für Zahlen von 17-96 posten?!
procedure TForm1.Button1Click(Sender: TObject);
begin
button1.Click;
end;
  Mit Zitat antworten Zitat
Torphyr

Registriert seit: 7. Nov 2003
Ort: Filderstadt
8 Beiträge
 
#3

Re: Rätselhafte Binärcodierung

  Alt 1. Jun 2004, 09:41
Hi gmarts,

Zitat von gmarts:
Byte 1 gibt an, wie byte 2 ausgelesen werden muss.
So ganz vage ungefähr und nebelhaft hab ich mir das auch schon vorgestellt. Für Dich ist bestimmt auch offensichtlich, auf welche Weise Byte 1 die Leseanweisung gibt, aber ich komm nicht dahinter. Könntest Du's kurz erklären? Mannigfachen Dank!

Zitat von gmarts:
Kannst du mal ein paar Beispiele für Zahlen von 17-96 posten?!
Na klar, hier:
Code:
Byte 1: 01000001
Byte 2: 10001000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***17***

Byte 1: 01000001
Byte 2: 10010000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***18***

Byte 1: 01000001
Byte 2: 10011000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***19***

Byte 1: 01000001
Byte 2: 10100000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***20***

Byte 1: 01000001
Byte 2: 10101000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***21***

Byte 1: 01000001
Byte 2: 10110000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***22***

Byte 1: 01000001
Byte 2: 10111000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***23***

Byte 1: 01000001
Byte 2: 11000000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***24***

Byte 1: 01000001
Byte 2: 11001000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***25***

Byte 1: 01000001
Byte 2: 11010000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***26***

Byte 1: 01000001
Byte 2: 11011000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***27***

Byte 1: 01000001
Byte 2: 11100000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***28***

Byte 1: 01000001
Byte 2: 11101000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***29***

Byte 1: 01000001
Byte 2: 11110000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***30***

Byte 1: 01000001
Byte 2: 11111000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***31***

Byte 1: 01000010
Byte 2: 00000000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***32***

Byte 1: 01000010
Byte 2: 00000100
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***33***

Byte 1: 01000010
Byte 2: 00001000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***34***

Byte 1: 01000010
Byte 2: 00001100
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***35***

Byte 1: 01000010
Byte 2: 00010000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***36***

Byte 1: 01000010
Byte 2: 00010100
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***37***

Byte 1: 01000010
Byte 2: 00011000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***38***

Byte 1: 01000010
Byte 2: 00011100
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***39***

Byte 1: 01000010
Byte 2: 00100000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***40***

Byte 1: 01000010
Byte 2: 00100100
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***41***

Byte 1: 01000010
Byte 2: 00101000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***42***

Byte 1: 01000010
Byte 2: 00101100
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***43***

Byte 1: 01000010
Byte 2: 00110000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***44***

Byte 1: 01000010
Byte 2: 00110100
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***45***

Byte 1: 01000010
Byte 2: 00111000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***46***

Byte 1: 01000010
Byte 2: 00111100
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***47***

Byte 1: 01000010
Byte 2: 01000000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***48***

Byte 1: 01000010
Byte 2: 01000100
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***49***

Byte 1: 01000010
Byte 2: 01001000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***50***

Byte 1: 01000010
Byte 2: 01001100
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***51***

Byte 1: 01000010
Byte 2: 01010000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***52***

Byte 1: 01000010
Byte 2: 01010100
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***53***

Byte 1: 01000010
Byte 2: 01011000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***54***

Byte 1: 01000010
Byte 2: 01011100
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***55***

Byte 1: 01000010
Byte 2: 01100000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***56***

Byte 1: 01000010
Byte 2: 01100100
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***57***

Byte 1: 01000010
Byte 2: 01101000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***58***

Byte 1: 01000010
Byte 2: 01101100
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***59***

Byte 1: 01000010
Byte 2: 01110000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***60***

Byte 1: 01000010
Byte 2: 01110100
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***61***

Byte 1: 01000010
Byte 2: 01111000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***62***

Byte 1: 01000010
Byte 2: 01111100
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***63***

Byte 1: 01000010
Byte 2: 10000000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***64***

Byte 1: 01000010
Byte 2: 10000010
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***65***

Byte 1: 01000010
Byte 2: 10000100
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***66***

Byte 1: 01000010
Byte 2: 10000110
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***67***

Byte 1: 01000010
Byte 2: 10001000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***68***

Byte 1: 01000010
Byte 2: 10001010
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***69***

Byte 1: 01000010
Byte 2: 10001100
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***70***

Byte 1: 01000010
Byte 2: 10001110
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***71***

Byte 1: 01000010
Byte 2: 10010000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***72***

Byte 1: 01000010
Byte 2: 10010010
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***73***

Byte 1: 01000010
Byte 2: 10010100
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***74***

Byte 1: 01000010
Byte 2: 10010110
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***75***

Byte 1: 01000010
Byte 2: 10011000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***76***

Byte 1: 01000010
Byte 2: 10011010
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***77***

Byte 1: 01000010
Byte 2: 10011100
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***78***

Byte 1: 01000010
Byte 2: 10011110
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***79***

Byte 1: 01000010
Byte 2: 10100000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***80***

Byte 1: 01000010
Byte 2: 10100010
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***81***

Byte 1: 01000010
Byte 2: 10100100
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***82***

Byte 1: 01000010
Byte 2: 10100110
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***83***

Byte 1: 01000010
Byte 2: 10101000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***84***

Byte 1: 01000010
Byte 2: 10101010
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***85***

Byte 1: 01000010
Byte 2: 10101100
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***86***

Byte 1: 01000010
Byte 2: 10101110
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***87***

Byte 1: 01000010
Byte 2: 10110000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***88***

Byte 1: 01000010
Byte 2: 10110010
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***89***

Byte 1: 01000010
Byte 2: 10110100
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***90***

Byte 1: 01000010
Byte 2: 10110110
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***91***

Byte 1: 01000010
Byte 2: 10111000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***92***

Byte 1: 01000010
Byte 2: 10111010
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***93***

Byte 1: 01000010
Byte 2: 10111100
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***94***

Byte 1: 01000010
Byte 2: 10111110
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***95***

Byte 1: 01000010
Byte 2: 11000000
Byte 3: 00000000
Byte 4: 00000000
Zahl: ***96***
Soviel zum Thema "Wie mache ich einen laaaaangen Thread"
  Mit Zitat antworten Zitat
Skiron

Registriert seit: 14. Dez 2003
153 Beiträge
 
#4

Re: Rätselhafte Binärcodierung

  Alt 1. Jun 2004, 12:17
also beim 1. Byte dürfte das so aussehen:
es geht von 0011 1111 aus, was 63 entspricht
bei 2^1 (2) wird 1 dazugezählt, was es zu 0100 0000 macht
bei 2^3 (8) wird wieder 1 dazugezählt, insgesamt also 2 -> 0100 0001
das geht dann bei 2^5 (32), 2^7 (128) genauso weiter
d.h.:
in source würd das dann so aussehen:
  b1 := 63 + trunc(logN(2, Number) + 1) div 2; beim 2. Byte hab ich folgendes rausgefunden:
(das ist die Zahl) - (die letzte zahl 2^k wobei k ungerade), das ganze nach links geshiftet um (8-k) (wenn mich nicht alles täuscht)
beim source fürs 2. Byte hab ich noch meine Probleme
Mann zu Frau:
Zieh dich aus, wir müssen reden!
  Mit Zitat antworten Zitat
Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Ansicht

Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:15 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz