PLAsimulator is a Programmable Logic Array simulator written in Python 2.7/3.
Necessary to rebuild the documentation:
Just clone the repo
git clone https://github.com/teoc98/PLAsimulator.git
python pla.py [-x x_size][-i n_inputs][-o n_outputs][-a n_and]
Options:
-h, --help
: show help message and exit-x <x_size>
: window width in pixels-i <n_inputs>
: number of input pins-o <n_outputs>
: number of output pins (equal to the number of OR gates)-a <n_and>
: number of AND gates
For more examples, please refer to the Documentation
The built-in circuits library contains by default the following circuits:
- 1 bit half adder
- 1 bit full adder
- 2 bit adder
- 6-bit ones' complement
- 4-bit twos' complement
- 2 bit multiplicator
- 6 bit square root floor
- reductor 3-2
- multiple logic gate
- priority encoder
- multiplexer
- majority
- decoder
- decoder 4 bit - 7 segment
- shift register
- comparator
- one step flip-flop SR
- one step flip-flop T
- one step flip-flop JK
- Parity check (CRC-1)
- CRC-3-GSM
Where the CRC code generator polynomial are:
It is possible to extend the circuits library by creating new Circuit
objects, using standard NumPy matrix notation.
To create a new circuit from a boolean function it is possible to use the following functions:
generate_code(name, description, function, input_names, output_names)
generate_obj(description, function, input_names, output_names)
Function generate_code
prints the code to paste into the module, while function generate_obj
returns a new Circuit
object.
Parameters:
function
must be a function that accepts as input a booleann_i
-tuple and returns a booleann_o
-tuple;input_names
must be a tuple ofn_i
strings;output_names
must be a tuple ofn_o
strings.
Please note that in order to add a circuit to the simulator circuit library, is necessary to add it to list circs
in module circuits.py
.
Unfortunately most of the user guide and documentation is in Italian only.
- Project webpage: https://matteo.ga/pla/
- First version webpage by Alice Plebe: https://www.dmi.unict.it/scollo/slidy/share/simulators/PLA_simulator_1_0/index-en.html
Distributed under the GNU General Public License (GNU GPL) version 3. See LICENSE
for more information.