Pylectronics
Reproduce digital electronics in Python
Report Bug · Request Feature
Table of Contents
About The Project
This project is an attempt to reproduce digital electronics in Python. Its ultimate goal is to be able to build an actual CPU by simulating the core components of a real, physical, processor (using Transistors to build Logic Gates, using Logic Gates to build a Half Adder, using Half Adders to build Full Adders, and so on and so forth...).
By adding more components to the project, you will be helping achieve that goal!
Getting Started
Prerequisites
Make sure you have virtualenv and Poetry installed.
Installation
- Clone the repo
git clone https://github.com/fgarci03/pylectronics.git
- Create the virtualenv
virtualenv venv
- Use it
source venv/bin/activate
- Install packages
poetry install
Usage
The project is yet in its infancy, so there is not much to show for apart from some components.
Coding Guidelines
This project uses Black, Prospector, and Pytest. It is set to enforce all the linting rules and 100% test coverage when running:
./run_tests.sh
Roadmap
See the open issues for a list of proposed features (and known issues).
It's tough to provide a real roadmap at this stage, since I'm still learning about digital electronics. Nonetheless, there are a few concepts that should be thought about to allow the project to grow:
- Memory: All computers need memory. Whether D-Type FlipFlops, or SR Latches, we will need these components to build more complex components...
- ...such as registers!
- Speaking of memory... We need to build the concept of time!
- Unified Interfaces: It would be nice to have some utilities baked into all the components that can give us some stats:
- Number of Transistors in this component
- Total Number of Transistors,
- Timing functions to measure performance
- Etc
- and more!
Contributing
Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Do your magic
- Make sure tests pass with 100% coverage, as well as static validation (
./run_tests.sh
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
License
Distributed under the MIT License. See LICENSE
for more information.
Contact
Filipe Garcia - https://filipe-garcia.com
Project Link: https://github.com/fgarci03/pylectronics