Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I am trying to make python code that calculate CRC code using shift register. i don't know how to . . . def crc

I am trying to make python code that calculate "CRC code" using "shift register".
i don't know how to...
def crc_shift_register(data, generator):
data = list(map(int, data.split()))
generator = list(map(int, generator.split()))
print("information: ", data)
print("generator: ", generator)
crc =[0]*(len(generator)-1)
print("crc: ", crc)
# list concatenate
data = data + crc
print("codeword:", data)
print("codeword length:", len(data))
# shift register
data +=[0]*(len(generator)-1)
for bit in data:
if crc[0]==1:
for i in range(len(generator)):
crc[i]= crc[i]^ generator[i]
crc.pop(0)
crc.append(bit)
codeword = data + crc
return crc, codeword
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Development For Dummies

Authors: Allen G. Taylor

1st Edition

978-0764507526

More Books

Students also viewed these Databases questions