Embedded LC BPTC Progress
This commit is contained in:
parent
7715a032ab
commit
73adc95a6f
2
bptc.py
2
bptc.py
@ -152,7 +152,7 @@ def encode_emblc(_lc, _csum5):
|
||||
_binlc.frombytes(_lc)
|
||||
|
||||
# Insert the checksum bits at the right location in the matrix (this is actually faster than with a for loop)
|
||||
_binlc.insert(32, _csum5[0])
|
||||
_binlc.insert(32,_csum5[0])
|
||||
_binlc.insert(43,_csum5[1])
|
||||
_binlc.insert(54,_csum5[2])
|
||||
_binlc.insert(65,_csum5[3])
|
||||
|
@ -117,7 +117,7 @@ def dec_1393(_data):
|
||||
|
||||
# ENCODER - returns a bitarray object containing the hamming checksums
|
||||
def enc_16114(_data):
|
||||
assert len(_data) == 11, 'Hamming Encoder 16,11,4: Data not 11 bits long {}'
|
||||
assert len(_data) == 11, 'Hamming Encoder 16,11,4: Data not 11 bits long'
|
||||
csum = bitarray(5)
|
||||
csum[0] = _data[0] ^ _data[1] ^ _data[2] ^ _data[3] ^ _data[5] ^ _data[7] ^ _data[8]
|
||||
csum[1] = _data[1] ^ _data[2] ^ _data[3] ^ _data[4] ^ _data[6] ^ _data[8] ^ _data[9]
|
||||
|
Loading…
Reference in New Issue
Block a user