Reproduce digital electronics in Python

Overview

Forks Stargazers Issues MIT License


Pylectronics

Reproduce digital electronics in Python

Report Bug · Request Feature

Table of Contents

  1. About The Project
  2. Getting Started
  3. Usage
  4. Coding Guidelines
  5. Roadmap
  6. Contributing
  7. License
  8. Contact

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

  1. Clone the repo
    git clone https://github.com/fgarci03/pylectronics.git
  2. Create the virtualenv
    virtualenv venv
  3. Use it
    source venv/bin/activate
  4. 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...
  • 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.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Do your magic
  4. Make sure tests pass with 100% coverage, as well as static validation (./run_tests.sh)
  5. Commit your Changes (git commit -m 'Add some AmazingFeature')
  6. Push to the Branch (git push origin feature/AmazingFeature)
  7. 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

You might also like...
Python with braces. Because Python is awesome, but whitespace is awful.

Bython Python with braces. Because Python is awesome, but whitespace is awful. Bython is a Python preprosessor which translates curly brackets into in

PSP (Python Starter Package) is meant for those who want to start coding in python but are new to the coding scene.

Python Starter Package PSP (Python Starter Package) is meant for those who want to start coding in python, but are new to the coding scene. We include

Py-Parser est un parser de code python en python encore en plien dévlopement.

PY - PARSER Py-Parser est un parser de code python en python encore en plien dévlopement. Une fois achevé, il servira a de nombreux projets comme glad

Simple, high-school-leveled sequence library written in Python / 간단한 고등학교 수준 수열 라이브러리 (Python)
A community based economy bot with python works only with python 3.7.8 as web3 requires cytoolz

A community based economy bot with python works only with python 3.7.8 as web3 requires cytoolz has some issues building with python 3.10

A python script based on OpenCV-Python, you can automatically hang up the Destiny 2 Throne to get the Dawning  Essence.
A python script based on OpenCV-Python, you can automatically hang up the Destiny 2 Throne to get the Dawning Essence.

A python script based on OpenCV-Python, you can automatically hang up the Destiny 2 Throne to get the Dawning Essence.

Run python scripts and pass data between multiple python and node processes using this npm module

Run python scripts and pass data between multiple python and node processes using this npm module. process-communication has a event based architecture for interacting with python data and errors inside nodejs.

inverted pendulum fuzzy control python code (python 2.7.18)
inverted pendulum fuzzy control python code (python 2.7.18)

inverted-pendulum-fuzzy-control- inverted pendulum fuzzy control python code (python 2.7.18) We have 3 general functions for 3 main steps: fuzzificati

Izy - Python functions and classes that make python even easier than it is

izy Python functions and classes that make it even easier! You will wonder why t

Comments
  • Unified interface with stats

    Unified interface with stats

    I believe it would be nice (and educational), if all components shared an interface that could be used to determine some stats about the running circuit.

    For example:

    • how many transistors are used in this component?
    • how many transistors are used in the whole circuit?
    • how long does a clock cycle take?
    • how many cycles a specific operation takes?
    • etc...
    enhancement 
    opened by fgarci03 0
  • Concept of Time

    Concept of Time

    The concept of memory can only exist if we have a concept of time.

    At the moment tests are simply testing components in a static fashion, but when dealing with components that have memory, we will probably need to have some sort of clocking mechanism to simulate the passage of time inside the CPU.

    I was thinking of a very basic infinite loop that would change a global variable CLOCK (alternating between 0 and 1), which would feed any memory-related component (such as FlipFlops, Registers, etc).

    How could something like this be implemented, looking at the ultimate goal of building an actual CPU?

    help wanted 
    opened by fgarci03 6
Owner
Filipe Garcia
Filipe Garcia
Purge your likes and wall comments from VKontakte. Set yourself free from your digital footprint.

vk_liberator Regain liberty in the cruel social media world. This program assists you with purging your metadata from Russian social network VKontakte

null 20 Jun 11, 2021
Various hdas (Houdini Digital Assets)

aaTools My various assets for Houdini "ms_asset_loader" - Custom importer assets from Quixel Bridge "asset_placer" - Tool for placment sop geometry on

null 9 Dec 19, 2022
DSG - Source code for Digital Scholarship Grant project.

DSG Source code for Dr. Stephanie Tsang's Digital Scholarship Grant project. Work performed by Mr. Wang Minghao while as her Research Assistant. The s

null 1 Jan 4, 2022
The RAP community of practice includes all analysts and data scientists who are interested in adopting the working practices included in reproducible analytical pipelines (RAP) at NHS Digital.

The RAP community of practice includes all analysts and data scientists who are interested in adopting the working practices included in reproducible analytical pipelines (RAP) at NHS Digital.

NHS Digital 50 Dec 22, 2022
Audio2Face - a project that transforms audio to blendshape weights,and drives the digital human,xiaomei,in UE project

Audio2Face - a project that transforms audio to blendshape weights,and drives the digital human,xiaomei,in UE project

FACEGOOD 732 Jan 8, 2023
Todos os exercícios do Curso de Python, do canal Curso em Vídeo, resolvidos em Python, Javascript, Java, C++, C# e mais...

Exercícios - CeV Oferecido por Linguagens utilizadas atualmente O que vai encontrar aqui? ?? Esse repositório é dedicado a armazenar todos os enunciad

Coding in Community 43 Nov 10, 2022
PyDy, short for Python Dynamics, is a tool kit written in the Python

PyDy, short for Python Dynamics, is a tool kit written in the Python programming language that utilizes an array of scientific programs to enable the study of multibody dynamics. The goal is to have a modular framework and eventually a physics abstraction layer which utilizes a variety of backends that can provide the user with their desired workflow

PyDy 307 Jan 1, 2023
A Python script made for the Python Discord Pixels event.

Python Discord Pixels A Python script made for the Python Discord Pixels event. Usage Create an image.png RGBA image with your pattern. Transparent pi

Stanisław Jelnicki 4 Mar 23, 2022
this is a basic python project that I made using python

this is a basic python project that I made using python. This project is only for practice because my python skills are still newbie.

Elvira Firmansyah 2 Dec 14, 2022
Analisador de strings feito em Python // String parser made in Python

Este é um analisador feito em Python, neste programa, estou estudando funções e a sua junção com "if's" e dados colocados pelo usuário. Neste código,

Dev Nasser 1 Nov 3, 2021