detect (but don't correct two-bit errors in a Word16
This commit is contained in:
@@ -64,8 +64,9 @@ instance Hamming Word16 where
|
||||
]
|
||||
|
||||
correctErrors c
|
||||
| isValid c = Just c
|
||||
| otherwise = let
|
||||
| isValid c = Just c
|
||||
| not (oddParity c) = Nothing
|
||||
| otherwise = let
|
||||
errorFlags = map (oddParity . (c .&.))
|
||||
[0xaaaa, 0xcccc, 0xf0f0, 0xff00]
|
||||
flipAddr = foldl
|
||||
|
||||
Reference in New Issue
Block a user