def generate_symbol(registers, polynomials, K): 
  """Convolutionally encode one bit of data, output the encoded symbol"""
  # NOTE: EXPECTS registers FORMAT SUCH THAT LEFTMOST BIT IS MOST RECENT
  xor = 0
  symbol = ''
  # for each symbol bit
  for p in polynomials:
    xor = 0
    # for each memory stage
    for k in range(K):
      # check polynomial to see if stage is connected
      # xor if there is a connection
      if (p >> k) & 1:
        xor ^= registers[k]
    # add digit to symbol
    symbol += str(xor)
  return symbol