Nexys 4 Abacus Demo

Overview

Description

Abacus demonstration project that implements several arithmetic operations using the Nexys4's switches, LEDs, buttons and 7-segment display.

Features Used

Not Used Used
16 user switches X
16 user LEDs X
5 user pushbuttons X
2 × 4-digit 7-segment display X
4 Pmod connectors X
XADC Analog input X
12-bit VGA output X
USB-UART Bridge X
Serial Flash for application data X
USB HID Host with mouse X
USB HID Host with keyboard X

Prerequisites

Hardware

  • Nexys4 FPGA board
  • Micro-USB cable

Software


Downloads

Nexys4 Abacus Demo Project Repository – ZIP GIT Repo


Download and Launch the Nexys 4 Abacus Demo

Follow the Using Digilent Github Demo Projects Tutorial. This is an HDL design project, and as such does not support Vivado SDK, select the tutorial options appropriate for a Vivado-only design. You do not need to return to this guide until your board is fully programmed.

Using the Nexys 4 Abacus Demo

To run all the features of this demo, all you will need is your programmed Nexys4. The abacus can perform 4 arithmetic functions on two 8-bit numbers. Switches 15-8 represent input A. Switches 7-0 represent input B. The abacus works by setting the slide switches to your desired operands and then selecting an operation with the buttons. The result will be displayed on the two 7 segment displays.

1. No Operation

On startup and as long as no button is pressed, each four digit section of the 7-segment display will show whatever the value that input's switches are set to.

2. Subtraction (BTNU)

The subtraction operation is activated while BTNU is held down. This function uses the formula A - B. The display will show the difference of the two inputs and whether the result is positive or negative.


Displaying 24-13


Displaying 7-14

3. Multiplication (BTND)

The multiplication operation is activated while BTND is held down. This function uses the formula A * B. The display will show the product of the two inputs.


Displaying 24×13


Displaying 248×61

4. Division (BTNR)

The division operation is activated while BTNR is held down. This function uses the formula A / B. The display will show the quotient.


Displaying 24/13 (Rounded down to 1)

5. Modulo/Remainder (BTNL)

The modulo operation is activated while BTNL is held down. This function uses the formula A % B. The display will show the remainder.


Displaying 24%13

6. Addition (BTNC)

The addtion operation is activated while BTNC is held down. This function uses the formula A + B. The display will show the sum of the two inputs.


Displaying 24+13