Skip to content

Commit 7efa86a

Browse files
committed
doc update to and/or/xor all bits
1 parent 6bf99c3 commit 7efa86a

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

pyrtl/corecircuits.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,8 @@ class Command(IntEnum):
556556
def and_all_bits(vector):
557557
""" Returns WireVector, the result of "and"ing all items of the argument vector.
558558
559-
Takes a single WireVector and returns a 1 bit result, the bitwise and of all of
559+
:param vector: Takes a single arbitrary length WireVector
560+
:return: Returns a 1 bit result, the bitwise `and` of all of
560561
the bits in the vector to a single bit.
561562
"""
562563
return tree_reduce(lambda a, b: a & b, vector)
@@ -565,7 +566,8 @@ def and_all_bits(vector):
565566
def or_all_bits(vector):
566567
""" Returns WireVector, the result of "or"ing all items of the argument vector.
567568
568-
Takes a single WireVector and returns a 1 bit result, the bitwise or of all of
569+
:param vector: Takes a single arbitrary length WireVector
570+
:return: Returns a 1 bit result, the bitwise `or` of all of
569571
the bits in the vector to a single bit.
570572
"""
571573
return tree_reduce(lambda a, b: a | b, vector)
@@ -574,14 +576,14 @@ def or_all_bits(vector):
574576
def xor_all_bits(vector):
575577
""" Returns WireVector, the result of "xor"ing all items of the argument vector.
576578
577-
Takes a single WireVector and returns a 1 bit result, the bitwise xor of all of
578-
the bits in the vector to a single bit. This function is also aliased as `parity`
579-
and you can call it either way.
579+
:param vector: Takes a single arbitrary length WireVector
580+
:return: Returns a 1 bit result, the bitwise `xor` of all of
581+
the bits in the vector to a single bit.
580582
"""
581583
return tree_reduce(lambda a, b: a ^ b, vector)
582584

583585

584-
parity = xor_all_bits # shadowing the xor_all_bits_function
586+
parity = xor_all_bits # shadowing the xor_all_bits function
585587

586588

587589
def tree_reduce(op, vector):

0 commit comments

Comments
 (0)