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

@ -117,7 +117,7 @@ def dec_1393(_data):
# ENCODER - returns a bitarray object containing the hamming checksums # ENCODER - returns a bitarray object containing the hamming checksums
def enc_16114(_data): 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 = bitarray(5)
csum[0] = _data[0] ^ _data[1] ^ _data[2] ^ _data[3] ^ _data[5] ^ _data[7] ^ _data[8] 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] csum[1] = _data[1] ^ _data[2] ^ _data[3] ^ _data[4] ^ _data[6] ^ _data[8] ^ _data[9]