Logic

BitwiseAND4

Class bw.logic.BitwiseAND4

_images/BitwiseAND4.svg

Defined in bitwise/logic/AND.py.

4-bit bitwise AND circuit.

__init__

__init__(
    a_bus,
    b_bus,
    output_bus
)

Construct a new 4-bit bitwise AND circuit.

Args:

  • a_bus: An object of type Bus4. The first input.
  • b_bus: An object of type Bus4. The second input.
  • output_bus: An object of type Bus4. The output of the bitwise AND operation.

Raises:

  • TypeError: If either a_bus, b_bus, or output_bus is not a bus of width 4.

__str__

Print out the wire values of the 4-bit bitwise AND circuit.

a_bus: (0, 0, 0, 0)
b_bus: (0, 0, 0, 0)
output_bus: (0, 0, 0, 0)

__call__

__call__(
    a_bus=None,
    b_bus=None,
    output_bus=None
)

Force specific values on the wires of the 4-bit bitwise AND circuit.

Note that this method takes zero positional arguments; all values must be given as keyword arguments.

BitwiseAND8

Class bw.logic.BitwiseAND8

_images/BitwiseAND8.svg

Defined in bitwise/logic/AND.py.

8-bit bitwise AND circuit.

__init__

__init__(
    a_bus,
    b_bus,
    output_bus
)

Construct a new 8-bit bitwise AND circuit.

Args:

  • a_bus: An object of type Bus8. The first input.
  • b_bus: An object of type Bus8. The second input.
  • output_bus: An object of type Bus8. The output of the bitwise AND operation.

Raises:

  • TypeError: If either a_bus, b_bus, or output_bus is not a bus of width 8.

__str__

Print out the wire values of the 8-bit bitwise AND circuit.

a_bus: (0, 0, 0, 0, 0, 0, 0, 0)
b_bus: (0, 0, 0, 0, 0, 0, 0, 0)
output_bus: (0, 0, 0, 0, 0, 0, 0, 0)

__call__

__call__(
    a_bus=None,
    b_bus=None,
    output_bus=None
)

Force specific values on the wires of the 8-bit bitwise AND circuit.

Note that this method takes zero positional arguments; all values must be given as keyword arguments.

BitwiseAND16

Class bw.logic.BitwiseAND16

_images/BitwiseAND16.svg

Defined in bitwise/logic/AND.py.

16-bit bitwise AND circuit.

__init__

__init__(
    a_bus,
    b_bus,
    output_bus
)

Construct a new 16-bit bitwise AND circuit.

Args:

  • a_bus: An object of type Bus16. The first input.
  • b_bus: An object of type Bus16. The second input.
  • output_bus: An object of type Bus16. The output of the bitwise AND operation.

Raises:

  • TypeError: If either a_bus, b_bus, or output_bus is not a bus of width 16.

__str__

Print out the wire values of the 16-bit bitwise AND circuit.

a_bus: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
b_bus: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
output_bus: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)

__call__

__call__(
    a_bus=None,
    b_bus=None,
    output_bus=None
)

Force specific values on the wires of the 16-bit bitwise AND circuit.

Note that this method takes zero positional arguments; all values must be given as keyword arguments.

BitwiseNAND4

Class bw.logic.BitwiseNAND4

_images/BitwiseNAND4.svg

Defined in bitwise/logic/NAND.py.

4-bit bitwise NAND circuit.

__init__

__init__(
    a_bus,
    b_bus,
    output_bus
)

Construct a new 4-bit bitwise NAND circuit.

Args:

  • a_bus: An object of type Bus4. The first input.
  • b_bus: An object of type Bus4. The second input.
  • output_bus: An object of type Bus4. The output of the bitwise NAND operation.

Raises:

  • TypeError: If either a_bus, b_bus, or output_bus is not a bus of width 4.

__str__

Print out the wire values of the 4-bit bitwise NAND circuit.

a_bus: (0, 0, 0, 0)
b_bus: (0, 0, 0, 0)
output_bus: (0, 0, 0, 0)

__call__

__call__(
    a_bus=None,
    b_bus=None,
    output_bus=None
)

Force specific values on the wires of the 4-bit bitwise NAND circuit.

Note that this method takes zero positional arguments; all values must be given as keyword arguments.

BitwiseNAND8

Class bw.logic.BitwiseNAND8

_images/BitwiseNAND8.svg

Defined in bitwise/logic/NAND.py.

8-bit bitwise NAND circuit.

__init__

__init__(
    a_bus,
    b_bus,
    output_bus
)

Construct a new 8-bit bitwise NAND circuit.

Args:

  • a_bus: An object of type Bus8. The first input.
  • b_bus: An object of type Bus8. The second input.
  • output_bus: An object of type Bus8. The output of the bitwise NAND operation.

Raises:

  • TypeError: If either a_bus, b_bus, or output_bus is not a bus of width 8.

__str__

Print out the wire values of the 8-bit bitwise NAND circuit.

a_bus: (0, 0, 0, 0, 0, 0, 0, 0)
b_bus: (0, 0, 0, 0, 0, 0, 0, 0)
output_bus: (0, 0, 0, 0, 0, 0, 0, 0)

__call__

__call__(
    a_bus=None,
    b_bus=None,
    output_bus=None
)

Force specific values on the wires of the 8-bit bitwise NAND circuit.

Note that this method takes zero positional arguments; all values must be given as keyword arguments.

BitwiseNAND16

Class bw.logic.BitwiseNAND16

_images/BitwiseNAND16.svg

Defined in bitwise/logic/NAND.py.

16-bit bitwise NAND circuit.

__init__

__init__(
    a_bus,
    b_bus,
    output_bus
)

Construct a new 16-bit bitwise NAND circuit.

Args:

  • a_bus: An object of type Bus16. The first input.
  • b_bus: An object of type Bus16. The second input.
  • output_bus: An object of type Bus16. The output of the bitwise NAND operation.

Raises:

  • TypeError: If either a_bus, b_bus, or output_bus is not a bus of width 16.

__str__

Print out the wire values of the 16-bit bitwise NAND circuit.

a_bus: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
b_bus: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
output_bus: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)

__call__

__call__(
    a_bus=None,
    b_bus=None,
    output_bus=None
)

Force specific values on the wires of the 16-bit bitwise NAND circuit.

Note that this method takes zero positional arguments; all values must be given as keyword arguments.

BitwiseNOR4

Class bw.logic.BitwiseNOR4

_images/BitwiseNOR4.svg

Defined in bitwise/logic/NOR.py.

4-bit bitwise NOR circuit.

__init__

__init__(
    a_bus,
    b_bus,
    output_bus
)

Construct a new 4-bit bitwise NOR circuit.

Args:

  • a_bus: An object of type Bus4. The first input.
  • b_bus: An object of type Bus4. The second input.
  • output_bus: An object of type Bus4. The output of the bitwise NOR operation.

Raises:

  • TypeError: If either a_bus, b_bus, or output_bus is not a bus of width 4.

__str__

Print out the wire values of the 4-bit bitwise NOR circuit.

a_bus: (0, 0, 0, 0)
b_bus: (0, 0, 0, 0)
output_bus: (0, 0, 0, 0)

__call__

__call__(
    a_bus=None,
    b_bus=None,
    output_bus=None
)

Force specific values on the wires of the 4-bit bitwise NOR circuit.

Note that this method takes zero positional arguments; all values must be given as keyword arguments.

BitwiseNOR8

Class bw.logic.BitwiseNOR8

_images/BitwiseNOR8.svg

Defined in bitwise/logic/NOR.py.

8-bit bitwise NOR circuit.

__init__

__init__(
    a_bus,
    b_bus,
    output_bus
)

Construct a new 8-bit bitwise NOR circuit.

Args:

  • a_bus: An object of type Bus8. The first input.
  • b_bus: An object of type Bus8. The second input.
  • output_bus: An object of type Bus8. The output of the bitwise NOR operation.

Raises:

  • TypeError: If either a_bus, b_bus, or output_bus is not a bus of width 8.

__str__

Print out the wire values of the 8-bit bitwise NOR circuit.

a_bus: (0, 0, 0, 0, 0, 0, 0, 0)
b_bus: (0, 0, 0, 0, 0, 0, 0, 0)
output_bus: (0, 0, 0, 0, 0, 0, 0, 0)

__call__

__call__(
    a_bus=None,
    b_bus=None,
    output_bus=None
)

Force specific values on the wires of the 8-bit bitwise NOR circuit.

Note that this method takes zero positional arguments; all values must be given as keyword arguments.

BitwiseNOR16

Class bw.logic.BitwiseNOR16

_images/BitwiseNOR16.svg

Defined in bitwise/logic/NOR.py.

16-bit bitwise NOR circuit.

__init__

__init__(
    a_bus,
    b_bus,
    output_bus
)

Construct a new 16-bit bitwise NOR circuit.

Args:

  • a_bus: An object of type Bus16. The first input.
  • b_bus: An object of type Bus16. The second input.
  • output_bus: An object of type Bus16. The output of the bitwise NOR operation.

Raises:

  • TypeError: If either a_bus, b_bus, or output_bus is not a bus of width 16.

__str__

Print out the wire values of the 16-bit bitwise NOR circuit.

a_bus: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
b_bus: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
output_bus: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)

__call__

__call__(
    a_bus=None,
    b_bus=None,
    output_bus=None
)

Force specific values on the wires of the 16-bit bitwise NOR circuit.

Note that this method takes zero positional arguments; all values must be given as keyword arguments.

BitwiseNOT4

Class bw.logic.BitwiseNOT4

_images/BitwiseNOT4.svg

Defined in bitwise/logic/NOT.py.

4-bit bitwise NOT circuit.

__init__

__init__(
    input_bus,
    output_bus
)

Construct a new 4-bit bitwise NOT circuit.

Args:

  • input_bus: An object of type Bus4. The input to the bitwise NOT operation.
  • output_bus: An object of type Bus4. The output of the bitwise NOT operation.

Raises:

  • TypeError: If either input_bus or output_bus is not a bus of width 4.

__str__

Print out the wire values of the 4-bit bitwise NOT circuit.

input_bus: (0, 0, 0, 0)
output_bus: (0, 0, 0, 0)

__call__

__call__(
    input_bus=None,
    output_bus=None
)

Force specific values on the wires of the 4-bit bitwise NOT circuit.

Note that this method takes zero positional arguments; all values must be given as keyword arguments.

BitwiseNOT8

Class bw.logic.BitwiseNOT8

_images/BitwiseNOT8.svg

Defined in bitwise/logic/NOT.py.

8-bit bitwise NOT circuit.

__init__

__init__(
    input_bus,
    output_bus
)

Construct a new 8-bit bitwise NOT circuit.

Args:

  • input_bus: An object of type Bus8. The input to the bitwise NOT operation.
  • output_bus: An object of type Bus8. The output of the bitwise NOT operation.

Raises:

  • TypeError: If either input_bus or output_bus is not a bus of width 8.

__str__

Print out the wire values of the 8-bit bitwise NOT circuit.

input_bus: (0, 0, 0, 0, 0, 0, 0, 0)
output_bus: (0, 0, 0, 0, 0, 0, 0, 0)

__call__

__call__(
    input_bus=None,
    output_bus=None
)

Force specific values on the wires of the 8-bit bitwise NOT circuit.

Note that this method takes zero positional arguments; all values must be given as keyword arguments.

BitwiseNOT16

Class bw.logic.BitwiseNOT16

_images/BitwiseNOT16.svg

Defined in bitwise/logic/NOT.py.

16-bit bitwise NOT circuit.

__init__

__init__(
    input_bus,
    output_bus
)

Construct a new 16-bit bitwise NOT circuit.

Args:

  • input_bus: An object of type Bus16. The input to the bitwise NOT operation.
  • output_bus: An object of type Bus16. The output of the bitwise NOT operation.

Raises:

  • TypeError: If either input_bus or output_bus is not a bus of width 16.

__str__

Print out the wire values of the 16-bit bitwise NOT circuit.

input_bus: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
output_bus: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)

__call__

__call__(
    input_bus=None,
    output_bus=None
)

Force specific values on the wires of the 16-bit bitwise NOT circuit.

Note that this method takes zero positional arguments; all values must be given as keyword arguments.

BitwiseOR4

Class bw.logic.BitwiseOR4

_images/BitwiseOR4.svg

Defined in bitwise/logic/OR.py.

4-bit bitwise OR circuit.

__init__

__init__(
    a_bus,
    b_bus,
    output_bus
)

Construct a new 4-bit bitwise OR circuit.

Args:

  • a_bus: An object of type Bus4. The first input.
  • b_bus: An object of type Bus4. The second input.
  • output_bus: An object of type Bus4. The output of the bitwise OR operation.

Raises:

  • TypeError: If either a_bus, b_bus, or output_bus is not a bus of width 4.

__str__

Print out the wire values of the 4-bit bitwise OR circuit.

a_bus: (0, 0, 0, 0)
b_bus: (0, 0, 0, 0)
output_bus: (0, 0, 0, 0)

__call__

__call__(
    a_bus=None,
    b_bus=None,
    output_bus=None
)

Force specific values on the wires of the 4-bit bitwise OR circuit.

Note that this method takes zero positional arguments; all values must be given as keyword arguments.

BitwiseOR8

Class bw.logic.BitwiseOR8

_images/BitwiseOR8.svg

Defined in bitwise/logic/OR.py.

8-bit bitwise OR circuit.

__init__

__init__(
    a_bus,
    b_bus,
    output_bus
)

Construct a new 8-bit bitwise OR circuit.

Args:

  • a_bus: An object of type Bus8. The first input.
  • b_bus: An object of type Bus8. The second input.
  • output_bus: An object of type Bus8. The output of the bitwise OR operation.

Raises:

  • TypeError: If either a_bus, b_bus, or output_bus is not a bus of width 8.

__str__

Print out the wire values of the 8-bit bitwise OR circuit.

a_bus: (0, 0, 0, 0, 0, 0, 0, 0)
b_bus: (0, 0, 0, 0, 0, 0, 0, 0)
output_bus: (0, 0, 0, 0, 0, 0, 0, 0)

__call__

__call__(
    a_bus=None,
    b_bus=None,
    output_bus=None
)

Force specific values on the wires of the 8-bit bitwise OR circuit.

Note that this method takes zero positional arguments; all values must be given as keyword arguments.

BitwiseOR16

Class bw.logic.BitwiseOR16

_images/BitwiseOR16.svg

Defined in bitwise/logic/OR.py.

16-bit bitwise OR circuit.

__init__

__init__(
    a_bus,
    b_bus,
    output_bus
)

Construct a new 16-bit bitwise OR circuit.

Args:

  • a_bus: An object of type Bus16. The first input.
  • b_bus: An object of type Bus16. The second input.
  • output_bus: An object of type Bus16. The output of the bitwise OR operation.

Raises:

  • TypeError: If either a_bus, b_bus, or output_bus is not a bus of width 16.

__str__

Print out the wire values of the 16-bit bitwise OR circuit.

a_bus: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
b_bus: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
output_bus: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)

__call__

__call__(
    a_bus=None,
    b_bus=None,
    output_bus=None
)

Force specific values on the wires of the 16-bit bitwise OR circuit.

Note that this method takes zero positional arguments; all values must be given as keyword arguments.

BitwiseXNOR4

Class bw.logic.BitwiseXNOR4

_images/BitwiseXNOR4.svg

Defined in bitwise/logic/XNOR.py.

4-bit bitwise XNOR circuit.

__init__

__init__(
    a_bus,
    b_bus,
    output_bus
)

Construct a new 4-bit bitwise XNOR circuit.

Args:

  • a_bus: An object of type Bus4. The first input.
  • b_bus: An object of type Bus4. The second input.
  • output_bus: An object of type Bus4. The output of the bitwise XNOR operation.

Raises:

  • TypeError: If either a_bus, b_bus, or output_bus is not a bus of width 4.

__str__

Print out the wire values of the 4-bit bitwise XNOR circuit.

a_bus: (0, 0, 0, 0)
b_bus: (0, 0, 0, 0)
output_bus: (0, 0, 0, 0)

__call__

__call__(
    a_bus=None,
    b_bus=None,
    output_bus=None
)

Force specific values on the wires of the 4-bit bitwise XNOR circuit.

Note that this method takes zero positional arguments; all values must be given as keyword arguments.

BitwiseXNOR8

Class bw.logic.BitwiseXNOR8

_images/BitwiseXNOR8.svg

Defined in bitwise/logic/XNOR.py.

8-bit bitwise XNOR circuit.

__init__

__init__(
    a_bus,
    b_bus,
    output_bus
)

Construct a new 8-bit bitwise XNOR circuit.

Args:

  • a_bus: An object of type Bus8. The first input.
  • b_bus: An object of type Bus8. The second input.
  • output_bus: An object of type Bus8. The output of the bitwise XNOR operation.

Raises:

  • TypeError: If either a_bus, b_bus, or output_bus is not a bus of width 8.

__str__

Print out the wire values of the 8-bit bitwise XNOR circuit.

a_bus: (0, 0, 0, 0, 0, 0, 0, 0)
b_bus: (0, 0, 0, 0, 0, 0, 0, 0)
output_bus: (0, 0, 0, 0, 0, 0, 0, 0)

__call__

__call__(
    a_bus=None,
    b_bus=None,
    output_bus=None
)

Force specific values on the wires of the 8-bit bitwise XNOR circuit.

Note that this method takes zero positional arguments; all values must be given as keyword arguments.

BitwiseXNOR16

Class bw.logic.BitwiseXNOR16

_images/BitwiseXNOR16.svg

Defined in bitwise/logic/XNOR.py.

16-bit bitwise XNOR circuit.

__init__

__init__(
    a_bus,
    b_bus,
    output_bus
)

Construct a new 16-bit bitwise XNOR circuit.

Args:

  • a_bus: An object of type Bus16. The first input.
  • b_bus: An object of type Bus16. The second input.
  • output_bus: An object of type Bus16. The output of the bitwise XNOR operation.

Raises:

  • TypeError: If either a_bus, b_bus, or output_bus is not a bus of width 16.

__str__

Print out the wire values of the 16-bit bitwise XNOR circuit.

a_bus: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
b_bus: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
output_bus: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)

__call__

__call__(
    a_bus=None,
    b_bus=None,
    output_bus=None
)

Force specific values on the wires of the 16-bit bitwise XNOR circuit.

Note that this method takes zero positional arguments; all values must be given as keyword arguments.

BitwiseXOR4

Class bw.logic.BitwiseXOR4

_images/BitwiseXOR4.svg

Defined in bitwise/logic/XOR.py.

4-bit bitwise XOR circuit.

__init__

__init__(
    a_bus,
    b_bus,
    output_bus
)

Construct a new 4-bit bitwise XOR circuit.

Args:

  • a_bus: An object of type Bus4. The first input.
  • b_bus: An object of type Bus4. The second input.
  • output_bus: An object of type Bus4. The output of the bitwise XOR operation.

Raises:

  • TypeError: If either a_bus, b_bus, or output_bus is not a bus of width 4.

__str__

Print out the wire values of the 4-bit bitwise XOR circuit.

a_bus: (0, 0, 0, 0)
b_bus: (0, 0, 0, 0)
output_bus: (0, 0, 0, 0)

__call__

__call__(
    a_bus=None,
    b_bus=None,
    output_bus=None
)

Force specific values on the wires of the 4-bit bitwise XOR circuit.

Note that this method takes zero positional arguments; all values must be given as keyword arguments.

BitwiseXOR8

Class bw.logic.BitwiseXOR8

_images/BitwiseXOR8.svg

Defined in bitwise/logic/XOR.py.

8-bit bitwise XOR circuit.

__init__

__init__(
    a_bus,
    b_bus,
    output_bus
)

Construct a new 8-bit bitwise XOR circuit.

Args:

  • a_bus: An object of type Bus8. The first input.
  • b_bus: An object of type Bus8. The second input.
  • output_bus: An object of type Bus8. The output of the bitwise XOR operation.

Raises:

  • TypeError: If either a_bus, b_bus, or output_bus is not a bus of width 8.

__str__

Print out the wire values of the 8-bit bitwise XOR circuit.

a_bus: (0, 0, 0, 0, 0, 0, 0, 0)
b_bus: (0, 0, 0, 0, 0, 0, 0, 0)
output_bus: (0, 0, 0, 0, 0, 0, 0, 0)

__call__

__call__(
    a_bus=None,
    b_bus=None,
    output_bus=None
)

Force specific values on the wires of the 8-bit bitwise XOR circuit.

Note that this method takes zero positional arguments; all values must be given as keyword arguments.

BitwiseXOR16

Class bw.logic.BitwiseXOR16

_images/BitwiseXOR16.svg

Defined in bitwise/logic/XOR.py.

16-bit bitwise XOR circuit.

__init__

__init__(
    a_bus,
    b_bus,
    output_bus
)

Construct a new 16-bit bitwise XOR circuit.

Args:

  • a_bus: An object of type Bus16. The first input.
  • b_bus: An object of type Bus16. The second input.
  • output_bus: An object of type Bus16. The output of the bitwise XOR operation.

Raises:

  • TypeError: If either a_bus, b_bus, or output_bus is not a bus of width 16.

__str__

Print out the wire values of the 16-bit bitwise XOR circuit.

a_bus: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
b_bus: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
output_bus: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)

__call__

__call__(
    a_bus=None,
    b_bus=None,
    output_bus=None
)

Force specific values on the wires of the 16-bit bitwise XOR circuit.

Note that this method takes zero positional arguments; all values must be given as keyword arguments.

Comparator3

Class bw.logic.Comparator3

_images/Comparator3.svg

Defined in bitwise/logic/COMP.py.

3-bit logical comparator.

__init__

__init__(
    a_bus,
    b_bus,
    greater_than,
    equal_to,
    less_than
)

Construct a new 3-bit logical comparator.

Args:

  • a_bus: An object of type Bus4. The number to be compared. a_bus[1] and a_bus[3] are the most and least significant bit, respectively. a_bus[0] is the sign bit.
  • b_bus: An object of type Bus4. The number to be compared against. b_bus[1] and b_bus[3] are the most and least significant bit, respectively. b_bus[0] is the sign bit.
  • greater_than: An object of type Wire. The greater-than indicator.
  • equal_to: An object of type Wire. The equal-to indicator.
  • less_than: An object of type Wire. The less-than indicator.

Raises:

  • TypeError: If either a_bus or b_bus is not a bus of width 4.

__str__

Print out the wire values of the 3-bit logical comparator.

a_bus: (0, 0, 0, 0)
b_bus: (0, 0, 0, 0)
greater_than: 0
equal_to: 0
less_than: 0

__call__

__call__(
    a_bus=None,
    b_bus=None,
    greater_than=None,
    equal_to=None,
    less_than=None
)

Force specific values on the wires of the 3-bit logical comparator.

Note that this method takes zero positional arguments; all values must be given as keyword arguments.

Comparator7

Class bw.logic.Comparator7

_images/Comparator7.svg

Defined in bitwise/logic/COMP.py.

7-bit logical comparator.

__init__

__init__(
    a_bus,
    b_bus,
    greater_than,
    equal_to,
    less_than
)

Construct a new 7-bit logical comparator.

Args:

  • a_bus: An object of type Bus8. The number to be compared. a_bus[1] and a_bus[7] are the most and least significant bit, respectively. a_bus[0] is the sign bit.
  • b_bus: An object of type Bus8. The number to be compared against. b_bus[1] and b_bus[7] are the most and least significant bit, respectively. b_bus[0] is the sign bit.
  • greater_than: An object of type Wire. The greater-than indicator.
  • equal_to: An object of type Wire. The equal-to indicator.
  • less_than: An object of type Wire. The less-than indicator.

Raises:

  • TypeError: If either a_bus or b_bus is not a bus of width 8.

__str__

Print out the wire values of the 7-bit logical comparator.

a_bus: (0, 0, 0, 0, 0, 0, 0, 0)
b_bus: (0, 0, 0, 0, 0, 0, 0, 0)
greater_than: 0
equal_to: 0
less_than: 0

__call__

__call__(
    a_bus=None,
    b_bus=None,
    greater_than=None,
    equal_to=None,
    less_than=None
)

Force specific values on the wires of the 7-bit logical comparator.

Note that this method takes zero positional arguments; all values must be given as keyword arguments.

Comparator15

Class bw.logic.Comparator15

_images/Comparator15.svg

Defined in bitwise/logic/COMP.py.

15-bit logical comparator.

__init__

__init__(
    a_bus,
    b_bus,
    greater_than,
    equal_to,
    less_than
)

Construct a new 15-bit logical comparator.

Args:

  • a_bus: An object of type Bus16. The number to be compared. a_bus[1] and a_bus[15] are the most and least significant bit, respectively. a_bus[0] is the sign bit.
  • b_bus: An object of type Bus16. The number to be compared against. b_bus[1] and b_bus[15] are the most and least significant bit, respectively. b_bus[0] is the sign bit.
  • greater_than: An object of type Wire. The greater-than indicator.
  • equal_to: An object of type Wire. The equal-to indicator.
  • less_than: An object of type Wire. The less-than indicator.

Raises:

  • TypeError: If either a_bus or b_bus is not a bus of width 16.

__str__

Print out the wire values of the 15-bit logical comparator.

a_bus: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
b_bus: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
greater_than: 0
equal_to: 0
less_than: 0

__call__

__call__(
    a_bus=None,
    b_bus=None,
    greater_than=None,
    equal_to=None,
    less_than=None
)

Force specific values on the wires of the 15-bit logical comparator.

Note that this method takes zero positional arguments; all values must be given as keyword arguments.

ParityChecker4

Class bw.logic.ParityChecker4

_images/ParityChecker4.svg

Defined in bitwise/logic/PAR.py.

4-bit even parity checker.

__init__

__init__(
    input_bus,
    parity_bit,
    error
)

Construct a new 4-bit even parity checker.

Args:

  • input_bus: An object of type Bus4. The input to the parity checker.
  • parity_bit: An object of type Wire. The parity bit.
  • error: An object of type Wire. The error indicator.

Raises:

  • TypeError: If input_bus is not a bus of width 4.

__str__

Print out the wire values of the 4-bit even parity checker.

input_bus: (0, 0, 0, 0)
parity_bit: 0
error: 0

__call__

__call__(
    input_bus=None,
    parity_bit=None,
    error=None
)

Force specific values on the wires of the 4-bit even parity checker.

Note that this method takes zero positional arguments; all values must be given as keyword arguments.

ParityChecker8

Class bw.logic.ParityChecker8

_images/ParityChecker8.svg

Defined in bitwise/logic/PAR.py.

8-bit even parity checker.

__init__

__init__(
    input_bus,
    parity_bit,
    error
)

Construct a new 8-bit even parity checker.

Args:

  • input_bus: An object of type Bus8. The input to the parity checker.
  • parity_bit: An object of type Wire. The parity bit.
  • error: An object of type Wire. The error indicator.

Raises:

  • TypeError: If input_bus is not a bus of width 8.

__str__

Print out the wire values of the 8-bit even parity checker.

input_bus: (0, 0, 0, 0, 0, 0, 0, 0)
parity_bit: 0
error: 0

__call__

__call__(
    input_bus=None,
    parity_bit=None,
    error=None
)

Force specific values on the wires of the 8-bit even parity checker.

Note that this method takes zero positional arguments; all values must be given as keyword arguments.

ParityChecker16

Class bw.logic.ParityChecker16

_images/ParityChecker16.svg

Defined in bitwise/logic/PAR.py.

16-bit even parity checker.

__init__

__init__(
    input_bus,
    parity_bit,
    error
)

Construct a new 16-bit even parity checker.

Args:

  • input_bus: An object of type Bus16. The input to the parity checker.
  • parity_bit: An object of type Wire. The parity bit.
  • error: An object of type Wire. The error indicator.

Raises:

  • TypeError: If input_bus is not a bus of width 16.

__str__

Print out the wire values of the 16-bit even parity checker.

input_bus: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
parity_bit: 0
error: 0

__call__

__call__(
    input_bus=None,
    parity_bit=None,
    error=None
)

Force specific values on the wires of the 16-bit even parity checker.

Note that this method takes zero positional arguments; all values must be given as keyword arguments.

ParityGenerator4

Class bw.logic.ParityGenerator4

_images/ParityGenerator4.svg

Defined in bitwise/logic/PAR.py.

4-bit even parity generator.

__init__

__init__(
    input_bus,
    parity_bit
)

Construct a new 4-bit even parity generator.

Args:

  • input_bus: An object of type Bus4. The input to the parity generator.
  • parity_bit: An object of type Wire. The parity bit.

Raises:

  • TypeError: If input_bus is not a bus of width 4.

__str__

Print out the wire values of the 4-bit even parity generator.

input_bus: (0, 0, 0, 0)
parity_bit: 0

__call__

__call__(
    input_bus=None,
    parity_bit=None
)

Force specific values on the wires of the 4-bit even parity generator.

Note that this method takes zero positional arguments; all values must be given as keyword arguments.

ParityGenerator8

Class bw.logic.ParityGenerator8

_images/ParityGenerator8.svg

Defined in bitwise/logic/PAR.py.

8-bit even parity generator.

__init__

__init__(
    input_bus,
    parity_bit
)

Construct a new 8-bit even parity generator.

Args:

  • input_bus: An object of type Bus8. The input to the parity generator.
  • parity_bit: An object of type Wire. The parity bit.

Raises:

  • TypeError: If input_bus is not a bus of width 8.

__str__

Print out the wire values of the 8-bit even parity generator.

input_bus: (0, 0, 0, 0, 0, 0, 0, 0)
parity_bit: 0

__call__

__call__(
    input_bus=None,
    parity_bit=None
)

Force specific values on the wires of the 8-bit even parity generator.

Note that this method takes zero positional arguments; all values must be given as keyword arguments.

ParityGenerator16

Class bw.logic.ParityGenerator16

_images/ParityGenerator16.svg

Defined in bitwise/logic/PAR.py.

16-bit even parity generator.

__init__

__init__(
    input_bus,
    parity_bit
)

Construct a new 16-bit even parity generator.

Args:

  • input_bus: An object of type Bus16. The input to the parity generator.
  • parity_bit: An object of type Wire. The parity bit.

Raises:

  • TypeError: If input_bus is not a bus of width 16.

__str__

Print out the wire values of the 16-bit even parity generator.

input_bus: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
parity_bit: 0

__call__

__call__(
    input_bus=None,
    parity_bit=None
)

Force specific values on the wires of the 16-bit even parity generator.

Note that this method takes zero positional arguments; all values must be given as keyword arguments.