phanerozoic / threshold-bcd-adder

huggingface.co
Total runs: 2
24-hour runs: 0
7-day runs: 0
30-day runs: 2
Model's Last Updated: January 24 2026

Introduction of threshold-bcd-adder

Model Details of threshold-bcd-adder

threshold-bcd-adder

BCD (Binary-Coded Decimal) single-digit adder as threshold circuit. Adds two decimal digits (0-9) with carry.

Circuit
A[3:0] ──┐  (BCD digit 0-9)
B[3:0] ──┼──► BCD Adder ──┬──► S[3:0]  (BCD digit 0-9)
Cin    ──┘                └──► Cout    (decimal carry)
Algorithm
1. Binary add: Z = A + B + Cin  (4-bit result + carry)
2. Detect overflow: Z > 9 OR binary carry
3. If overflow: add 6 (0110) for correction
4. Decimal carry = overflow detected
Why Add 6?

BCD uses only values 0-9. When binary sum exceeds 9:

  • 10 (1010) + 6 = 16 (10000) → 0 with carry
  • 11 (1011) + 6 = 17 (10001) → 1 with carry
  • etc.

Adding 6 skips the invalid codes A-F (10-15).

Truth Table (examples)
A B Cin S Cout
5 3 0 8 0
5 5 0 0 1
9 9 0 8 1
9 9 1 9 1
Architecture
Stage Component Neurons
Binary add 4 Full Adders 28
Detect >9 AND, OR gates 4
Correction 2 Half Adders + XOR 11

Total: 43 neurons, 133 parameters, 5 layers

Applications
  • Decimal arithmetic in calculators
  • Financial calculations requiring exact decimal
  • BCD-based displays (7-segment)
  • Legacy systems using packed BCD
Usage
from safetensors.torch import load_file

w = load_file('model.safetensors')

# Valid inputs: A, B in range 0-9
# All 200 test cases verified (10 × 10 × 2)
Files
threshold-bcd-adder/
├── model.safetensors
├── create_safetensors.py
├── config.json
└── README.md
License

MIT

Runs of phanerozoic threshold-bcd-adder on huggingface.co

2
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
2
30-day runs

More Information About threshold-bcd-adder huggingface.co Model

More threshold-bcd-adder license Visit here:

https://choosealicense.com/licenses/mit

threshold-bcd-adder huggingface.co

threshold-bcd-adder huggingface.co is an AI model on huggingface.co that provides threshold-bcd-adder's model effect (), which can be used instantly with this phanerozoic threshold-bcd-adder model. huggingface.co supports a free trial of the threshold-bcd-adder model, and also provides paid use of the threshold-bcd-adder. Support call threshold-bcd-adder model through api, including Node.js, Python, http.

threshold-bcd-adder huggingface.co Url

https://huggingface.co/phanerozoic/threshold-bcd-adder

phanerozoic threshold-bcd-adder online free

threshold-bcd-adder huggingface.co is an online trial and call api platform, which integrates threshold-bcd-adder's modeling effects, including api services, and provides a free online trial of threshold-bcd-adder, you can try threshold-bcd-adder online for free by clicking the link below.

phanerozoic threshold-bcd-adder online free url in huggingface.co:

https://huggingface.co/phanerozoic/threshold-bcd-adder

threshold-bcd-adder install

threshold-bcd-adder is an open source model from GitHub that offers a free installation service, and any user can find threshold-bcd-adder on GitHub to install. At the same time, huggingface.co provides the effect of threshold-bcd-adder install, users can directly use threshold-bcd-adder installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

threshold-bcd-adder install url in huggingface.co:

https://huggingface.co/phanerozoic/threshold-bcd-adder

Url of threshold-bcd-adder

threshold-bcd-adder huggingface.co Url

Provider of threshold-bcd-adder huggingface.co

phanerozoic
ORGANIZATIONS

Other API from phanerozoic

huggingface.co

Total runs: 1.2K
Run Growth: 1.2K
Growth Rate: 100.00%
Updated:April 25 2026