CharlesCNorton commited on
Commit
fa97c7c
·
1 Parent(s): 6087b2e

Update README: reflect implemented MUL, DIV, SHL, SHR, comparators

Browse files
Files changed (1) hide show
  1. README.md +9 -9
README.md CHANGED
@@ -17,8 +17,8 @@ tags:
17
  Every logic gate is a threshold neuron: `output = 1 if (Σ wᵢxᵢ + b) ≥ 0 else 0`
18
 
19
  ```
20
- Tensors: 9,429
21
- Parameters: 8,286,614
22
  ```
23
 
24
  ---
@@ -453,15 +453,15 @@ The interface generalizes to **all** 65,536 8-bit additions once trained—no me
453
 
454
  2. **8-bit subtraction (0-255)** — Two's complement via NOT gates on second operand + carry-in of 1. Reuses adder circuit. Handles negative results as unsigned wrap (200 - 250 = 206). Circuit exists and verified.
455
 
456
- 3. **8-bit multiplication** — Requires array of AND gates for partial products + adder tree to sum them. 8×8 produces 16-bit result; can truncate to low 8 bits or preserve full width. Circuit NOT yet implemented.
457
 
458
- 4. **8-bit division with remainder** — Restoring or non-restoring division via subtract-and-shift. Produces 8-bit quotient + 8-bit remainder. Most complex circuit; ~64 subtractors + muxes. NOT yet implemented.
459
 
460
  5. **Bitwise AND, OR, XOR, NOT** — 8 parallel single-layer threshold gates per operation. AND: w=[1,1], b=-2. OR: w=[1,1], b=-1. XOR: 2-layer (OR+NAND→AND). All circuits exist and verified.
461
 
462
- 6. **Bit shifts (left, right)** — Hardwired routing, not computation. SHL: bit[i] bit[i-1], inject 0 at LSB. SHR: bit[i] bit[i+1], inject 0 at MSB. Can implement as identity gates with shifted wiring. NOT yet implemented.
463
 
464
- 7. **Comparisons (>, <, >=, <=, ==)** — Single-layer threshold gates on 16 inputs (8 bits from A, 8 from B). Learned weights encode lexicographic comparison. All 5 comparators exist and verified on 48 test pairs.
465
 
466
  8. **Divisibility testing (mod 2-12)** — Powers of 2 (mod 2,4,8): single-layer, check relevant bits. Non-powers (mod 3,5,6,7,9,10,11,12): multi-layer circuits encoding residue classes. All 11 circuits exist and exhaustively verified 0-255.
467
 
@@ -477,10 +477,10 @@ The interface generalizes to **all** 65,536 8-bit additions once trained—no me
477
 
478
  | File | Description |
479
  |------|-------------|
480
- | `neural_computer.safetensors` | 9,429 tensors, 8,286,614 parameters |
481
  | `threshold_cpu.py` | CPU state, reference cycle, threshold runtime |
482
- | `eval.py` | Unified evaluation suite (5,282 tests, GPU-batched) |
483
- | `build.py` | Build tools for memory circuits and .inputs tensors |
484
  | `prune_weights.py` | Weight magnitude pruning |
485
 
486
  ---
 
17
  Every logic gate is a threshold neuron: `output = 1 if (Σ wᵢxᵢ + b) ≥ 0 else 0`
18
 
19
  ```
20
+ Tensors: 10,399
21
+ Parameters: 8,288,256
22
  ```
23
 
24
  ---
 
453
 
454
  2. **8-bit subtraction (0-255)** — Two's complement via NOT gates on second operand + carry-in of 1. Reuses adder circuit. Handles negative results as unsigned wrap (200 - 250 = 206). Circuit exists and verified.
455
 
456
+ 3. **8-bit multiplication** — 64 AND gates for partial products P[i][j] = A[i] AND B[j]. Uses shift-add accumulation via existing 8-bit adder. Returns low 8 bits of 16-bit result. Circuit exists and verified.
457
 
458
+ 4. **8-bit division with remainder** — Restoring division with 8 stages. Each stage uses comparison gate (A >= B) and conditional mux. Returns quotient and remainder. Circuit exists and verified.
459
 
460
  5. **Bitwise AND, OR, XOR, NOT** — 8 parallel single-layer threshold gates per operation. AND: w=[1,1], b=-2. OR: w=[1,1], b=-1. XOR: 2-layer (OR+NAND→AND). All circuits exist and verified.
461
 
462
+ 6. **Bit shifts (left, right)** — Identity gates (w=2, b=-1) with shifted wiring. SHL: out[i] = in[i+1], inject 0 at LSB. SHR: out[i] = in[i-1], inject 0 at MSB. Circuits exist and verified.
463
 
464
+ 7. **Comparisons (>, <, >=, <=, ==)** — GT, LT, GE, LE: single-layer weighted sum (positional weights 128..1). EQ: two-layer (GE AND LE). All 5 comparators exist and verified.
465
 
466
  8. **Divisibility testing (mod 2-12)** — Powers of 2 (mod 2,4,8): single-layer, check relevant bits. Non-powers (mod 3,5,6,7,9,10,11,12): multi-layer circuits encoding residue classes. All 11 circuits exist and exhaustively verified 0-255.
467
 
 
477
 
478
  | File | Description |
479
  |------|-------------|
480
+ | `neural_computer.safetensors` | 10,399 tensors, 8,288,256 parameters |
481
  | `threshold_cpu.py` | CPU state, reference cycle, threshold runtime |
482
+ | `eval.py` | Unified evaluation suite (5,884 tests, GPU-batched) |
483
+ | `build.py` | Build tools for memory, ALU, and .inputs tensors |
484
  | `prune_weights.py` | Weight magnitude pruning |
485
 
486
  ---