detect (but don't correct two-bit errors in a Word16

This commit is contained in:
2024-07-06 20:55:31 -04:00
parent ed405e366e
commit 74b26de743
2 changed files with 21 additions and 4 deletions

View File

@@ -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