State
DownCounterMod4
Class bw.state.DownCounterMod4
Defined in bitwise/state/COUNT.py.
2-bit (mod-4) down counter with parallel load.
__init__
__init__(
enable,
load_n,
load_1,
load_2,
clock,
output_1,
output_2
)
Construct a new mod-4 down counter.
Args:
enable
: An object of typeWire
. Enables the counter.load_n
: An object of typeWire
. Loadsload_1
intooutput_1
andload_2
intooutput_2
if its value is 0.load_1
: An object of typeWire
. The most significant bit of the load input.load_2
: An object of typeWire
. The least significant bit of the load input.clock
: An object of typeWire
orClock
. The clock input to the counter.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.
__str__
Print out the wire values of the mod-4 down counter.
enable: 0
load_n: 0
load_1: 0
load_2: 0
clock: 0
output_1: 0
output_2: 0
__call__
__call__(
enable=None,
load_n=None,
load_1=None,
load_2=None,
clock=None,
output_1=None,
output_2=None
)
Force specific values on the wires of the mod-4 down counter.
Note that this method takes zero positional arguments; all values must be given as keyword arguments.
DownCounterMod8
Class bw.state.DownCounterMod8
Defined in bitwise/state/COUNT.py.
3-bit (mod-8) down counter with parallel load.
__init__
__init__(
enable,
load_n,
load_1,
load_2,
load_3,
clock,
output_1,
output_2,
output_3
)
Construct a new mod-8 down counter.
Args:
enable
: An object of typeWire
. Enables the counter.load_n
: An object of typeWire
. Loadsload_1
intooutput_1
,load_2
intooutput_2
, andload_3
intooutput_3
if its value is 0.load_1
: An object of typeWire
. The most significant bit of the load input.load_2
: An object of typeWire
.load_3
: An object of typeWire
. The least significant bit of the load input.clock
: An object of typeWire
orClock
. The clock input to the counter.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.
__str__
Print out the wire values of the mod-8 down counter.
enable: 0
load_n: 0
load_1: 0
load_2: 0
load_3: 0
clock: 0
output_1: 0
output_2: 0
output_3: 0
__call__
__call__(
enable=None,
load_n=None,
load_1=None,
load_2=None,
load_3=None,
clock=None,
output_1=None,
output_2=None,
output_3=None
)
Force specific values on the wires of the mod-8 down counter.
Note that this method takes zero positional arguments; all values must be given as keyword arguments.
DownCounterMod16
Class bw.state.DownCounterMod16
Defined in bitwise/state/COUNT.py.
4-bit (mod-16) down counter with parallel load.
__init__
__init__(
enable,
load_n,
load_bus,
clock,
output_bus
)
Construct a new mod-16 down counter.
Args:
enable
: An object of typeWire
. Enables the counter.load_n
: An object of typeWire
. Loadsload_bus
intooutput_bus
if its value is 0.load_bus
: An object of typeBus4
. The load input to the counter.load_bus[0]
andload_bus[3]
are the most and least significant bit, respectively.clock
: An object of typeWire
orClock
. The clock input to the counter.output_bus
: An object of typeBus4
. The output of the counter.output_bus[0]
andoutput_bus[3]
are the most and least significant bit, respectively.
Raises:
TypeError
: If eitherload_bus
oroutput_bus
is not a bus of width 4.
__str__
Print out the wire values of the mod-16 down counter.
enable: 0
load_n: 0
load_bus: (0, 0, 0, 0)
clock: 0
output_bus: (0, 0, 0, 0)
__call__
__call__(
enable=None,
load_n=None,
load_bus=None,
clock=None,
output_bus=None
)
Force specific values on the wires of the mod-16 down counter.
Note that this method takes zero positional arguments; all values must be given as keyword arguments.
ParallelToSerialConverter4To1
Class bw.state.ParallelToSerialConverter4To1
Defined in bitwise/state/PISO.py.
__init__
__init__(
enable,
clear_n,
load_n,
data_bus,
clock,
output
)
Construct a new 4-bit-parallel-to-serial converter.
Args:
enable
: An object of typeWire
. Enables the converter.clear_n
: An object of typeWire
. Clears all 4 internal registers to 0 asynchronously if its value is 0.load_n
: An object of typeWire
. The mode select. A value of 0 indicates a parallel load operation, where the values ofdata_bus
are loaded into the internal registers. A value of 1 indicates a shift-right operation.data_bus
: An object of typeBus4
. The parallel data input.clock
: An object of typeWire
orClock
. The clock input.output
: An object of typeWire
. The serial output of the converter.data_bus[3]
is outputted first, anddata_bus[0]
is outputted last.
Raises:
TypeError
: Ifdata_bus
is not a bus of width 4.
__str__
Print out the wire values of the 4-bit-parallel-to-serial converter.
enable: 0
clear_n: 0
load_n: 0
data_bus: (0, 0, 0, 0)
clock: 0
output: 0
__call__
__call__(
enable=None,
clear_n=None,
load_n=None,
data_bus=None,
clock=None,
output=None
)
Force specific values on the wires of the 4-bit-parallel-to-serial converter.
Note that this method takes zero positional arguments; all values must be given as keyword arguments.
ParallelToSerialConverter8To1
Class bw.state.ParallelToSerialConverter8To1
Defined in bitwise/state/PISO.py.
__init__
__init__(
enable,
clear_n,
load_n,
data_bus,
clock,
output
)
Construct a new 8-bit-parallel-to-serial converter.
Args:
enable
: An object of typeWire
. Enables the converter.clear_n
: An object of typeWire
. Clears all 8 internal registers to 0 asynchronously if its value is 0.load_n
: An object of typeWire
. The mode select. A value of 0 indicates a parallel load operation, where the values ofdata_bus
are loaded into the internal registers. A value of 1 indicates a shift-right operation.data_bus
: An object of typeBus8
. The parallel data input.clock
: An object of typeWire
orClock
. The clock input.output
: An object of typeWire
. The serial output of the converter.data_bus[7]
is outputted first, anddata_bus[0]
is outputted last.
Raises:
TypeError
: Ifdata_bus
is not a bus of width 8.
__str__
Print out the wire values of the 8-bit-parallel-to-serial converter.
enable: 0
clear_n: 0
load_n: 0
data_bus: (0, 0, 0, 0, 0, 0, 0, 0)
clock: 0
output: 0
__call__
__call__(
enable=None,
clear_n=None,
load_n=None,
data_bus=None,
clock=None,
output=None
)
Force specific values on the wires of the 8-bit-parallel-to-serial converter.
Note that this method takes zero positional arguments; all values must be given as keyword arguments.
ParallelToSerialConverter16To1
Class bw.state.ParallelToSerialConverter16To1
Defined in bitwise/state/PISO.py.
__init__
__init__(
enable,
clear_n,
load_n,
data_bus,
clock,
output
)
Construct a new 16-bit-parallel-to-serial converter.
Args:
enable
: An object of typeWire
. Enables the converter.clear_n
: An object of typeWire
. Clears all 16 internal registers to 0 asynchronously if its value is 0.load_n
: An object of typeWire
. The mode select. A value of 0 indicates a parallel load operation, where the values ofdata_bus
are loaded into the internal registers. A value of 1 indicates a shift-right operation.data_bus
: An object of typeBus16
. The parallel data input.clock
: An object of typeWire
orClock
. The clock input.output
: An object of typeWire
. The serial output of the converter.data_bus[15]
is outputted first, anddata_bus[0]
is outputted last.
Raises:
TypeError
: Ifdata_bus
is not a bus of width 16.
__str__
Print out the wire values of the 16-bit-parallel-to-serial converter.
enable: 0
clear_n: 0
load_n: 0
data_bus: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
clock: 0
output: 0
__call__
__call__(
enable=None,
clear_n=None,
load_n=None,
data_bus=None,
clock=None,
output=None
)
Force specific values on the wires of the 16-bit-parallel-to-serial converter.
Note that this method takes zero positional arguments; all values must be given as keyword arguments.
RingCounter4
__init__
__init__(
enable,
clear_n,
clock,
output_bus
)
Construct a new 4-bit ring counter.
Args:
enable
: An object of typeWire
. Enables the ring counter.clear_n
: An object of typeWire
. Clearsoutput_bus
to (0, 0, 0, 1) (the 0 state) asynchronously if its value is 0.clock
: An object of typeWire
orClock
. The clock input.output_bus
: An object of typeBus4
. The one-hot output of the ring counter. Starts at (0, 0, 0, 1) and counts up to (1, 0, 0, 0).
Raises:
TypeError
: Ifoutput_bus
is not a bus of width 4.
__str__
Print out the wire values of the 4-bit ring counter.
enable: 0
clear_n: 0
clock: 0
output_bus: (0, 0, 0, 0)
__call__
__call__(
enable=None,
clear_n=None,
clock=None,
output_bus=None
)
Force specific values on the wires of the 4-bit ring counter.
Note that this method takes zero positional arguments; all values must be given as keyword arguments.
RingCounter8
__init__
__init__(
enable,
clear_n,
clock,
output_bus
)
Construct a new 8-bit ring counter.
Args:
enable
: An object of typeWire
. Enables the ring counter.clear_n
: An object of typeWire
. Clearsoutput_bus
to (0, 0, 0, 0, 0, 0, 0, 1) (the 0 state) asynchronously if its value is 0.clock
: An object of typeWire
orClock
. The clock input.output_bus
: An object of typeBus8
. The one-hot output of the ring counter. Starts at (0, 0, 0, 0, 0, 0, 0, 1) and counts up to (1, 0, 0, 0, 0, 0, 0, 0).
Raises:
TypeError
: Ifoutput_bus
is not a bus of width 8.
__str__
Print out the wire values of the 8-bit ring counter.
enable: 0
clear_n: 0
clock: 0
output_bus: (0, 0, 0, 0, 0, 0, 0, 0)
__call__
__call__(
enable=None,
clear_n=None,
clock=None,
output_bus=None
)
Force specific values on the wires of the 8-bit ring counter.
Note that this method takes zero positional arguments; all values must be given as keyword arguments.
RingCounter16
__init__
__init__(
enable,
clear_n,
clock,
output_bus
)
Construct a new 16-bit ring counter.
Args:
enable
: An object of typeWire
. Enables the ring counter.clear_n
: An object of typeWire
. Clearsoutput_bus
to (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1) (the 0 state) asynchronously if its value is 0.clock
: An object of typeWire
orClock
. The clock input.output_bus
: An object of typeBus16
. The one-hot output of the ring counter. Starts at (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1) and counts up to (1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0).
Raises:
TypeError
: Ifoutput_bus
is not a bus of width 16.
__str__
Print out the wire values of the 16-bit ring counter.
enable: 0
clear_n: 0
clock: 0
output_bus: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
__call__
__call__(
enable=None,
clear_n=None,
clock=None,
output_bus=None
)
Force specific values on the wires of the 16-bit ring counter.
Note that this method takes zero positional arguments; all values must be given as keyword arguments.
SerialToParallelConverter1To4
Class bw.state.SerialToParallelConverter1To4
Defined in bitwise/state/SIPO.py.
__init__
__init__(
enable,
clear_n,
data,
clock,
output_bus
)
Construct a new serial-to-4-bit-parallel converter.
Args:
enable
: An object of typeWire
. Enables the converter.clear_n
: An object of typeWire
. Clears all 4 internal registers to 0 asynchronously if its value is 0.data
: An object of typeWire
. The serial data input.clock
: An object of typeWire
orClock
. The clock input.output_bus
: An object of typeBus4
. The parallel output of the converter.output[0]
corresponds to the most recent serial data input.
Raises:
TypeError
: Ifoutput_bus
is not a bus of width 4.
__str__
Print out the wire values of the serial-to-4-bit-parallel converter.
enable: 0
clear_n: 0
data: 0
clock: 0
output_bus: (0, 0, 0, 0)
__call__
__call__(
enable=None,
clear_n=None,
data=None,
clock=None,
output_bus=None
)
Force specific values on the wires of the serial-to-4-bit-parallel converter.
Note that this method takes zero positional arguments; all values must be given as keyword arguments.
SerialToParallelConverter1To8
Class bw.state.SerialToParallelConverter1To8
Defined in bitwise/state/SIPO.py.
__init__
__init__(
enable,
clear_n,
data,
clock,
output_bus
)
Construct a new serial-to-8-bit-parallel converter.
Args:
enable
: An object of typeWire
. Enables the converter.clear_n
: An object of typeWire
. Clears all 8 internal registers to 0 asynchronously if its value is 0.data
: An object of typeWire
. The serial data input.clock
: An object of typeWire
orClock
. The clock input.output_bus
: An object of typeBus8
. The parallel output of the converter.output[0]
corresponds to the most recent serial data input.
Raises:
TypeError
: Ifoutput_bus
is not a bus of width 8.
__str__
Print out the wire values of the serial-to-8-bit-parallel converter.
enable: 0
clear_n: 0
data: 0
clock: 0
output_bus: (0, 0, 0, 0, 0, 0, 0, 0)
__call__
__call__(
enable=None,
clear_n=None,
data=None,
clock=None,
output_bus=None
)
Force specific values on the wires of the serial-to-8-bit-parallel converter.
Note that this method takes zero positional arguments; all values must be given as keyword arguments.
SerialToParallelConverter1To16
Class bw.state.SerialToParallelConverter1To16
Defined in bitwise/state/SIPO.py.
__init__
__init__(
enable,
clear_n,
data,
clock,
output_bus
)
Construct a new serial-to-16-bit-parallel converter.
Args:
enable
: An object of typeWire
. Enables the converter.clear_n
: An object of typeWire
. Clears all 16 internal registers to 0 asynchronously if its value is 0.data
: An object of typeWire
. The serial data input.clock
: An object of typeWire
orClock
. The clock input.output_bus
: An object of typeBus16
. The parallel output of the converter.output[0]
corresponds to the most recent serial data input.
Raises:
TypeError
: Ifoutput_bus
is not a bus of width 16.
__str__
Print out the wire values of the serial-to-16-bit-parallel converter.
enable: 0
clear_n: 0
data: 0
clock: 0
output_bus: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
__call__
__call__(
enable=None,
clear_n=None,
data=None,
clock=None,
output_bus=None
)
Force specific values on the wires of the serial-to-16-bit-parallel converter.
Note that this method takes zero positional arguments; all values must be given as keyword arguments.
ShiftRegister4
__init__
__init__(
enable,
clear_n,
shift_load,
data_bus,
data_serial,
clock,
output_bus,
output_serial
)
Construct a new 4-bit shift register.
Args:
enable
: An object of typeWire
. Enables the shift register.clear_n
: An object of typeWire
. Clearsoutput_bus
andoutput_serial
to 0 asynchronously if its value is 0.shift_load
: An object of typeWire
. The mode select. A value of 0 indicates a parallel load operation, whereoutput_bus
takes on the value ofdata_bus
. A value of 1 indicates a shift-right operation, whereoutput_bus[3]
takes on the value ofoutput_bus[2]
,output_bus[2]
takes on the value ofoutput_bus[1]
, and so on;output_bus[0]
takes on the value ofdata_serial
.data_bus
: An object of typeBus4
. The parallel data input.data_serial
. An object of typeWire
. The serial data input.clock
. An object of typeWire
orClock
. The clock input to the shift register.output_bus
. An object of typeBus4
. The parallel data output.output_serial
. An object of typeWire
. The serial data output. Identical tooutput_bus[3]
.
Raises:
TypeError
: If eitherdata_bus
oroutput_bus
is not a bus of width 4.
__str__
Print out the wire values of the 4-bit shift register.
enable: 0
clear_n: 0
shift_load: 0
data_bus: (0, 0, 0, 0)
data_serial: 0
clock: 0
output_bus: (0, 0, 0, 0)
output_serial: 0
__call__
__call__(
enable=None,
clear_n=None,
shift_load=None,
data_bus=None,
data_serial=None,
clock=None,
output_bus=None,
output_serial=None
)
Force specific values on the wires of the 4-bit shift register.
Note that this method takes zero positional arguments; all values must be given as keyword arguments.
ShiftRegister8
__init__
__init__(
enable,
clear_n,
shift_load,
data_bus,
data_serial,
clock,
output_bus,
output_serial
)
Construct a new 8-bit shift register.
Args:
enable
: An object of typeWire
. Enables the shift register.clear_n
: An object of typeWire
. Clearsoutput_bus
andoutput_serial
to 0 asynchronously if its value is 0.shift_load
: An object of typeWire
. The mode select. A value of 0 indicates a parallel load operation, whereoutput_bus
takes on the value ofdata_bus
. A value of 1 indicates a shift-right operation, whereoutput_bus[7]
takes on the value ofoutput_bus[6]
,output_bus[6]
takes on the value ofoutput_bus[5]
, and so on;output_bus[0]
takes on the value ofdata_serial
.data_bus
: An object of typeBus8
. The parallel data input.data_serial
. An object of typeWire
. The serial data input.clock
. An object of typeWire
orClock
. The clock input to the shift register.output_bus
. An object of typeBus8
. The parallel data output.output_serial
. An object of typeWire
. The serial data output. Identical tooutput_bus[7]
.
Raises:
TypeError
: If eitherdata_bus
oroutput_bus
is not a bus of width 8.
__str__
Print out the wire values of the 8-bit shift register.
enable: 0
clear_n: 0
shift_load: 0
data_bus: (0, 0, 0, 0, 0, 0, 0, 0)
data_serial: 0
clock: 0
output_bus: (0, 0, 0, 0, 0, 0, 0, 0)
output_serial: 0
__call__
__call__(
enable=None,
clear_n=None,
shift_load=None,
data_bus=None,
data_serial=None,
clock=None,
output_bus=None,
output_serial=None
)
Force specific values on the wires of the 8-bit shift register.
Note that this method takes zero positional arguments; all values must be given as keyword arguments.
ShiftRegister16
__init__
__init__(
enable,
clear_n,
shift_load,
data_bus,
data_serial,
clock,
output_bus,
output_serial
)
Construct a new 16-bit shift register.
Args:
enable
: An object of typeWire
. Enables the shift register.clear_n
: An object of typeWire
. Clearsoutput_bus
andoutput_serial
to 0 asynchronously if its value is 0.shift_load
: An object of typeWire
. The mode select. A value of 0 indicates a parallel load operation, whereoutput_bus
takes on the value ofdata_bus
. A value of 1 indicates a shift-right operation, whereoutput_bus[15]
takes on the value ofoutput_bus[14]
,output_bus[14]
takes on the value ofoutput_bus[13]
, and so on;output_bus[0]
takes on the value ofdata_serial
.data_bus
: An object of typeBus16
. The parallel data input.data_serial
. An object of typeWire
. The serial data input.clock
. An object of typeWire
orClock
. The clock input to the shift register.output_bus
. An object of typeBus16
. The parallel data output.output_serial
. An object of typeWire
. The serial data output. Identical tooutput_bus[15]
.
Raises:
TypeError
: If eitherdata_bus
oroutput_bus
is not a bus of width 16.
__str__
Print out the wire values of the 16-bit shift register.
enable: 0
clear_n: 0
shift_load: 0
data_bus: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
data_serial: 0
clock: 0
output_bus: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
output_serial: 0
__call__
__call__(
enable=None,
clear_n=None,
shift_load=None,
data_bus=None,
data_serial=None,
clock=None,
output_bus=None,
output_serial=None
)
Force specific values on the wires of the 16-bit shift register.
Note that this method takes zero positional arguments; all values must be given as keyword arguments.
UpCounterMod4
Class bw.state.UpCounterMod4
Defined in bitwise/state/COUNT.py.
2-bit (mod-4) up counter with asynchronous clear.
__init__
__init__(
enable,
clear_n,
clock,
output_1,
output_2
)
Construct a new mod-4 up counter.
Args:
enable
: An object of typeWire
. Enables the counter.clear_n
: An object of typeWire
. Clearsoutput_1
andoutput_2
to 0 asynchronously if its value is 0.clock
: An object of typeWire
orClock
. The clock input to the counter.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.
__str__
Print out the wire values of the mod-4 up counter.
enable: 0
clear_n: 0
clock: 0
output_1: 0
output_2: 0
__call__
__call__(
enable=None,
clear_n=None,
clock=None,
output_1=None,
output_2=None
)
Force specific values on the wires of the mod-4 up counter.
Note that this method takes zero positional arguments; all values must be given as keyword arguments.
UpCounterMod8
Class bw.state.UpCounterMod8
Defined in bitwise/state/COUNT.py.
3-bit (mod-8) up counter with asynchronous clear.
__init__
__init__(
enable,
clear_n,
clock,
output_1,
output_2,
output_3
)
Construct a new mod-8 up counter.
Args:
enable
: An object of typeWire
. Enables the counter.clear_n
: An object of typeWire
. Clearsoutput_1
,output_2
, andoutput_3
to 0 asynchronously if its value is 0.clock
: An object of typeWire
orClock
. The clock input to the counter.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.
__str__
Print out the wire values of the mod-8 up counter.
enable: 0
clear_n: 0
clock: 0
output_1: 0
output_2: 0
output_3: 0
__call__
__call__(
enable=None,
clear_n=None,
clock=None,
output_1=None,
output_2=None,
output_3=None
)
Force specific values on the wires of the mod-8 up counter.
Note that this method takes zero positional arguments; all values must be given as keyword arguments.
UpCounterMod16
Class bw.state.UpCounterMod16
Defined in bitwise/state/COUNT.py.
4-bit (mod-16) up counter with asynchronous clear.
__init__
__init__(
enable,
clear_n,
clock,
output_bus
)
Construct a new mod-16 up counter.
Args:
enable
: An object of typeWire
. Enables the counter.clear_n
: An object of typeWire
. Clearsoutput_bus
to 0 asynchronously if its value is 0.clock
: An object of typeWire
or`Clock
. The clock input to the counter.output_bus
: An object of typeBus4
. The output of the counter.output_bus[0]
andoutput_bus[3]
are the most and least significant bit, respectively.
Raises:
TypeError
: Ifoutput_bus
is not a bus of width 4.
__str__
Print out the wire values of the mod-16 up counter.
enable: 0
clear_n: 0
clock: 0
output_bus: (0, 0, 0, 0)
__call__
__call__(
enable=None,
clear_n=None,
clock=None,
output_bus=None
)
Force specific values on the wires of the mod-16 up counter.
Note that this method takes zero positional arguments; all values must be given as keyword arguments.