def _matrices(self):
        """Compute the F and G matrices for parallel CRC computation.

        Computes the F and G matrices for parallel CRC computation, treating the CRC as a linear
        time-invariant system described by the state relation x(t+1) = F.x(i) + G.u(i), where x(i)
        and u(i) are column vectors of the bits of the CRC register and input word, F is the n-by-n
        matrix relating the old state to the new state, and G is the n-by-m matrix relating the new
        data to the new state, where n is the CRC width and m is the data word width.

        The matrices are ordered least-significant-bit first; in other words the first entry, with
        index (0, 0), corresponds to the effect of the least-significant bit of the input on
        the least-significant bit of the output.

        For convenience of implementation, both matrices are returned transposed: the first index
        is the input bit, and the second index is the corresponding output bit.

        The matrices are used to select which bits are XORd together to compute each bit i of
        the new state: if F[j][i] is set then bit j of the old state is included in the XOR, and
        if G[j][i] is set then bit j of the new data is included.

        These matrices are not affected by :py:`initial_crc`, :py:`reflect_input`,
        :py:`reflect_output`, or :py:`xor_output`.
        """
        f = []
        g = []
        algo = self.algorithm
        algo.reflect_input = algo.reflect_output = False
        algo.xor_output = 0
        crc = Parameters(algo, self.data_width)
        for i in range(self._crc_width):
            crc._initial_crc = 2 ** i
            w = crc.compute([0])
            f.append([int(x) for x in reversed(f"{w:0{self._crc_width}b}")])
        for i in range(self.data_width):
            crc._initial_crc = 0
            w = crc.compute([2 ** i])
            g.append([int(x) for x in reversed(f"{w:0{self._crc_width}b}")])
        return f, g
Compute the F and G matrices for parallel CRC computation.

        Computes the F and G matrices for parallel CRC computation, treating the CRC as a linear
        time-invariant system described by the state relation x(t+1) = F.x(i) + G.u(i), where x(i)
        and u(i) are column vectors of the bits of the CRC register and input word, F is the n-by-n
        matrix relating the old state to the new state, and G is the n-by-m matrix relating the new
        data to the new state, where n is the CRC width and m is the data word width.

        The matrices are ordered least-significant-bit first; in other words the first entry, with
        index (0, 0), corresponds to the effect of the least-significant bit of the input on
        the least-significant bit of the output.

        For convenience of implementation, both matrices are returned transposed: the first index
        is the input bit, and the second index is the corresponding output bit.

        The matrices are used to select which bits are XORd together to compute each bit i of
        the new state: if F[j][i] is set then bit j of the old state is included in the XOR, and
        if G[j][i] is set then bit j of the new data is included.

        These matrices are not affected by :py:`initial_crc`, :py:`reflect_input`,
        :py:`reflect_output`, or :py:`xor_output`.
        
amaranth/lib/crc/__init__.py