Skip to content

KARAN-D05/Gate-Level-Perceptron

Repository files navigation

🔍 Gate Level Perceptron

🔁 Stage 2: Cybernetic Adaptive Learning System

  • This project constructs a self-learning pattern recognition engine using discrete logic gates. Project will evolve from strict boolean matching to score-based decision-making to feedback-driven adaptive learning system and further to eventually a Hardware perceptron.

  • Progress:Implemented a Cybernetic feedback-driven adaptive learning binary-classifier that based on error input autonomously alter its decision boundary by implementing Max-Initialized Decremental Search (MIDS) and resets the control loop for repeated adaptive cycles.

Adaptive Learning Demonstration

🤖 Cybernetic adaptive learning system implementing MIDS algorithm (Detector_v1.1)

⚙️ Implementation Stack

Verilog Logisim Circuits

📈 Planned Progression

  • Stage 0 (v0.x): Strict Boolean pattern relation analyzer. No learning, no noise tolerance, decision boundaries fixed by structural wiring.
  • Stage 1 (v1.0): Popcount based similarity and a variable threshold to alter the decision boundary. Introduces noise tolerance and ability to change the decision output without structural changes.
  • Stage 2 (v1.1): Cybernetic Feedback-driven adaptive learning. System alters its decision boundary based on external feedback to correct its decision output.
  • Stage 3 (v2.x): A System that generalizes on training data and based on that makes decisions about unseen data.

🧱 Versions Built

  • Version 0: A pattern relation analyzer that classifies how an input pattern relates to a stored pattern, enforces rule based recognition rather than learning.

    • Detector_v0.0 -> Recognizes the exact pattern and sub-patterns if they are inside the boundary set up by weights-grid.
    • Detector v0.1 -> Recognizes the exact pattern and super-patterns if they are outside the boundary set up by weights-grid.
    • Detector v0.2 -> Classifies the input as a sub-pattern, super-pattern, anti-pattern or equivalence precisely through a 2-POV logical analysis.
  • Version 1: Pop-count based judgement against a variable Threshold instead of perfect equivalence check and cybernetic feedback-driven adaptive learning.

    • Detector_v1.0 -> Recognizes the pattern if total number of matched pixels are greater than the set threshold which can vary giving us ability to control the decision output.
    • Detector_v1.1 -> A feedback-driven adaptive system that autonomously adjusts its decision boundary to correct its output, using algorithms optimized for hardware constraints.

Block-Diagram

🧩 Block Diagram - Detector_v1.0 (Manually Alterable Decision Boundary)

🧠 Adaptive Learning Algorithms

Property MIDS SATU
Correction Speed O(N) O(1)
State Awareness None Current & desired output
Direction Always starts from max, decrements Sets to M or M-1 as needed
Initialization Bias Instant correction for false positives None
Hardware Complexity Low - decrementer only Higher - decrementer + decision logic
Area Minimal Larger
Guaranteed Convergence Yes Yes

🎯 Convergence Proofs

Correction Speeds

⏱️ Correction Speed Complexity Comparison

💻 Verilog Implementation

🎯 Strict Boolean Matching

Pattern Detector Output

Equivalence & Sub-Pattern Recognition 🔹

Pattern Detector Output

Equivalence & Super-Pattern Recognition 🟦

Pattern Detector Output

Equivalence & Super & Sub & Anti-Pattern Recognition 🔹🟦

🔄 Popcount-Based Adaptive Learning

Pattern Detector Output

Manually Alterable Decision Boundary ⚖️

🛠️Current Development:

  • Cybernetic Feedback-driven adaptive learning system implementing MIDS algorithm Developed✓

⬇️ Download This Repository

🪟 Windows

Download → download_repos.bat

Double-click it and pick the repo(s) you want.

🐧 Linux / macOS

Download → download_repos.sh

bash

chmod +x download_repos.sh
./download_repos.sh

Always downloads the latest version.

🛠️ Toolchain & Repo Utilities - Built to make navigating and interacting with this repo easier

💻 Terminal-Based Manual

This project includes a built-in reference manual for the detector architecture that can be queried directly from your terminal. View full manual: detector-manual

Linux / Mac:

curl -O https://raw.githubusercontent.com/KARAN-D05/Gate-Level-Perceptron/main/detector-manual/run-detector-manual.sh
chmod +x run-detector-manual.sh
./run-detector-manual.sh

Windows:

Invoke-WebRequest -Uri "https://raw.githubusercontent.com/KARAN-D05/Gate-Level-Perceptron/main/detector-manual/run-detector-manual.ps1" -OutFile "run-detector-manual.ps1"
powershell -ExecutionPolicy Bypass -File run-detector-manual.ps1

🔧 portmap - Verilog Port Extractor

portmap is a lightweight CLI tool that extracts port definitions (input, output, inout) from Verilog modules and presents them in a clean table or Markdown format.

🔗 Source

https://github.com/KARAN-D05/portmap-HDL/blob/main/utils/portmap

📦 Release (Download Binary)

https://github.com/KARAN-D05/portmap-HDL/releases/tag/v1.0.0

🚀 Usage

portmap file.v
portmap file.v --md

🧰 Repo Filetree Generator

Filetree - A repository file tree generator that prints a visual directory tree with file-type icons and a file count breakdown by extension (.v, .circ, .md, .py and more).

Utils (Portmap + Filetree)- Fetched automatically as a utils package alongside any repo download - includes portmap binaries, filetree, and source code via download_repos.bat / download_repos.sh.

📜License

  • Source code and HDL files are licensed under the MIT License.
  • Documentation, diagrams, images, and PDFs are licensed under Creative Commons Attribution 4.0 (CC BY 4.0).

About

This project explores how adaptive behavior and learning-like dynamics can emerge from purely deterministic gate-level systems. It evolves from strict Boolean matching to score-based decision making, culminating in a cybernetic feedback-driven adaptive learning system, with perceptron-style development as future work 🤖.

Topics

Resources

License

Stars

Watchers

Forks

Contributors