A nibble-oriented CPU in Verilog to build a scientific calculator
Get picks like this daily. Today's launch numbers, the top launches, AI and tech news, and a daily opportunity pick, straight to your inbox.
Want to reach these readers? Sponsor an issue.
The core question: how did HP's scientific calculators actually work at the gate level? That rabbit hole led to building one from scratch.The architectural decision everything else follows from: a decimal calculator should store numbers as BCD — one decimal digit per 4-bit nibble. A standard byte-oriented CPU (Z80, 6502) fights that layout constantly. So I designed a small custom CPU in Verilog where 4 bits is the natural data width and memory is nibble addressable.What the project covers:- Custom CPU: Harvard architecture, 12-bit ISA, 8-state execution FSM, hardware stack guard with a FAULT state for microcode debugging- CORDIC for trig functions, verified to 14 significant digits- Two-pass assembler in Python (~700 lines)- Verilator + Qt framework: same Verilog source runs in simulation, as a desktop GUI debugger, as WebAssembly, and on real hardware- Scripting language on top of the microcode for adding functions without touching hardware- Custom PCB (EasyEDA/JLCPCB), battery, charging circuitWrite-up: https://baltazarstudios.comHackaday: https://hackaday.com/2026/05/13/build-the-cpu-then-build-the...
HN · launched May 15, 2026 · 119 upvotes (top 8%) · 0 views
Niche: open-source hardware and maker electronics · 181 launches, 4 in the last 7 days ▼ -50% · Explore this niche →
Category and tags
- Horizontal
- Hardware & robotics
- Developer
- Not AI
- Hobby / open-source project
Visit website ↗ Source listing ↗
More like this: all 181 launches in open-source hardware and maker electronics →
Could you build this?
No Designing a custom processor in Verilog requires specialized digital logic, computer microarchitecture design, and hardware description expertise that AI assistants cannot reliably produce or synthesize.
What it would actually take: Building a nibble-oriented BCD processor requires designing register-transfer level (RTL) Verilog for a 4-bit ALU capable of BCD arithmetic (including 10's complement and correction logic), a microprogrammed or hardwired control unit, a program counter, and memory interfaces. The calculator firmware requires implementing CORDIC or polynomial approximation algorithms in microcode or assembly for transcendental functions, verified through cycle-accurate digital simulation (e.g., Verilator) and targeted to an FPGA. This demands deep digital engineering expertise in timing closure, finite state machines, and hardware debugging.
Discussion
20 comments analyzed.
Competitors mentioned: HP calculators (35, 45, 55, 65, 67, 20-series, 30-series, 11C, 15C), MicroPython calculator, 6502 processor (BCD mode comparison), Z80 processor
Concerns raised: 4-bit architecture doesn't align with standard byte-addressable CPU design, Ghidra disassembler lacks support for non-byte-aligned memory regions, Video documentation quality limitations, HP calculator power adapter design flaw - high voltage damage without battery pack
Feature requests: Ghidra support for 4-bit architectures, Better quality video tutorials/documentation
Competitors
Other products that read as similar to this one : 62 launches clear the similarity bar, closest 8 shown.
Attention rank: #5 of 63 (itself plus its competitors, highest first, normalized so YC and Product Hunt are compared fairly).
Launched 191 days after the earliest competitor.
- We built an 8-bit CPU as 2nd year EE students · hn · 2026-06-15 · 108 upvotes · similarity 0.41
- FPGA prime finder · hn · 2026-02-20 · 5 upvotes · similarity 0.40
- RISCY-V02: A 16-bit 2-cycle RISC-V-ish CPU in the 6502 footprint · hn · 2026-03-06 · 7 upvotes · similarity 0.40
- calculate-mcp · github · 2026-09-14 · 15 upvotes · similarity 0.39
- bc250-memory-temperature · github · 2026-09-11 · 8 upvotes · similarity 0.38
- Running Gemma-4 26B at 124 tokens/SEC on a CPU, no GPU · hn · 2026-06-30 · 10 upvotes · similarity 0.38
- Compressing a Histogram from 16GB to 2KB · hn · 2026-01-15 · 5 upvotes · similarity 0.37
- 8Gb DDR4 DRAM Chip · Wide-temp · CN · ph · 2026-09-17 · 1 upvotes · similarity 0.37
The niche, labels, vibe code rating and competitor comparison on this page are analysis by Nicheloom. If you use them, please credit nicheloom.com. How you may use our data.