mirror of
https://github.com/ehw-fit/ariths-gen.git
synced 2025-04-10 09:12:11 +01:00
popcount fixes
This commit is contained in:
parent
8468c5b8fd
commit
128b1309a1
@ -1,7 +1,7 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from typing import Union
|
from typing import Union, Optional
|
||||||
|
|
||||||
from ariths_gen.wire_components import (
|
from ariths_gen.wire_components import (
|
||||||
Wire,
|
Wire,
|
||||||
@ -45,7 +45,7 @@ class UnsignedPopCount(GeneralCircuit):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, a: Bus, adder : Union[ArithmeticCircuit, None] = None, prefix : str = "", name : str = "popcnt", **kwargs):
|
def __init__(self, a: Bus, adder : Optional[ArithmeticCircuit] = None, prefix : str = "", name : str = "popcnt", **kwargs):
|
||||||
self.N = a.N
|
self.N = a.N
|
||||||
self.a = a
|
self.a = a
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
from io import StringIO
|
||||||
from ariths_gen.core.cgp_circuit import UnsignedCGPCircuit
|
from ariths_gen.core.cgp_circuit import UnsignedCGPCircuit
|
||||||
from ariths_gen.wire_components import (
|
from ariths_gen.wire_components import (
|
||||||
Wire,
|
Wire,
|
||||||
@ -11,6 +12,7 @@ from ariths_gen.core.arithmetic_circuits import GeneralCircuit
|
|||||||
from ariths_gen.multi_bit_circuits.others import (
|
from ariths_gen.multi_bit_circuits.others import (
|
||||||
UnsignedPopCount
|
UnsignedPopCount
|
||||||
)
|
)
|
||||||
|
import numpy as np
|
||||||
|
|
||||||
|
|
||||||
def test_popcount():
|
def test_popcount():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user