Parity
Parity(
block_size: int = 8, debug: Debug = Debug.DEPLOY
)
A Parity EDAC System to deal with data that needs parity code added
Args
- debug (Debug, optional) : Debug Level. Defaults to DEPLOY.
Methods:
._decode
._decode(
data: int
)
Check the if the data is same as the given parity code
Args
- data (int) : given data
- check (int) : parity bit
Returns
- tuple : (error, data, error bits)
- error (bool) : If any error happens in the data
- data (int) : the corrected data (
0forCI) - bits (list) : the index of the error bits
CIforCannot Identify
._encode
._encode(
data: int
)
encode the given integer (was bytes)
Args
- data (int) : given integer
Returns
- int : integer that is encoded