project6

.docx

School

California State University, Long Beach *

*We aren’t endorsed by this school

Course

174

Subject

Electrical Engineering

Date

Dec 6, 2023

Type

docx

Pages

3

Uploaded by ajkseo

Report
Project 6: 4-bit Adder-Subtractor Using a BCD to 7-Segment Display Decoder Objectives: Learn the concept of hierarchical design Implement the 4-bit adder-subtractor and test its performance What to do? In project4, we built a circuit to do addition and subtraction of 4-bit numbers. Now, we will display the result in the 7-segment LED display we designed before. The system diagram looks like the following: Here is your to-do list: 1) Use project4 AddSub.v code which describes your 4-bit Adder-Subtractor (you should have completed this step and verify your 4-bit Adder-Subtractor works correctly; 2) You should have also finished project5 and check the 7-segment LED display. 3) Create a new project and name it Project6 4) Add AddSub.v and display.v to your project. 5) Do pin assignments, synthesize your design and implement. Then generate the bit file. 6) Test your board and consider if this is a functional calculator. 1
Implementing your 4-bit Adder-Subtractor on board using 7 segment LED decoder Now we need to connect the 7-segment LED Decoder with the 4-bit Adder-Subtractor. As shown in the diagram, the result of the calculation now becomes the inputs to the decoder. We can see that in this final circuit, the outputs should be the segments of the LED display. To reflect the above changes, we need to modify the input/output list of the AddSub module as follows: After you change the input/outputs, you also need to insert the following Verilog code to describe the 7-segment LED display decoder (note that the inputs to the decoder is the calculation result ): display d1(result[3], result[2],result[1],result[0],a,b,c,d,e,f,g,dp,enable); Now, we are ready to do pin assignment. Go to Constraints and add Nexys-A7-100T-Master.xdc into the project. We want to connect the 4-bit inputs x and y with the switches (SW7 to SW0), the select is connected to the push button (don’t push is x+y, push is x-y), the result is displayed on the 7-segment LED display, and Cout is connected to LED0 (the LED light). Make sure you input the correct pin number, and save the file. Now, Synthesis Run Synthesis, then, Implementation Run Implementation and wait for the Green Check. If everything is OK, then click on “Generate bitStream” to generate AddSub.bit Once your bit file is generated, Open Hardware Manager and program the device and test your board with different inputs for x, and y. 2
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help