1 / 9

Lab 6

Lab 6. Module M8.3. EXPERIMENT 6: Adder/Subtractor. PRE-LAB. 1. Read and understand text Sec. 6.2, Adders and Subtractors , pages 107-117.

chase-lyons
Download Presentation

Lab 6

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lab 6 Module M8.3

  2. EXPERIMENT 6: Adder/Subtractor PRE-LAB 1. Read and understand text Sec. 6.2, Adders and Subtractors, pages 107-117. 2. Using textbook Figure 6.27 as a guide, write an ABEL program called addsub.abl for a 4-bit full adder/subtracter using a Xilinx XC95108 PC84 chip on a PLDT-1 unit. Start by assigning inputs A3..A0 to switches 1 to 4 (pins 6, 7, 11, and 5 respectively) and write a vector equation, A = [A3..A0]. Assign inputs B3..B0 to switches 5 to 8 (pins 72, 71, 66, and 70 respectively) and write a vector equation, B = [B3..B0]. Assign the control input E to the push-button switch (pin 10). Assign outputs SD3..SD0 to LEDs 5 to 8 (pins 39, 37, 36, and 35) and define a vector, SD = SD3..SD0. Also assign an overflow flag output, OVF, and a carry/borrow flag output, CBF, to LEDs 1 and 4 (pins 44 and 40 respectively).

  3. 3. In addition to input and output terms, you will need intermediate nodes to describe the 'B' input terms to the full adders and the intermediate carry terms. Simply add the equation, Bin = B $ E, to describe a 'B' input vector and, for intermediate carry terms, add the following node and vector definitions: C4..C0 NODE ISTYPE 'com'; " internal carry/borrow vector Cin = [C3..C0]; " carry/borrow input vector Cout = [C4..C1]; " carry/borrow output vector

  4. 4. In the EQUATIONS section, set C0 equal to E. Then, using textbook Figure 6.14 as a guide and by substituting the vectors SD for Si, Cout for Ci+1, Cin for Ci, A for Ai, and Bin for Bi, write equations for SD and Cout as a function of Cin, A, and Bin. Then, write equations for the overflow and carry/borrow flags, OVF and CBF, as a function of the intermediate carry terms, C4 and C3. Print out a copy of your file.

  5. 5. Complete the following table of test values for the adder/subtracter: EABBinOVFCBFSD 0 0000 0000 ______ ___ ___ ______ 0 0000 1111 ______ ___ ___ ______ 0 1111 0000 ______ ___ ___ ______ 0 0101 0101 ______ ___ ___ ______ 0 1010 1010 ______ ___ ___ ______ 0 0001 1111 ______ ___ ___ ______ 0 1111 0001 ______ ___ ___ ______ 0 1111 1111 ______ ___ ___ ______ 1 0000 1111 ______ ___ ___ ______ 1 0000 0001 ______ ___ ___ ______ 1 1110 1111 ______ ___ ___ ______ 1 0101 1010 ______ ___ ___ ______ 1 1010 0101 ______ ___ ___ ______ 1 0000 0000 ______ ___ ___ ______ 1 1111 1111 ______ ___ ___ ______ 1 1111 0000 ______ ___ ___ ______

  6. Using the results from this table make a set of test vectors in the following format and add them to the end of your ABEL program. test_vectors ([E,A,B] -> [OVF,CBF,SD]) [0,0,0] -> [0,0,0]; --------- --------- ---------

  7. LAB 1. Create a directory called <your name> under C:\CSE171 on the computer you are using in the lab. Create a new project called Lab6 using the Xilinx Project Navigator program. (See the Lab 2 tutorial for details.) Add your program addsub.abl to the project by using Project->Add Copy of Source… on the Project Navigator toolbar. Compile your program by double-clicking Generate Programming File.

  8. 2. Select addsub-vectors in the Sources in Project window. Double-click Generate Blif Simulation Report under Simulation Reports in the Processes for Current Source window. Double-click View Blif Simulation Report under Generate Blif Simulation Report. If there are no errors, print out this Blif Simulation Report. 3. Select addsubp.abl in the Sources in Project window. Program the Xilinx XC9508PC84 CPLD on the PLDT-1 board by double-clicking Configure Device (iMPACT) and then right-clicking on the picture of the Xilinx chip.

  9. 4. Test your adder/subtracter by setting the toggle switches to each of the test values given above in Pre-lab step 5 and confirm correct results for each. Demonstrate your adder/subtracter to your lab instructor and obtain your lab instructor's signature for your work on the .abl listing for the program addsub.abl. 5. Include the following in the lab report: a.       A listing of your file, addsub.abl. b.      A listing of the Blif Simulation Report. c.       A copy of the results from Pre-Lab Part 5 above. 6. Delete the directory C:\CSE171\<your name> that you created at the beginning of this lab.

More Related