Views
No views yet
x[7:0] ──► LOD ──┬──► pos[2:0] (position 0-7)
└──► valid (1 if any bit set)| Input | Binary | Position | Valid |
|---|---|---|---|
| 0 | 00000000 | 0 | 0 |
| 1 | 00000001 | 0 | 1 |
| 2 | 00000010 | 1 | 1 |
| 128 | 10000000 | 7 | 1 |
| 255 | 11111111 | 7 | 1 |
| 170 | 10101010 | 7 | 1 |
For each bit position i (7 down to 0):
leader[i] = x[i] AND NOT(any bit j > i is set)
Position is binary encoding of which leader is active.| Component | Count | Neurons |
|---|---|---|
| Higher-than OR | 8 | 8 |
| NOT higher | 8 | 8 |
| Leader AND | 8 | 8 |
| Position encode | 3 | 3 |
| Valid OR | 1 | 1 |
1from safetensors.torch import load_file
2
3w = load_file('model.safetensors')
4
5# For x = 0b00101100 (44):
6# Leading one at position 5
7# log₂(44) ≈ 5x = 0b00100000 → position=5 → CLZ=2
x = 0b10000000 → position=7 → CLZ=0threshold-leading-one-detect/
├── model.safetensors
├── create_safetensors.py
├── config.json
└── README.md