Presentation is loading. Please wait.

Presentation is loading. Please wait.

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. 2.Using textbook.

Similar presentations


Presentation on theme: "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. 2.Using textbook."— 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 S i, Cout for C i+1, Cin for C i, A for A i, and Bin for B i, 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 E A B BinOVFCBF SD 000000000__________________ 000001111__________________ 011110000__________________ 001010101__________________ 010101010__________________ 000011111__________________ 011110001__________________ 011111111__________________ 100001111__________________ 100000001__________________ 111101111__________________ 101011010__________________ 110100101__________________ 100000000__________________ 111111111__________________ 111110000__________________ 5. Complete the following table of test values for the adder/subtracter:

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 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\ that you created at the beginning of this lab.


Download ppt "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. 2.Using textbook."

Similar presentations


Ads by Google