Signal
ControlledInverter4
Class bw.signal.ControlledInverter4
Defined in bitwise/signal/INV_CTRL.py.
4-bit controlled inverter.
__init__
__init__(
enable,
input_bus,
output_bus
)
Construct a new 4-bit controlled inverter.
Args:
enable: An object of typeWire. Enables the controlled inverter.input_bus: An object of typeBus4. The data input to the controlled inverter.output_bus: An object of typeBus4. The output of the controlled inverter, which is the inverted form of the data input iffenablehas value 1.
Raises:
TypeError: If eitherinput_busoroutput_busis not a bus of width 4.
__str__
Print out the wire values of the 4-bit controlled inverter.
enable: 0
input_bus: (0, 0, 0, 0)
output_bus: (0, 0, 0, 0)
__call__
__call__(
enable=None,
input_bus=None,
output_bus=None
)
Force specific values on the wires of the 4-bit controlled inverter.
Note that this method takes zero positional arguments; all values must be given as keyword arguments.
ControlledInverter8
Class bw.signal.ControlledInverter8
Defined in bitwise/signal/INV_CTRL.py.
8-bit controlled inverter.
__init__
__init__(
enable,
input_bus,
output_bus
)
Construct a new 8-bit controlled inverter.
Args:
enable: An object of typeWire. Enables the controlled inverter.input_bus: An object of typeBus8. The data input to the controlled inverter.output_bus: An object of typeBus8. The output of the controlled inverter, which is the inverted form of the data input iffenablehas value 1.
Raises:
TypeError: If eitherinput_busoroutput_busis not a bus of width 8.
__str__
Print out the wire values of the 8-bit controlled inverter.
enable: 0
input_bus: (0, 0, 0, 0, 0, 0, 0, 0)
output_bus: (0, 0, 0, 0, 0, 0, 0, 0)
__call__
__call__(
enable=None,
input_bus=None,
output_bus=None
)
Force specific values on the wires of the 8-bit controlled inverter.
Note that this method takes zero positional arguments; all values must be given as keyword arguments.
ControlledInverter16
Class bw.signal.ControlledInverter16
Defined in bitwise/signal/INV_CTRL.py.
16-bit controlled inverter.
__init__
__init__(
enable,
input_bus,
output_bus
)
Construct a new 16-bit controlled inverter.
Args:
enable: An object of typeWire. Enables the controlled inverter.input_bus: An object of typeBus16. The data input to the controlled inverter.output_bus: An object of typeBus16. The output of the controlled inverter, which is the inverted form of the data input iffenablehas value 1.
Raises:
TypeError: If eitherinput_busoroutput_busis not a bus of width 16.
__str__
Print out the wire values of the 16-bit controlled inverter.
enable: 0
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__(
enable=None,
input_bus=None,
output_bus=None
)
Force specific values on the wires of the 16-bit controlled inverter.
Note that this method takes zero positional arguments; all values must be given as keyword arguments.
Decoder1Of4
__init__
__init__(
enable,
input_1,
input_2,
output_bus
)
Construct a new 1-of-4 decoder.
Args:
enable: An object of typeWire. Enables the decoder.input_1: An object of typeWire. The most significant bit of the data input.input_2: An object of typeWire. The least significant bit of the data input.output_bus: An object of typeBus4. A one-hot encoded value of the input, withoutput_bus[0]corresponding to a (1, 1) input andoutput_bus[3]corresponding to a (0, 0) input.
Raises:
TypeError: Ifoutput_busis not a bus of width 4.
__str__
Print out the wire values of the 1-of-4 decoder.
enable: 0
input_1: 0
input_2: 0
output_bus: (0, 0, 0, 0)
__call__
__call__(
enable=None,
input_1=None,
input_2=None,
output_bus=None
)
Force specific values on the wires of the 1-of-4 decoder.
Note that this method takes zero positional arguments; all values must be given as keyword arguments.
Decoder1Of8
__init__
__init__(
enable,
input_1,
input_2,
input_3,
output_bus
)
Construct a new 1-of-8 decoder.
Args:
enable: An object of typeWire. Enables the decoder.input_1: An object of typeWire. The most significant bit of the data input.input_2: An object of typeWire.input_3: An object of typeWire. The least significant bit of the data input.output_bus: An object of typeBus8. A one-hot encoded value of the data input, withoutput_bus[0]corresponding to a (1, 1, 1) input andoutput_bus[7]corresponding to a (0, 0, 0) input.
Raises:
TypeError: Ifoutput_busis not a bus of width 8.
__str__
Print out the wire values of the 1-of-8 decoder.
enable: 0
input_1: 0
input_2: 0
input_3: 0
output_bus: (0, 0, 0, 0, 0, 0, 0, 0)
__call__
__call__(
enable=None,
input_1=None,
input_2=None,
input_3=None,
output_bus=None
)
Force specific values on the wires of the 1-of-8 decoder.
Note that this method takes zero positional arguments; all values must be given as keyword arguments.
Decoder1Of16
__init__
__init__(
enable,
input_bus,
output_bus
)
Construct a new 1-of-16 decoder.
Args:
enable: An object of typeWire. Enables the decoder.input_bus: An object of typeBus4. The data input to the decoder.input_bus[0]andinput_bus[3]are the most and least significant bit, respectively.output_bus: An object of typeBus16. A one-hot encoded value of the input, withoutput_bus[0]corresponding to a (1, 1, 1, 1) input andoutput_bus[15]corresponding to a (0, 0, 0, 0) input.
Raises:
TypeError: Ifinput_busis not a bus of width 4, or ifoutput_busis not a bus of width 16.
__str__
Print out the wire values of the 1-of-16 decoder.
enable: 0
input_bus: (0, 0, 0, 0)
output_bus: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
__call__
__call__(
enable=None,
input_bus=None,
output_bus=None
)
Force specific values on the wires of the 1-of-16 decoder.
Note that this method takes zero positional arguments; all values must be given as keyword arguments.
Demultiplexer1To2
__init__
__init__(
enable,
select,
input,
output_1,
output_2
)
Construct a new 1-to-2 demultiplexer.
Args:
enable: An object of typeWire. Enables the demultiplexer.select: An object of typeWire. The select input.input: An object of typeWire. The data input to the demultiplexer.output_1: An object of typeWire. Takes on the value ofinputif the value ofselectis 1.output_2: An object of typeWire. Takes on the value ofinputif the value ofselectis 0.
__str__
Print out the wire values of the 1-to-2 demultiplexer.
enable: 0
select: 0
input: 0
output_1: 0
output_2: 0
__call__
__call__(
enable=None,
select=None,
input=None,
output_1=None,
output_2=None
)
Force specific values on the wires of the 1-to-2 demultiplexer.
Note that this method takes zero positional arguments; all values must be given as keyword arguments.
Demultiplexer1To4
__init__
__init__(
enable,
select_1,
select_2,
input,
output_bus
)
Construct a new 1-to-4 demultiplexer.
Args:
enable: An object of typeWire. Enables the demultiplexer.select_1: An object of typeWire. The most significant bit of the select input.select_2: An object of typeWire. The least significant bit of the select input.input: An object of typeWire. The data input to the demultiplexer.output_bus: An object of typeBus4.output_bus[0]takes on the value ofinputfor a (1, 1) select, andoutput_bus[3]takes on the value ofinputfor a (0, 0) select.
Raises:
TypeError: Ifoutput_busis not a bus of width 4.
__str__
Print out the wire values of the 1-to-4 demultiplexer.
enable: 0
select_1: 0
select_2: 0
input: 0
output_bus: (0, 0, 0, 0)
__call__
__call__(
enable=None,
select_1=None,
select_2=None,
input=None,
output_bus=None
)
Force specific values on the wires of the 1-to-4 demultiplexer.
Note that this method takes zero positional arguments; all values must be given as keyword arguments.
Demultiplexer1To8
__init__
__init__(
enable,
select_1,
select_2,
select_3,
input,
output_bus
)
Construct a new 1-to-8 demultiplexer.
Args:
enable: An object of typeWire. Enables the demultiplexer.select_1: An object of typeWire. The most significant bit of the select input.select_2: An object of typeWire.select_3: An object of typeWire. The least significant bit of the select input.input: An object of typeWire. The data input to the demultiplexer.output_bus: An object of typeBus8.output_bus[0]takes on the value ofinputfor a (1, 1, 1) select, andoutput_bus[7]takes on the value ofinputfor a (0, 0, 0) select.
Raises:
TypeError: Ifoutput_busis not a bus of width 8.
__str__
Print out the wire values of the 1-to-8 demultiplexer.
enable: 0
select_1: 0
select_2: 0
select_3: 0
input: 0
output_bus: (0, 0, 0, 0, 0, 0, 0, 0)
__call__
__call__(
enable=None,
select_1=None,
select_2=None,
select_3=None,
input=None,
output_bus=None
)
Force specific values on the wires of the 1-to-8 demultiplexer.
Note that this method takes zero positional arguments; all values must be given as keyword arguments.
Demultiplexer1To16
__init__
__init__(
enable,
select_bus,
input,
output_bus
)
Construct a new 1-to-16 demultiplexer.
Args:
enable: An object of typeWire. Enables the demultiplexer.select_bus: An object of typeBus4. The select input to the demultiplexer.select_bus[0]andselect_bus[3]are the most and least significant bit, respectively.input: An object of typeWire. The data input to the demultiplexer.output_bus: An object of typeBus16.output_bus[0]takes on the value ofinputfor a (1, 1, 1, 1) select, andoutput_bus[15]takes on the value ofinputfor a (0, 0, 0, 0) select.
Raises:
TypeError: Ifselect_busis not a bus of width 4, or ifoutput_busis not a bus of width 16.
__str__
Print out the wire values of the 1-to-16 demultiplexer.
enable: 0
select_bus: (0, 0, 0, 0)
input: 0
output_bus: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
__call__
__call__(
enable=None,
select_bus=None,
input=None,
output_bus=None
)
Force specific values on the wires of the 1-to-16 demultiplexer.
Note that this method takes zero positional arguments; all values must be given as keyword arguments.
Encoder4To2
__init__
__init__(
enable,
input_bus,
valid,
output_1,
output_2
)
Construct a new 4-to-2 priority encoder.
Args:
enable: An object of typeWire. Enables the encoder.input_bus: An object of typeBus4. The data input to the encoder.input_bus[0]corresponds to an input value of 3, andinput_bus[3]corresponds to an input value of 0.valid: An object of typeWire. The valid indicator. Only takes on the value 0 if all the wires ininput_bushave value 0.output_1: An object of typeWire. The most significant bit of the output.output_2: An object of typeWire. The least significant bit of the output.
Raises:
TypeError: Ifinput_busis not a bus of width 4.
__str__
Print out the wire values of the 4-to-2 priority encoder.
enable: 0
input_bus: (0, 0, 0, 0)
valid: 0
output_1: 0
output_2: 0
__call__
__call__(
enable=None,
input_bus=None,
valid=None,
output_1=None,
output_2=None
)
Force specific values on the wires of the 4-to-2 priority encoder.
Note that this method takes zero positional arguments; all values must be given as keyword arguments.
Encoder8To3
__init__
__init__(
enable,
input_bus,
valid,
output_1,
output_2,
output_3
)
Construct a new 8-to-3 priority encoder.
Args:
enable: An object of typeWire. Enables the encoder.input_bus: An object of typeBus8. The data input to the encoder.input_bus[0]corresponds to an input value of 7, andinput_bus[7]corresponds to an input value of 0.valid: An object of typeWire. The valid indicator. Only takes on the value 0 if all the wires ininput_bushave value 0.output_1: An object of typeWire. The most significant bit of the output.output_2: An object of typeWire.output_3: An object of typeWire. The least significant bit of the output.
Raises:
TypeError: Ifinput_busis not a bus of width 8.
__str__
Print out the wire values of the 8-to-3 priority encoder.
enable: 0
input_bus: (0, 0, 0, 0, 0, 0, 0, 0)
valid: 0
output_1: 0
output_2: 0
output_3: 0
__call__
__call__(
enable=None,
input_bus=None,
valid=None,
output_1=None,
output_2=None,
output_3=None
)
Force specific values on the wires of the 8-to-3 priority encoder.
Note that this method takes zero positional arguments; all values must be given as keyword arguments.
Encoder16To4
__init__
__init__(
enable,
input_bus,
valid,
output_bus
)
Construct a new 16-to-4 priority encoder.
Args:
enable: An object of typeWire. Enables the encoder.input_bus: An object of typeBus16. The data input to the encoder.input_bus[0]corresponds to an input value of 15, andinput_bus[15]corresponds to an input value of 0.valid: An object of typeWire. The valid indicator. Only takes on the value 0 if all the wires ininput_bushave value 0.output_bus: An object of typeBus4. The output of the encoder.output_bus[0]andoutput_bus[3]are the most and least significant bit, respectively.
Raises:
TypeError: Ifinput_busis not a bus of width 16, or ifoutput_busis not a bus of width 4.
__str__
Print out the wire values of the 16-to-4 priority encoder.
enable: 0
input_bus: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
valid: 0
output_bus: (0, 0, 0, 0)
__call__
__call__(
enable=None,
input_bus=None,
valid=None,
output_bus=None
)
Force specific values on the wires of the 16-to-4 priority encoder.
Note that this method takes zero positional arguments; all values must be given as keyword arguments.
Multiplexer2To1
__init__
__init__(
enable,
select,
input_1,
input_2,
output
)
Construct a new 2-to-1 multiplexer.
Args:
enable: An object of typeWire. Enables the multiplexer.select: An object of typeWire. The select input.input_1: An object of typeWire. The first data input to the multiplexer.input_2: An object of typeWire. The second data input to the multiplexer.output: An object of typeWire. The output of the multiplexer. Takes on the value ofinput_1for a 1 select andinput_2for a 0 select.
__str__
Print out the wire values of the 2-to-1 multiplexer.
enable: 0
select: 0
input_1: 0
input_2: 0
output: 0
__call__
__call__(
enable=None,
select=None,
input_1=None,
input_2=None,
output=None
)
Force specific values on the wires of the 2-to-1 multiplexer.
Note that this method takes zero positional arguments; all values must be given as keyword arguments.
Multiplexer4To1
__init__
__init__(
enable,
select_1,
select_2,
input_bus,
output
)
Construct a new 4-to-1 multiplexer.
Args:
enable: An object of typeWire. Enables the multiplexer.select_1: An object of typeWire. The most significant bit of the select input.select_2: An object of typeWire. The least significant bit of the select input.input_bus: An object of typeBus4. The data input to the multiplexer.output: An object of typeWire. The output of the multiplexer. Takes on the value ofinput_bus[0]for a (1, 1) select andinput_bus[3]for a (0, 0) select.
Raises:
TypeError: Ifinput_busis not a bus of width 4.
__str__
Print out the wire values of the 4-to-1 multiplexer.
enable: 0
select_1: 0
select_2: 0
input_bus: (0, 0, 0, 0)
output: 0
__call__
__call__(
enable=None,
select_1=None,
select_2=None,
input_bus=None,
output=None
)
Force specific values on the wires of the 4-to-1 multiplexer.
Note that this method takes zero positional arguments; all values must be given as keyword arguments.
Multiplexer8To1
__init__
__init__(
enable,
select_1,
select_2,
select_3,
input_bus,
output
)
Construct a new 8-to-1 multiplexer.
Args:
enable: An object of typeWire. Enables the multiplexer.select_1: An object of typeWire. The most significant bit of the select input.select_2: An object of typeWire.select_3: An object of typeWire. The least significant bit of the select input.input_bus: An object of typeBus8. The data input to the multiplexer.output: An object of typeWire. The output of the multiplexer. Takes on the value ofinput_bus[0]for a (1, 1, 1) select andinput_bus[7]for a (0, 0, 0) select.
Raises:
TypeError: Ifinput_busis not a bus of width 8.
__str__
Print out the wire values of the 8-to-1 multiplexer.
enable: 0
select_1: 0
select_2: 0
select_3: 0
input_bus: (0, 0, 0, 0, 0, 0, 0, 0)
output: 0
__call__
__call__(
enable=None,
select_1=None,
select_2=None,
select_3=None,
input_bus=None,
output=None
)
Force specific values on the wires of the 8-to-1 multiplexer.
Note that this method takes zero positional arguments; all values must be given as keyword arguments.
Multiplexer16To1
__init__
__init__(
enable,
select_bus,
input_bus,
output
)
Construct a new 16-to-1 multiplexer.
Args:
enable: An object of typeWire. Enables the multiplexer.select_bus: An object of typeBus4.select_bus[0]andselect_bus[3]are the most and least significant bit, respectively.input_bus: An object of typeBus16. The data input to the multiplexer.output: An object of typeWire. The output of the multiplexer. Takes on the value ofinput_bus[0]for a (1, 1, 1, 1) select andinput_bus[15]for a (0, 0, 0, 0) select.
Raises:
TypeError: Ifselect_busis not a bus of width 4, or ifinput_busis not a bus of width 16.
__str__
Print out the wire values of the 16-to-1 multiplexer.
enable: 0
select_bus: (0, 0, 0, 0)
input_bus: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
output: 0
__call__
__call__(
enable=None,
select_bus=None,
input_bus=None,
output=None
)
Force specific values on the wires of the 16-to-1 multiplexer.
Note that this method takes zero positional arguments; all values must be given as keyword arguments.
SevenSegmentConverter
Class bw.signal.SevenSegmentConverter
Defined in bitwise/signal/SSD.py.
Seven-segment converter with a common anode.
__init__
__init__(
enable,
input_bus,
output_bus
)
Construct a new seven-segment converter.
Args:
enable: An object of typeWire. Enables the seven-segment converter.input_bus: An object of typeBus4. The data input to the seven-segment converter.input_bus[0]andinput_bus[3]are the most and least significant bit, respectively.output_bus: An object of typeBusSevenSegmentDisplay. The output of the seven-segment converter.output_bus[0]andoutput_bus[7]correspond to segment G and segment A, respectively.
Raises:
TypeError: Ifinput_busis not a bus of width 4, or ifoutput_busis not a bus of width 7.
__str__
Print out the wire values of the seven-segment converter.
enable: 0
input_bus: (0, 0, 0, 0)
output_bus: (0, 0, 0, 0, 0, 0, 0)
__call__
__call__(
enable=None,
input_bus=None,
output_bus=None
)
Force specific values on the wires of the seven-segment converter.
Note that this method takes zero positional arguments; all values must be given as keyword arguments.
SevenSegmentConverterDual
__init__
__init__(
enable,
input_bus,
output_bus_1,
output_bus_2
)
Construct a new dual seven-segment converter.
Args:
enable: An object of typeWire. Enables the seven-segment converter.input_bus: An object of typeBus8. The data input to the seven-segment converter.input_bus[0]andinput_bus[7]are the most and least significant bit, respectively.output_bus_1: An object of typeBusSevenSegmentDisplay. The first output bus of the seven-segment converter, usinginput_bus[0]andinput_bus[3]as the most and least significant bit, respectively.output_bus_1[0]andoutput_bus_1[7]correspond to segment G and segment A, respectively.output_bus_2: An object of typeBusSevenSegmentDisplay. The second output bus of the seven-segment converter, usinginput_bus[4]andinput_bus[7]as the most and least significant bit, respectively.output_bus_2[0]andoutput_bus_2[7]correspond to segment G and segment A, respectively.
Raises:
TypeError: Ifinput_busis not a bus of width 8, or if eitheroutput_bus_1oroutput_bus_2is not a bus of width 7.
__str__
Print out the wire values of the dual seven-segment converter.
enable: 0
input_bus: (0, 0, 0, 0, 0, 0, 0, 0)
output_bus_1: (0, 0, 0, 0, 0, 0, 0)
output_bus_2: (0, 0, 0, 0, 0, 0, 0)
__call__
__call__(
enable=None,
input_bus=None,
output_bus_1=None,
output_bus_2=None
)
Force specific values on the wires of the dual seven-segment converter.
Note that this method takes zero positional arguments; all values must be given as keyword arguments.
SevenSegmentConverterQuad
__init__
__init__(
enable,
input_bus,
output_bus_1,
output_bus_2,
output_bus_3,
output_bus_4
)
Construct a new quad seven-segment converter.
Args:
enable: An object of typeWire. Enables the seven-segment converter.input_bus: An object of typeBus16. The data input to the seven-segment converter.input_bus[0]andinput_bus[15]are the most and least significant bit, respectively.output_bus_1: An object of typeBusSevenSegmentDisplay. The first output bus of the seven-segment converter, usinginput_bus[0]andinput_bus[3]as the most and least significant bit, respectively.output_bus_1[0]andoutput_bus_1[7]correspond to segment G and segment A, respectively.output_bus_2: An object of typeBusSevenSegmentDisplay. The second output bus of the seven-segment converter, usinginput_bus[4]andinput_bus[7]as the most and least significant bit, respectively.output_bus_2[0]andoutput_bus_2[7]correspond to segment G and segment A, respectively.output_bus_3: An object of typeBusSevenSegmentDisplay. The third output bus of the seven-segment converter, usinginput_bus[8]andinput_bus[11]as the most and least significant bit, respectively.output_bus_3[0]andoutput_bus_3[7]correspond to segment G and segment A, respectively.output_bus_4: An object of typeBusSevenSegmentDisplay. The fourth output bus of the seven-segment converter, usinginput_bus[12]andinput_bus[15]as the most and least significant bit, respectively.output_bus_4[0]andoutput_bus_4[7]correspond to segment G and segment A, respectively.
Raises:
TypeError: Ifinput_busis not a bus of width 16, or if eitheroutput_bus_1,output_bus_2,output_bus_3, oroutput_bus_4is not a bus of width 7.
__str__
Print out the wire values of the quad seven-segment converter.
enable: 0
input_bus: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
output_bus_1: (0, 0, 0, 0, 0, 0, 0)
output_bus_2: (0, 0, 0, 0, 0, 0, 0)
output_bus_3: (0, 0, 0, 0, 0, 0, 0)
output_bus_4: (0, 0, 0, 0, 0, 0, 0)
__call__
__call__(
enable=None,
input_bus=None,
output_bus_1=None,
output_bus_2=None,
output_bus_3=None,
output_bus_4=None
)
Force specific values on the wires of the quad seven-segment converter.
Note that this method takes zero positional arguments; all values must be given as keyword arguments.