English
Source / code snippets

Bitstream-CRC8-worth with Übertragungssimulation and Gegenprüfung

 

p.specht

the Program watts around the whom CRC-standard erfüllende Gegenprüfung complement:
CLS
Def %CRC8POLY  $18' 0X18 = X^8+X^5+X^4+X^0
Var CRC8_Sp% = 0' CRC8 memory

proc CRC8_berechnen

    Parameters crc_data%' Übergabe data
    Var bit_counter% = 8' Schleifendurchlauf
    Var feedback_bit% = 0' bit Return

    while bit_counter% > 0' 8x Durchläufe

        feedback_bit% = Xor(CRC8_Sp%,crc_data%) & $01' XOR on 1 to check on

        if feedback_bit% = $01' if 1, then...

            CRC8_Sp% = Xor(CRC8_Sp%,%CRC8POLY)' XOR with Poly

        EndIf

        CRC8_Sp% = (CRC8_Sp% >> 1) & $7F' Invoice values right & 247

        if feedback_bit% = $01' if 1, then...

            CRC8_Sp% = CRC8_Sp% | $80' ODER 128

        EndIf

        crc_data% = crc_data% >> 1' data Invoice values right
        Dec bit_counter%' Schleifendurchlauf -1

    EndWhile' end Endlosschleife

endproc

' Test appeal
CRC8_Sp% = 0' Reset CRC8 memory

WhileLoop 0,255' Chr$(0) To Chr$(255) go through

    CRC8_berechnen(&Loop)' CRC to charge
    Print "Daten="+Str $(&Loop)+"   CRC8="+Str $(CRC8_Sp%),
    CRC8_berechnen(  val( "%"+right$("00000000"+be$(&Loop),8)+right$("00000000"+be$(CRC8_Sp%),8) )  )
    Print tab(40);Str $(CRC8_Sp%)

EndWhile

waitinput
 
XProfan 11
Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'...
05/10/21  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

561 Views

Themeninformationen

this Topic has 1 subscriber:

p.specht (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie