Vaibhav Gurunathan

State Machine - 4 Function Calculator on FPGA Board

Last year, for a computer logic class, I was tasked with developing a four function calculator capable of handling 4 digits operations that would be demonstrated to instructors on a FPGA (Field-Programmable Gate Array) board. This was the final encapsulating project in the class and required the use of knowledge from all aspects of the class.

Why this Project Was So Hard?

This project in a high level programming language is extremely simple. You can easily use the standard, built in operations for the code. Our code was not allowed to use these. Instead, we had to perform bit manipulations for all parts of the project. For example, for addition we needed to use two helper functions. The first was the add two numbers and add any remainder to overflow. The next was for combining this part for 4 digit operations and check if there was any total overflow. If there was overflow over 4 digits, the program should print and error on the led displays. For multiplication, we had to implement Booth's multiplication algorithm which was tough.

Functionality of the Calculator

This project required the calculator to be able to add, subtract, multiply, and divide numbers together. It also had the capability to load and clear numbers, enhancing the calculator's usability and versatility.

State Machine Design

This calculator was developed using a state machine design. This would check any changes at every clock edge. This would allow the algorithm to accurately check for any changes.