The Nexys 4 Number Cruncher. Electrical and Computer Engineering Department

Similar documents
Fixed-Point Calculator

The Calculative Calculator

Traffic Light Controller. Thomas Quinn, Brandon Londo, Alexander C. Vincent, Yezan Hussein

Traffic Light Controller

Contents Circuits... 1

Objectives. Combinational logics Sequential logics Finite state machine Arithmetic circuits Datapath

Smart Night Light. Figure 1: The state diagram for the FSM of the ALS.

Combinational Logic Design

ENGG2410: Digital Design Lab 5: Modular Designs and Hierarchy Using VHDL

Ryerson University Department of Electrical and Computer Engineering COE/BME 328 Digital Systems

EECS 270 Midterm 2 Exam Closed book portion Fall 2014

Introduction to Digital Logic Missouri S&T University CPE 2210 Exam 3 Logistics

Experiment: FPGA Design with Verilog (Part 4)

TSIU03, SYSTEM DESIGN. How to Describe a HW Circuit

Find the equivalent decimal value for the given value Other number system to decimal ( Sample)

Laboratory 8. Digital Circuits - Counter and LED Display

Decade Counters Mod-5 counter: Decade Counter:

Electrical and Telecommunications Engineering Technology_TCET3122/TC520. NEW YORK CITY COLLEGE OF TECHNOLOGY The City University of New York

Microprocessor Design

Tic-Tac-Toe Using VGA Output Alexander Ivanovic, Shane Mahaffy, Johnathan Hannosh, Luca Wagner

Vending Machine. Keywords FSM, Vending Machine, FPGA, VHDL

Digital Fundamentals: A Systems Approach

Lab 5 FPGA Design Flow Based on Aldec Active-HDL. Fast Reflex Game.

Half-Adders. Ch.5 Summary. Chapter 5. Thomas L. Floyd

EEE130 Digital Electronics I Lecture #1_2. Dr. Shahrel A. Suandi

Lab #10 Hexadecimal-to-Seven-Segment Decoder, 4-bit Adder-Subtractor and Shift Register. Fall 2017

MODULAR DIGITAL ELECTRONICS TRAINING SYSTEM

Inside Digital Design Accompany Lab Manual

DIGITAL SYSTEM DESIGN UNIT I (2 MARKS)

Course Plan. Course Articulation Matrix: Mapping of Course Outcomes (COs) with Program Outcomes (POs) PSO-1 PSO-2

1. Convert the decimal number to binary, octal, and hexadecimal.

Digital Electronics II 2016 Imperial College London Page 1 of 8

Chapter 8 Functions of Combinational Logic

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Department of Electrical Engineering and Computer Sciences

Sequential Logic Design CS 64: Computer Organization and Design Logic Lecture #14

Introduction to Digital Electronics

1. True/False Questions (10 x 1p each = 10p) (a) I forgot to write down my name and student ID number.

ECE Lab 5. MSI Circuits - Four-Bit Adder/Subtractor with Decimal Output

CS302 Digital Logic Design Solved Objective Midterm Papers For Preparation of Midterm Exam

DIGITAL FUNDAMENTALS

QUICK GUIDE COMPUTER LOGICAL ORGANIZATION - OVERVIEW

California State University, Bakersfield Computer & Electrical Engineering & Computer Science ECE 3220: Digital Design with VHDL Laboratory 7

ET398 LAB 4. Concurrent Statements, Selection and Process

Digital Electronic Circuits Design & Laboratory Guideline

TYPICAL QUESTIONS & ANSWERS

Final Exam review: chapter 4 and 5. Supplement 3 and 4

BCN1043. By Dr. Mritha Ramalingam. Faculty of Computer Systems & Software Engineering

Operating Manual Ver.1.1

Lab 4: Hex Calculator

# "$ $ # %!"$!# &!'$("!)!"! $ # *!"! $ '!!$ #!!)! $ "# ' "

PHYS 3322 Modern Laboratory Methods I Digital Devices

Lab #6: Combinational Circuits Design

Dr. Shahram Shirani COE2DI4 Midterm Test #2 Nov 19, 2008

Sequential Logic Notes

COMPUTER ENGINEERING PROGRAM

problem maximum score 1 28pts 2 10pts 3 10pts 4 15pts 5 14pts 6 12pts 7 11pts total 100pts

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

Step 1 - shaft decoder to generate clockwise/anticlockwise signals

Logic Devices for Interfacing, The 8085 MPU Lecture 4

Serial FIR Filter. A Brief Study in DSP. ECE448 Spring 2011 Tuesday Section 15 points 3/8/2011 GEORGE MASON UNIVERSITY.

Minnesota State College Southeast

COE328 Course Outline. Fall 2007

WINTER 15 EXAMINATION Model Answer

Sequential logic circuits

Figure 30.1a Timing diagram of the divide by 60 minutes/seconds counter

FPGA Laboratory Assignment 4. Due Date: 06/11/2012

Registers and Counters

1. a) For the circuit shown in figure 1.1, draw a truth table showing the output Q for all combinations of inputs A, B and C. [4] Figure 1.

HDL & High Level Synthesize (EEET 2035) Laboratory II Sequential Circuits with VHDL: DFF, Counter, TFF and Timer

MODULE 3. Combinational & Sequential logic

Laboratory 11. Required Components: Objectives. Introduction. Digital Displays and Logic (modified from lab text by Alciatore)

Digital Circuits ECS 371

CprE 281: Digital Logic

Registers and Counters

Lab #5: Design Example: Keypad Scanner and Encoder - Part 1 (120 pts)

You will be first asked to demonstrate regular operation with default values. You will be asked to reprogram your time values and continue operation

ELEC 204 Digital System Design LABORATORY MANUAL

Scans and encodes up to a 64-key keyboard. DB 1 DB 2 DB 3 DB 4 DB 5 DB 6 DB 7 V SS. display information.

Laboratory Exercise 7

Lesson No Lesson No

Chapter 9 MSI Logic Circuits

Theory Lecture Day Topic Practical Day. Week. number systems and their inter-conversion Decimal, Binary. 3rd. 1st. 1st

EECS 270 Midterm 1 Exam Closed book portion Winter 2017

DALHOUSIE UNIVERSITY Department of Electrical & Computer Engineering Digital Circuits - ECED Experiment 2 - Arithmetic Elements

Laboratory Exercise 7

PURBANCHAL UNIVERSITY

TRAINING KITS ON DIGITAL ELECTRONIC EXPERIMENTS. Verify Truth table for TTL IC s AND, NOT, & NAND GATES


Experiment (6) 2- to 4 Decoder. Figure 8.1 Block Diagram of 2-to-4 Decoder 0 X X

Advanced Devices. Registers Counters Multiplexers Decoders Adders. CSC258 Lecture Slides Steve Engels, 2006 Slide 1 of 20

Table of Contents Introduction

R13 SET - 1 '' ''' '' ' '''' Code No: RT21053

IMPLEMENTATION OF A BINARY SELECTION SYSTEM CREATED IN XILINX USING FPGA

CPE 200L LABORATORY 3: SEQUENTIAL LOGIC CIRCUITS UNIVERSITY OF NEVADA, LAS VEGAS GOALS: BACKGROUND: SR FLIP-FLOP/LATCH

COMP12111: Fundamentals of Computer Engineering

Digital Logic. ECE 206, Fall 2001: Lab 1. Learning Objectives. The Logic Simulator

Lab #12: 4-Bit Arithmetic Logic Unit (ALU)

CS6201 UNIT I PART-A. Develop or build the following Boolean function with NAND gate F(x,y,z)=(1,2,3,5,7).

SEMESTER ONE EXAMINATIONS 2002

3/5/2017. A Register Stores a Set of Bits. ECE 120: Introduction to Computing. Add an Input to Control Changing a Register s Bits

Transcription:

The Nexys 4 Number Cruncher Bassam Jarbo, Donald Burns, Klajdi Lumani, Michael Elias Electrical and Computer Engineering Department School of Engineering and Computer Science Oakland University, Rochester Hills, MI bassamjarbo@oakland.edu, djburns@oakland.edu, klumani@oakland.edu, maelias@oakland.edu

Abstract: The purpose of the project was to build a simple calculator using 7seg displays and switches on the Nexys 4 DDR FGPA. The calculator would be able to add, subtract, multiple, and divide 4-bit unsigned numbers. The project was a great learning experience for digital logic and VHDL. An example is interfacing multiple components and performing computations on the FPGA. The project is going to utilize most of the skills learned during the ECE 278 course. Methodology: There will be 2 4-bit unsigned inputs. These inputs will be entered on the bottom of the board using dip switches. The method of operation will be chosen by the user. They will activate 1 of 4 preselected switches. Each switch will correlate with one specific function. Once that switch is pressed that signal will go into a debouncer then a priority encoder. An encoder is used just in case more than one switch is enabled at one time. A 4x1 multiplexer is used to sort Introduction: The scope of the project was building a 4-bit calculator using what we learned in our labs and a FPGA (Nexys 4). The team wanted a project that would involve many topics covered in ECE 278 and challenge the team to complete the project. This was a good project to do because it incorporates many different digital logic principals like architecturally based with arithmetic operations. Some of the topics that were covered in class were Arithmetic Logic Unit (ALU) design, Finite State Machines (FSMs), counters, multiplexers and priority encoders. Topics that will need to be researched outside of class will be how to utilize a debouncer and how to use a serializer. This project has many applications such as being used as a traditional calculator or a part of a larger project that would need calculations performed. out the signals then enter a BCD converter then a 7 segment converted which will be sent to a serializer. The output of the serializer will show on the 7 segment displays. The leftmost 2 displays will show what the input of A is, the next 2 show the value of B. The 4 rightmost display will show the whole number value of the calculation between A and B. If there is a remainder, it will be displayed on 4 LEDs in unsigned binary. The first steps that were taken was to decide what our inputs and outputs would be. After that we then collaborated and designed a top level design that we thought we could successfully implement. After the top level was created we labeled all signals along with their sizes. This is important because in portions of the program input signals must be uniform in order to avoid any errors. This helped us out a lot when

making the top level design and port mapping. After that was completed we built each portion of the code. When all errors were taken care of we moved on to the top level then the test bench. We tested out multiple areas to insure everything was working properly before finally implementing the entire project to the FPGA. Top level is shown in Figure (1) Components: Functions: Each function used was created in one of our labs. The division function was modified in order to support 2 4-bit inputs opposed to a 6-bit and 4-bit input. The top levels of each lab are shown on Figures (2,3,4,5). In order to avoid signed values. The subtraction function was created so that the absolute value for the difference between A and B would be taken. It is also worth noting that the quotient of the division function is displayed on the 7 segment display while the remainder is displayed on 4 LEDs. Each LED represent a binary value. The leftmost LED will represent the MSB of a 4-bit binary unsigned value, while the rightmost represents the LSB. Debouncer: The purpose of the debouncer was to insure that when a switch is activated or deactivated there is no fluctuation in the signal. We did this by cascading three delays. A single signal input was entered into the first delay. On the rising edge of the clock the signal will then pass through and enter the second delay. That signal will then pass through the second delay on the next rising edge. The same was done with the third delay. The outputs of each delay were ANDED with each other. This method insures that the signal stays high for three clock ticks before a high output is then passed through the AND gate. The output of the AND gate is the output of the debouncer. If the switch goes low, it only takes one clock tick before the debouncer will output a low signal. We used 4 debouncers, one for each switch which would determine the function that will be performed. See Figure (6) for top level design of debouncer. Priority Encoder: The priority encoder was used to insure that a correct S signal would be sent to both 4x1 multiplexers. Each debouncer output is sent to the encoder. The encoder will then output a 2-bit. This was done by using a when statement. We determined all possible inputs from all four debouncers and gave priority to the MSB which is the division switch, then the multiplication, followed by subtraction then finally addition. If the encoder does not receive a high signal from any debouncer then the encoder sends a signal that will allow the multiplexers to pass through the addition signal. 4x1 Multiplexer: The multiplexers were used to allow only one function output to pass through to the 7 segment displays and LEDS. The first multiplexer would pass through the whole number values of each function which would eventually go to the 7 segment

display. The second multiplexer was used to pass through the remainder from the division function to the LEDs. If any other function besides division was chosen, then the second multiplexer would pass through a value of 0 to the LEDs. Binary to BCD Converter: We wanted our calculator to display an output that was in base 10. In order to do this, we had to convert the outputs of our functions to binary converted decimal. This was done by making a table of all possible binary inputs which ranged from 00000000-11100001 which is 0-225 in decimal. We limited the output to 225 because the max output of the calculator would be 15*15. The we made a table of BCD values with the same range. A when statement was used to tell allow program to choose the correct BCD value based on the binary input. Two different files were created for this, one that could converter only up to 225 and a second that ranged up to 4096. This file was made just in case we wanted to increase out input sizes to 6-bits. Ultimately this file was not used because the input size was 4-bits and we didn't want to take up unnecessary memory on the FPGA. BCD to 7 segment Converter: This component was used to send a binary code to the 7 segment display so that the correct BCD value will be displayed. This was again done by making a table and using a when statement. Serializer: This component was needed to allow multiple 7 segment displays to appear as if they are all on at once. A counter was used and set up to interval every 1 millisecond. The counter output was sent to the enable of a finite state machine. The FSM had 8 different states, one state for each 7 segment that we wanted to use. As the counter increases intervals the FSM goes to the next state. Each state would output a unique 3-bit value. This unique signal was then sent to the S input of an 8x1 multiplexer and a 3-to-8 decoder. It would then simultaneously allow one input of the multiplexer to pass through to all 7 segment displays and enable that inputs corresponding display. Even though the multiplexers output is sent to each display, only the one that is enabled will show it. The inputs of the 8x1 multiplexer are A, B and the output of the first 4x1 multiplexer. The displays are flickering once every 8ms for only 1ms. This gives each display the display frequency of 125hz, which is too fast for the human eye to notice. Even though the max output will only need 3 7 segment displays, four were used. This was done just in case we increased the input values of A and B. Results: We were very well prepared for this project. When designing and implementing the program we ran into very few road blocks. One of the roadblocks encountered was displaying multiple values on

multiple 7 segment displays at one time. After consulting with our professor we determined that using a serializer was the best option. Another issue faced was making the division to work properly. After troubleshooting we discovered an enable switch would be required in order to allow the FSM in the division function to work properly. Images of the board working are shown in Figure (7). Conclusion: This was a very good learning experience. We had the opportunity to combine multiple files that were made throughout the course along with new ones made specifically for the project. It taught us that planning and hard work in necessary in order to make independent files to come together and work as a function project. There are areas in which we could improve on, such as increasing input size, including signed values and using a keyboard as an interface. Overall we are very happy with what we built together as a team and are grateful he had an opportunity to do this. REFERENCES: Daniel Llamocca ECE 278 Lab 2 F16 [1] Daniel Llamocca ECE 278 Lab 3 F16 [2] Daniel Llamocca ECE 278 Lab 6 F16 [3] Danial Llamocca ECE 378 Midterm Exam W16 [4] Danial Llamocca ECE 278 VHDL Coding for FPGAs Unit 7 Serializer Project F16 [5] Darrin Hannah Lesson 74 Debouncer Circuit [6]

Appendix: Figure 1- TopLevel Figure 2 - Addition Toplevel [1] Figure 3 - Subtraction Toplevel [4]

Figure 4 - Multiplication Toplevel [2] Figure 5 - Debouncer TopLevel [6] Figure 6 Division Toplevel [3]

Figure 6 - Addition Figure 7 - Subtraction

Figure 8 - Multiplication Figure 9 - Division