Views
No views yet
Inputs: A[3:0], B[3:0], Cin (9 inputs)
Outputs: S[3:0], Cout (5 outputs)
For each bit i:
P_i = A_i XOR B_i (propagate)
G_i = A_i AND B_i (generate)
Carries computed in parallel:
C1 = G0 + P0·Cin
C2 = G1 + P1·G0 + P1·P0·Cin
C3 = G2 + P2·G1 + P2·P1·G0 + P2·P1·P0·Cin
Cout = G3 + P3·C3
Sum bits:
S_i = P_i XOR C_i| A | B | Cin | S | Cout |
|---|---|---|---|---|
| 0000 | 0000 | 0 | 0000 | 0 |
| 0001 | 0001 | 0 | 0010 | 0 |
| 1111 | 0001 | 0 | 0000 | 1 |
| 1111 | 1111 | 1 | 1111 | 1 |
| Component | Neurons |
|---|---|
| P/G generation | 8 |
| Carry lookahead | 8 |
| Sum XORs | 8 |
1from safetensors.torch import load_file
2
3w = load_file('model.safetensors')
4
5# Verify: all 512 input combinations (16 x 16 x 2) produce correct sumsthreshold-carrylookahead4bit/
├── model.safetensors
├── create_safetensors.py
├── config.json
└── README.md