![]() |
Byte in Gray-Code wandeln
Hallo,
wie kann ich einen Byte-Wert in einen Gray-Code wandeln? Gibts hierfür fertige Funktionen und falls ja wo |
AW: Byte in Gray-Code wandeln
Hi,
mal kurz gesucht: ![]() :arrow: ![]() MfG |
AW: Byte in Gray-Code wandeln
Zitat:
Ich keine auch die Seite auf Wikipedia - aber ich fragte ja nach einer fertigen Funktion dafür |
AW: Byte in Gray-Code wandeln
Dieser C-Code lässt sich leicht nach Delphi portieren
![]() Man kann natürlich auch ein gefülltes Array verwenden um die Umrechnung möglichst schnell durchzuführen:
Delphi-Quellcode:
const graycode:array[byte] of byte = (0, 1, 3, 2,...., 128);
|
AW: Byte in Gray-Code wandeln
Zitat:
Delphi-Quellcode:
function ValueToGrayCode(Value: Byte):Byte;
begin Result := Value XOR (Value shr 1); end; |
AW: Byte in Gray-Code wandeln
Zitat:
Danke! - irgendwie stand ich auf dem Schlauch! |
Alle Zeitangaben in WEZ +1. Es ist jetzt 22:46 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz