Transistor is an attempt to make a high-performance digital logic simulator that can be used in an educational context to showcase the complex circuitry behind the concepts taught in computer architecure classes. It uses SFML for Graphics and nlohmann's JSON library for saving circuits.
Building this project requires CMake. In most cases you should be able to configure and build the project with
cmake -S . --preset default
cmake --build build
The build output can be found in build/src/
. The exact location of the binary depends on your generator
By default, Transistor will attempt to open a the file data/world.json
. This can be overridden by passing a path as an argument when executing Transistor:
./Transistor path/to/world.json
The basic controls of Transistor are as follows:
Up/Down Arrow
increases/decreases the number of output pins respectivelyAlt +Up/Down Arrow
increases/decreases the number of input pins respectivelyControl+C
/Control+V
copies/pastes the selected circuits respectivelyDelete
deletes the selected circuits
Primitive gates can be dragged and dropped into the world from the top bar.
Custom circuits are loaded from a a JSON file in the data
folder. In general, if you have a file data/xxx.json
, it corresponds to the custom circuit type xxx
. Currently there is no way to add custom circuits in Transistor through the GUI, requiring some manual text editing:
- Open a circuit file in the
data
folder, e.g.data/my_custom_circuit.json
- Edit the circuit as you see fit
- In a different circuit file, manually add the custom circuit in the file by using the format:
{
"id": "<some-id-here>",
"type": "my_custom_circuit",
"position": { "x": 0, "y": 0 }
}
- Once loaded into the world, you can use copy-paste to retrieve multiple circuits