Computer Architecture Lab - ACOE201
Computer Engineering Department
Computer Architecture I Lab (ACOE201)
Experiment #4
1-bit Arithmetic Unit
Student’s Name:Semester: / Date:
Assessment:
Assessment Point / Weight / GradeMethodology
Presentation and discussion of results
Participation
Assessment Points’ Grade
Comments:Experiment #4:1-bit Arithmetic Unit
Objectives:
To examine the design and operation of arithmetic circuits used in CPUs.
Conventions:
The symbol indicates an operation that must be done in hardware e.g. pressing a button or switch, making a connection on the board, a jumper etc.
The symbol indicates an operation that must be done in software e.g. a command that must be entered, a window that must be opened etc.
Introduction:
An arithmetic circuit is a circuit that performs a variety of arithmetic operations. It is a part of the ALU. An arithmetic circuit can be implemented using a number of gates, or using circuits like multiplexers and full adders as building blocks. This experiment shows how a simple arithmetic circuit can be implemented using two multiplexers and a full adder.
The circuit diagram of the full adder is shown in Figure 1 and of the 1-bit Arithmetic Unit is shown in Figure 2. Use the full-adder from lab 3 by copying the .sym and .sch files into your lab 4 working directory.
Figure 1.
- Launch the Xilinx ISE environment and create a new project, “lab4”.
- Select the Spartan-6 Device family from the drop-down menu
- Select the XC6LX16 device from the drop-down menu
- Select the CSG324 package from the drop-down menu
- Select schematic as the design entry method. Select “ISim” in the simulator selection
- Create a new schematic source “lab4” and add it to the project. Enter the schematic of Figure 2. Make the appropriate connections between components to create a 1-bit Arithmetic Unit (bits A0 and B0). Make sure the enable signals (E) of the two MUXs (M4_1E) are always connected to logic 1. Get the logic one from the pullup resistor and the logic 0 from the inverter after the pullup resistor.
Figure 2: Circuit Diagram of the 1-bit Arithmetic Unit
Insert your schematic here …
Procedure:
Step 1.Design a 1-bit arithmetic unit to perform the operations shown in table 1.
F1 / F0 / Function / A / B / Cin0 / 0 / A + B
0 / 1 / A – B
1 / 0 / A + 1
1 / 1 / A – 1
Table 1: 1-bit Arithmetic Unit.
Step2:Show all necessary connections, for the 1-bit Arithmetic Unit, on the circuit diagram in figure 1. Make the connections on the 1-bit Arithmetic Unit schematic.
Step3:Select "Project => New Source". From the list of sources select "Verilog Test Fixture", name the new source file "Lab3_tb" and make sure "add to project" is selected. Associate it with the 1-bit arithmetic unit schematic source file NOT the full_adder.Go to the “simulation” tab. Select the "Lab3_tb" source file. Double click to open it. Create the truth table of Figure 2 as follows:
initial begin
#10 A0=0; B0=0; F0=0; F1=0;
#10 F0=1;
...
end
endmodule
Go down to the Processes tab, expand Isim simulator and double click on “Simulate behavioural model.
Step4: Download the UCF file specifying the input and output pin connections from:
Add it to the project as a source file.
Step5:Synthesize and implement your design.
Step 6. Connect the FPGA to your PC through the USB cable provided and turn on the power switch.
Configure the Spartan-3E board by clicking on Start => Programs => Digilent => Adept => Adept. Adept should identify the Nexys3 board. Browse to the project folder and select the .bit file. Click on "Program". Wait until the message that programming is successful.
Step7:Download and test the 1-bit Arithmetic Unit on the FPGA board and change the state of the switches to fill up table 2. For all input combinations, set the Cin (SW3) to zero.
F1 / F0 / Function / A0 / B0 / Sum / Cout0 / 0 / 0 / 0
0 / 0 / 0 / 1
0 / 0 / 1 / 0
0 / 0 / 1 / 1
0 / 1 / 0 / 0
0 / 1 / 0 / 1
0 / 1 / 1 / 0
0 / 1 / 1 / 1
1 / 0 / 0 / 0
1 / 0 / 0 / 1
1 / 0 / 1 / 0
1 / 0 / 1 / 1
1 / 1 / 0 / 0
1 / 1 / 0 / 1
1 / 1 / 1 / 0
1 / 1 / 1 / 1
Table 2: Truth table of the 1-bit Arithmetic Unit.
Questions:
- Discuss the results in table 1.
- Discuss the results in table 2.
- Discuss the results in table 4
- How many LUTs/slices were used for each arithmetic unit?
1