@@ -556,7 +556,8 @@ class Command(IntEnum):
556
556
def and_all_bits (vector ):
557
557
""" Returns WireVector, the result of "and"ing all items of the argument vector.
558
558
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
560
561
the bits in the vector to a single bit.
561
562
"""
562
563
return tree_reduce (lambda a , b : a & b , vector )
@@ -565,7 +566,8 @@ def and_all_bits(vector):
565
566
def or_all_bits (vector ):
566
567
""" Returns WireVector, the result of "or"ing all items of the argument vector.
567
568
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
569
571
the bits in the vector to a single bit.
570
572
"""
571
573
return tree_reduce (lambda a , b : a | b , vector )
@@ -574,14 +576,14 @@ def or_all_bits(vector):
574
576
def xor_all_bits (vector ):
575
577
""" Returns WireVector, the result of "xor"ing all items of the argument vector.
576
578
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 .
580
582
"""
581
583
return tree_reduce (lambda a , b : a ^ b , vector )
582
584
583
585
584
- parity = xor_all_bits # shadowing the xor_all_bits_function
586
+ parity = xor_all_bits # shadowing the xor_all_bits function
585
587
586
588
587
589
def tree_reduce (op , vector ):
0 commit comments