Views
No views yet
A[3:0] ──┐
B[3:0] ──┼──► CSel Adder ──┬──► S[3:0]
Cin ──┘ └──► CoutBlock 0 (bits 0-1): Ripple-carry with actual Cin
└──► produces C1 (carry into bit 2)
Block 1 (bits 2-3): Pre-compute BOTH possibilities
Path A: assume Cin=0 → S2_0, S3_0, Cout_0
Path B: assume Cin=1 → S2_1, S3_1, Cout_1
Final: MUX selects Path A or B based on C1Ripple-Carry: [FA0]──►[FA1]──►[FA2]──►[FA3] (4 stages)
Carry-Select: [FA0]──►[FA1]──┐
[HA2]──►[FA3] ├──►[MUX] (3 stages)
[FA2]──►[FA3]──┘| Component | Count | Neurons |
|---|---|---|
| Block 0 (2 FAs) | 2 | 14 |
| Block 1 cin=0 (HA+FA) | 2 | 11 |
| Block 1 cin=1 (2 FAs) | 2 | 14 |
| Output MUXes | 3 | 9 |
1from safetensors.torch import load_file
2
3w = load_file('model.safetensors')
4
5# All 512 test cases verified (16 × 16 × 2)threshold-carryselect-adder/
├── model.safetensors
├── create_safetensors.py
├── config.json
└── README.md