Skip to content

Commit 84dff93

Browse files
committed
docs/stdlib/crc: minor phrasing improvement.
1 parent c59447c commit 84dff93

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

amaranth/lib/crc/__init__.py

+5-7
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,7 @@ def algorithm(self):
133133
xor_output=self._xor_output)
134134

135135
def residue(self):
136-
"""Obtain the residual value left in the CRC register after processing a valid trailing CRC.
137-
138-
A trailing CRC data word is also known as a codeword."""
136+
"""Obtain the residual value left in the CRC register after processing a valid trailing CRC."""
139137
# Residue is computed by initialising to (possibly reflected) xor_output, feeding crc_width
140138
# worth of 0 bits, then taking the (possibly reflected) output without any XOR.
141139
if self._reflect_output:
@@ -273,10 +271,10 @@ class Processor(Elaboratable):
273271
computes every new bit of the CRC in parallel.
274272
275273
The :py:`match_detected` output may be used to validate data with a trailing CRC (also known as
276-
a codeword). If the most recently processed data word(s) form the valid CRC of all the previous
277-
data words since :py:`start` was asserted, the CRC register will always take on a fixed value
278-
known as the :meth:`residue <Parameters.residue>`. The :py:`match_detected` output indicates
279-
whether the CRC register currently contains this residue.
274+
a codeword in coding theory). If the most recently processed data word(s) form the valid CRC of
275+
all the previous data words since :py:`start` was asserted, the CRC register will always take on
276+
a fixed value known as the :meth:`residue <Parameters.residue>`. The :py:`match_detected` output
277+
indicates whether the CRC register currently contains this residue.
280278
281279
Parameters
282280
----------

docs/stdlib/crc.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ Examples
3535
from amaranth.lib.crc.catalog import CRC16_CCITT, CRC16_USB
3636

3737

38-
# Compute a CRC in hardware using the predefined CRC16-CCITT algorithm and the data word
38+
# Compute a CRC in hardware using the predefined CRC16-CCITT algorithm and a data word
3939
# width of 8 bits (in other words, computing it over bytes).
4040
m.submodules.crc16_ccitt = crc16_ccitt = CRC16_CCITT().create()
4141

42-
# Compute a CRC in hardware using the predefined CRC16-USB algorithm and the data word
42+
# Compute a CRC in hardware using the predefined CRC16-USB algorithm and a data word
4343
# width of 32 bits.
4444
m.submodules.crc16_usb = crc16_usb = CRC16_USB(32).create()
4545

0 commit comments

Comments
 (0)