Views
No views yet
codeword[7:0] ──► SEC-DED ──┬──► data[3:0] (corrected)
├──► error (error detected)
└──► uncorrectable (double error)Position: 7 6 5 4 3 2 1 0
Bit: d3 d2 d1 p3 d0 p2 p1 p0
p0 = overall parity (all bits)
p1 = parity of positions 1,3,5,7
p2 = parity of positions 2,3,6,7
p3 = parity of positions 4,5,6,7
d0-d3 = data bits| Syndrome | Overall Parity | Status |
|---|---|---|
| 0 | 0 | No error |
| ≠0 | 1 | Single error (correctable) |
| ≠0 | 0 | Double error (detected only) |
| 0 | 1 | Single error in p0 (correctable) |
| Component | Function | Neurons |
|---|---|---|
| Syndrome calc (s1,s2,s3) | XOR trees | ~63 |
| Overall parity | XOR tree | ~21 |
| Error logic | AND/OR | ~7 |
| Data correction | Conditional XOR | ~12 |
1from safetensors.torch import load_file
2
3w = load_file('model.safetensors')
4
5# Example: data=5 (0101)
6# Encoded: 01010110 (with parity bits)
7# Flip bit 3: 01011110
8# Decoder: corrects to data=5, error=1, uncorrectable=0threshold-sec-ded/
├── model.safetensors
├── create_safetensors.py
├── config.json
└── README.md