Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -39,6 +39,44 @@ A complete 8-bit processor where every operation—from Boolean logic to arithme
|
|
| 39 |
|
| 40 |
---
|
| 41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
## Circuit Categories
|
| 43 |
|
| 44 |
| Category | Circuits | Examples |
|
|
@@ -84,27 +122,27 @@ The model includes `iron_eval.py` which exhaustively tests all circuits:
|
|
| 84 |
|
| 85 |
```bash
|
| 86 |
python iron_eval.py
|
| 87 |
-
# Output: Fitness: 1.000000
|
| 88 |
```
|
| 89 |
|
| 90 |
### Verification Status
|
| 91 |
|
| 92 |
| Category | Status | Notes |
|
| 93 |
|----------|--------|-------|
|
| 94 |
-
| Boolean gates |
|
| 95 |
-
| Arithmetic |
|
| 96 |
-
| ALU |
|
| 97 |
-
| Control flow |
|
| 98 |
-
| Threshold |
|
| 99 |
-
|
|
| 100 |
-
|
|
| 101 |
-
| Modular (mod 2,4,8) |
|
| 102 |
|
| 103 |
The modular arithmetic circuits for non-powers-of-2 and the parity circuits were hand-constructed because:
|
| 104 |
- Divisibility by 3, 5, etc. is **not linearly separable** in binary
|
| 105 |
- 8-bit parity (XOR of all bits) requires a tree of XOR gates
|
| 106 |
|
| 107 |
-
|
| 108 |
|
| 109 |
---
|
| 110 |
|
|
@@ -137,8 +175,9 @@ All weights are integers. All activations are Heaviside step. Designed for:
|
|
| 137 |
|
| 138 |
| File | Description |
|
| 139 |
|------|-------------|
|
| 140 |
-
| `neural_computer.safetensors` |
|
| 141 |
-
| `iron_eval.py` | Comprehensive test suite
|
|
|
|
| 142 |
|
| 143 |
---
|
| 144 |
|
|
@@ -164,5 +203,5 @@ MIT
|
|
| 164 |
|
| 165 |
## Links
|
| 166 |
|
| 167 |
-
- [Coq Proofs](https://github.com/CharlesCNorton/coq-circuits) —
|
| 168 |
- [HuggingFace](https://huggingface.co/phanerozoic) — Other models
|
|
|
|
| 39 |
|
| 40 |
---
|
| 41 |
|
| 42 |
+
## Background
|
| 43 |
+
|
| 44 |
+
### Threshold Logic
|
| 45 |
+
|
| 46 |
+
A threshold gate computes a Boolean function by taking a weighted sum of binary inputs and comparing it to a threshold. If the sum meets or exceeds the threshold, the output is 1; otherwise, 0. This can be expressed as a neuron with Heaviside step activation: `output = 1 if (Σ wᵢxᵢ + b) ≥ 0 else 0`, where weights `wᵢ` and bias `b` are integers.
|
| 47 |
+
|
| 48 |
+
Threshold gates are strictly more powerful than standard Boolean gates. A single threshold gate can compute any linearly separable Boolean function—this includes AND, OR, NAND, NOR, and many others that require multiple levels of conventional gates. Functions that are not linearly separable (such as XOR or parity) require multiple threshold gates arranged in layers.
|
| 49 |
+
|
| 50 |
+
### Historical Development
|
| 51 |
+
|
| 52 |
+
Warren McCulloch and Walter Pitts introduced the threshold neuron model in 1943, proving that networks of such neurons could compute any Boolean function. This work preceded both the perceptron and modern neural networks, establishing the theoretical foundation for neural computation.
|
| 53 |
+
|
| 54 |
+
The 1960s saw significant development in threshold logic synthesis. Researchers including Saburo Muroga, Robert McNaughton, and Michael Dertouzos developed algebraic methods for determining whether a Boolean function could be implemented as a single threshold gate, and if so, how to calculate appropriate weights. This work produced systematic techniques for threshold gate design but focused on individual gates rather than complete systems.
|
| 55 |
+
|
| 56 |
+
Frank Rosenblatt's Mark I Perceptron (1957-1960) implemented threshold neurons in hardware using potentiometers for weights, but it was a pattern classifier that learned its weights through training—the final weight configurations were not published. Bernard Widrow's ADALINE and MADALINE systems (1960-1963) similarly used adaptive threshold elements with weights learned via the LMS algorithm.
|
| 57 |
+
|
| 58 |
+
Hava Siegelmann and Eduardo Sontag proved in the 1990s that recurrent neural networks are Turing complete. Their construction, however, relied on continuous sigmoid activation functions with infinite precision—not the discrete step function used in threshold logic. Other theoretical work on neural Turing machines and differentiable computers followed similar patterns: proving computational universality using continuous, differentiable activations suitable for gradient-based training.
|
| 59 |
+
|
| 60 |
+
### Neuromorphic Hardware
|
| 61 |
+
|
| 62 |
+
Modern neuromorphic processors implement large arrays of configurable threshold-like neurons in silicon:
|
| 63 |
+
|
| 64 |
+
**Intel Loihi** (2017) provides 128 neuromorphic cores with programmable synaptic weights, spike-based communication, and on-chip learning. The architecture supports integer weights and configurable neuron dynamics.
|
| 65 |
+
|
| 66 |
+
**IBM TrueNorth** (2014) integrates one million neurons and 256 million synapses in a 4096-core array. Each neurosynaptic core implements 256 neurons with configurable weights and thresholds. The chip was designed as an alternative to von Neumann architecture rather than an implementation of one.
|
| 67 |
+
|
| 68 |
+
**BrainChip Akida** (2021) targets edge deployment with event-based processing and integer weights. The architecture supports standard neural network operations mapped onto neuromorphic primitives.
|
| 69 |
+
|
| 70 |
+
**SpiNNaker** (University of Manchester) uses ARM processor cores to simulate spiking neural networks at scale. The platform has hosted various neural models but is simulation-based rather than native neuromorphic silicon.
|
| 71 |
+
|
| 72 |
+
Despite the availability of these platforms, published work has focused on neural network inference, sensory processing, and pattern recognition. A 2024 paper demonstrated basic logic gates, adders, and decoders on SpiNNaker and Dynap-SE1, describing this as "a first step toward the construction of a spiking computer"—the implementation lacked instruction fetch, program counter, memory systems, and control logic.
|
| 73 |
+
|
| 74 |
+
### This Implementation
|
| 75 |
+
|
| 76 |
+
The weights in this repository implement a complete 8-bit computer: registers, ALU with 16 operations, status flags, conditional branching, subroutine calls, stack operations, and memory access. Every component is built from threshold neurons with integer weights. The weight configurations are published in safetensors format for direct loading and deployment.
|
| 77 |
+
|
| 78 |
+
---
|
| 79 |
+
|
| 80 |
## Circuit Categories
|
| 81 |
|
| 82 |
| Category | Circuits | Examples |
|
|
|
|
| 122 |
|
| 123 |
```bash
|
| 124 |
python iron_eval.py
|
| 125 |
+
# Output: Fitness: 1.000000
|
| 126 |
```
|
| 127 |
|
| 128 |
### Verification Status
|
| 129 |
|
| 130 |
| Category | Status | Notes |
|
| 131 |
|----------|--------|-------|
|
| 132 |
+
| Boolean gates | Exhaustively tested | Coq proofs available |
|
| 133 |
+
| Arithmetic | Exhaustively tested | Coq proofs available |
|
| 134 |
+
| ALU | Exhaustively tested | Coq proofs available |
|
| 135 |
+
| Control flow | Exhaustively tested | Coq proofs available |
|
| 136 |
+
| Threshold | Exhaustively tested | Coq proofs available |
|
| 137 |
+
| Modular (mod 3,5,6,7,9,10,11,12) | Exhaustively tested | Multi-layer, hand-constructed |
|
| 138 |
+
| Parity | Exhaustively tested | XOR tree, hand-constructed |
|
| 139 |
+
| Modular (mod 2,4,8) | Exhaustively tested | Single-layer, trivial |
|
| 140 |
|
| 141 |
The modular arithmetic circuits for non-powers-of-2 and the parity circuits were hand-constructed because:
|
| 142 |
- Divisibility by 3, 5, etc. is **not linearly separable** in binary
|
| 143 |
- 8-bit parity (XOR of all bits) requires a tree of XOR gates
|
| 144 |
|
| 145 |
+
All circuits pass exhaustive testing over their full input domains.
|
| 146 |
|
| 147 |
---
|
| 148 |
|
|
|
|
| 175 |
|
| 176 |
| File | Description |
|
| 177 |
|------|-------------|
|
| 178 |
+
| `neural_computer.safetensors` | 3,122 tensors, 5,648 parameters |
|
| 179 |
+
| `iron_eval.py` | Comprehensive test suite |
|
| 180 |
+
| `prune_weights.py` | Weight optimization tool |
|
| 181 |
|
| 182 |
---
|
| 183 |
|
|
|
|
| 203 |
|
| 204 |
## Links
|
| 205 |
|
| 206 |
+
- [Coq Proofs](https://github.com/CharlesCNorton/coq-circuits) — Formal verification for core circuits
|
| 207 |
- [HuggingFace](https://huggingface.co/phanerozoic) — Other models
|