Shop OBEX P1 Docs P2 Docs Learn Events
Trying to compute crc7 — Parallax Forums

Trying to compute crc7

KyeKye Posts: 2,200
edited 2009-04-18 06:24 in Propeller 1
Hey guys, i've been trying to write a crc7 function, but mine seems to not work. Can anyone help out?

PRI computeCRC7(value)
 
  value <<= 24
 
  repeat 16
 
    value <-= 1
 
    CRC7 |= (value & 1)
 
    CRC7 <<= 1
 
    if(CRC7 & $80)
      CRC7 ^= $09
 
    CRC7 &= $7F     
 
VAR
 
  byte CRC7


Thanks, I'm not sure whats wrong...

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,

Post Edited (Kye) : 4/18/2009 1:43:11 PM GMT

Comments

Sign In or Register to comment.