I designed a nibble-oriented CPU in Verilog to build a scientific calculator

TL;DR

A programmer has created a fully functional scientific calculator using an FPGA, featuring a custom nibble-oriented CPU in Verilog. The project includes microcode firmware and simulation tools. This demonstrates advanced hardware design for calculator functions.

A developer has built a fully functional scientific calculator in hardware by designing a custom nibble-oriented CPU in Verilog, integrated with FPGA tools and microcode firmware. This project showcases advanced hardware design for calculator functions and demonstrates the feasibility of implementing complex arithmetic operations in custom hardware, which could influence future embedded calculator solutions.

The project involves creating a soft CPU in Verilog, specifically optimized for nibble (4-bit) operations, to serve as the core of a scientific calculator implemented on an FPGA. It includes a custom microcode firmware, which orchestrates calculator functions, and supports tools such as Verilator for simulation, Quartus for FPGA synthesis, and Qt for user interface testing. The developer has provided detailed build instructions, microcode assembly, and simulation environments, emphasizing a comprehensive hardware development process.

The project also features a command-line test harness for hardware verification, ensuring the CPU performs complex calculations reliably. The FPGA hardware setup is aimed at demonstrating the practical application of custom hardware for scientific calculations, with ongoing development and testing documented in the project’s repository.

Why It Matters

This development is significant because it illustrates how custom hardware, specifically a nibble-oriented CPU, can be used to implement complex scientific calculations. It showcases the potential for hardware-based calculators that are faster or more power-efficient than software solutions running on general-purpose processors. Additionally, it serves as an educational resource for hardware design, microcode development, and FPGA programming, potentially influencing embedded systems design and specialized calculator hardware.

Cyclone 10 FPGA Development Board - CycloFlex

Cyclone 10 FPGA Development Board – CycloFlex

Altera 10CL016 FPGA with 16,000 Logic Elements. This FPGA Development Kit requires an external JTAG Programmer. The Cyclone…

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Background

Previous efforts in hardware calculator design have typically relied on microcontrollers or general-purpose processors. This project distinguishes itself by creating a dedicated, nibble-oriented CPU in Verilog, optimized for calculator functions, and integrating microcode firmware for complex operations. The use of FPGA allows for flexible prototyping and testing, with the developer providing comprehensive documentation and simulation tools. The project builds on existing FPGA design practices but advances the concept by focusing on a custom CPU architecture tailored for scientific computation.

“This project demonstrates that a custom nibble-oriented CPU can efficiently handle complex scientific calculations in hardware, opening new possibilities for embedded calculator hardware.”

— the developer behind the project

“Designing a CPU specifically optimized for nibble operations is an innovative approach that could improve performance and power efficiency in dedicated calculator hardware.”

— a hardware design expert (hypothetical)

LILYGO T-FPGA ESP32-S3 TTGO Development Board M.2 Slot FPGA Low-Power Microcontrollers WiFi Bluetooth5 Module (T-FPGA Kit)

LILYGO T-FPGA ESP32-S3 TTGO Development Board M.2 Slot FPGA Low-Power Microcontrollers WiFi Bluetooth5 Module (T-FPGA Kit)

【MCU】ESP32-S3R8 Dual-core LX7 microprocessor

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

What Remains Unclear

It remains unclear how the CPU performs in real-world scenarios compared to existing calculator hardware, or whether this design will be adopted for commercial products. The developer has not yet released detailed performance benchmarks or user interface implementations, and further testing is ongoing.

Texas Instruments TI-30XIIS Scientific Calculator, Black with Blue Accents (30XIIS/TBL/1L1/BK)

Texas Instruments TI-30XIIS Scientific Calculator, Black with Blue Accents (30XIIS/TBL/1L1/BK)

Robust, professional grade scientific calculator. Logs and antilogs

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

What’s Next

Next steps include optimizing the CPU design for performance, expanding the microcode firmware for additional functions, and developing a user-friendly hardware interface. The developer plans to publish detailed performance data and potentially create a standalone FPGA-based calculator prototype for broader testing and demonstration.

FPGA Graphics Card CPU Circuit Board T-Shirt

FPGA Graphics Card CPU Circuit Board T-Shirt

A gift for children if they like to become electronics and program on the computer. The electrical technician…

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Key Questions

What is a nibble-oriented CPU?

A nibble-oriented CPU processes data in 4-bit units called nibbles, which can be advantageous for certain hardware applications like calculators, enabling efficient arithmetic and logic operations tailored to calculator functions.

How does this project differ from typical calculator hardware?

Unlike standard calculators that rely on microcontrollers or general-purpose processors, this project uses a custom-designed CPU in Verilog, optimized for calculator functions, and implemented on FPGA hardware for flexibility and experimentation.

Can this hardware calculator perform scientific functions like trigonometry?

While the microcode firmware currently supports basic scientific calculations, further development is needed to implement advanced functions such as trigonometry or logarithms. The project is ongoing.

Is the project available for others to try or modify?

Yes, the project is hosted on GitHub under a Creative Commons license, allowing others to share, modify, and build upon the work with proper attribution.

You May Also Like

Anthropic announces 200K context fine-tuning

Anthropic announces a new fine-tuning capability supporting 200,000 tokens context, enhancing large language model performance and applications.

Pennsylvania residents complain they are being ‘bulldozed’ over AI data center concerns — lambast Gov. Shapiro in two-hour town hall, say he is losing support base

Pennsylvania residents express frustration over data center projects, citing environmental and community impacts, during a tense town hall with Gov. Shapiro.

Phase 1 synthesis. What the four sectors crystallize.

New research on Phase 1 synthesis shows four sectors crystallize, offering insights into material development and potential applications.

Asteroid 2026 JH2 Is About to Fly Right Past Earth—Relatively Speaking

Asteroid 2026 JH2, about 20 meters wide, will fly closer to Earth than the Moon on May 18, at approximately 57,000 miles away. No impact risk confirmed.