Embedded LC BPTC Progress

This commit is contained in:
Cort Buffington 2016-10-19 16:11:45 -05:00
parent 7715a032ab
commit 73adc95a6f
2 changed files with 2 additions and 2 deletions

View File

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

View File

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