Skip to content
DeepForgeby svx
All problems
MediumInformation Theoryinfo-106

Convolutional Encoder Step

Problem

Compute one step of a rate-1/2 convolutional encoder. Form combined = [bit] + state, then output [parity(combined, taps1), parity(combined, taps2)], where a tap list names the indices XORed together for that output.

Hint

Index 0 of combined is the incoming bit; later indices are the register memory.

Test cases

case 1
in: [[0,0],1,[0,2],[0,1,2]]
expected: [1,1]
case 2
in: [[1,0],0,[0,2],[0,1]]
expected: [0,1]
case 3
in: [[1,1],1,[0,1],[1,2]]
expected: [0,0]
case 4
in: [[1,0,1],0,[1,3],[0,2,3]]
expected: [0,1]
Starter codePython
def conv_step(state, bit, taps1, taps2):
    # Your code here
    pass

4 test cases · run your code against them in the editor