This project details the design of a complete 8-bit calculator in VHDL. The system performs signed arithmetic operations, including addition and subtraction, selected via a 4-bit opcode. The design integrates multiple custom components, including registers, a core processing unit, and display drivers. A key feature is the implementation of overflow detection to ensure arithmetic accuracy. The final 8-bit result is shown on a pair of 7-segment displays for clear visual feedback.
*This was worked on as part of Group Project*
Language: VHDL
Software: ModelSim, Quartus
Hardware: DE1 Board
Core Concepts: Signed Arithmetic, Two's Complement, Overflow Detection, Modular Design, FSM Control Logic, Hardware Interfacing
Modular System Design: The calculator was built by structurally integrating multiple VHDL components: two 8-bit registers for operands X and Y, a core calcprocessing module, an 8-bit adder, and two 7-segment display drivers.
Signed Arithmetic: The design successfully performs signed arithmetic. Subtraction (Y – X) is implemented using two's complement by adding the inverted value of X plus a carry-in (Y + (-X)).
Opcode-Based Control: A 4-bit opcode is used to select the desired operation. The processing unit uses a case statement to execute the correct function, such as addition for opcode "0011" or subtraction for "1000".
Overflow Detection: The system includes dedicated logic to detect and flag arithmetic overflow. This is achieved by comparing the sign bits of the two operands with the sign bit of the result.
Hardware Display Interface: The final 8-bit result is split into its upper and lower 4-bit segments, with each half being sent to a dedicated 7-segment display module for visual output on the DE1 board.
X=5 & Y=6 operation for all OpCodes in Code
A primary challenge in this project was encountered during hardware implementation, where unexpected "ghost mapping" occurred on the 7-segment display LEDs. This required careful debugging of the board connections and signal routing to resolve the issue and achieve a clean output as seen above.
Furthermore, this project significantly enhanced my understanding of digital system integration, signed arithmetic in VHDL, and interfacing logic with physical hardware. It provided valuable experience in designing modular, multi-component systems and troubleshooting hardware-specific issues.