EXP 2 - Creating A Symbol
EXP 2 - Creating A Symbol
Objectives:
The aim of this lab is creating a symbol from a schematic (BDF file), then use it in a
new project to perform a specific task.
Introduction:
HALF ADDER
The half adder adds two single binary digits A and B. It has two outputs, sum (S) and
carry (C). The carry signal represents an overflow into the next digit of a multi-digit
addition.
Inputs Outputs
A B C S
0 0 0 0
1 0 0 1
0 1 0 1
1 1 1 0
The Boolean logic for the sum (in this case S) will be A'B+AB' (A XOR B), whereas for
carry (C) will be AB.
Figure 1
A full adder adds binary numbers for values carried in as well as out. A one-bit full-adder
adds three one-bit numbers, often written as A, B, and Cin; A and B are the operands, and
Cin is a bit carried in from the previous less-significant stage.
The truth table for the full adder is:
Inputs Outputs
A B Cin Cout S
0 0 0 0 0
0 0 1 0 1
0 1 0 0 1
0 1 1 1 0
1 0 0 0 1
1 0 1 1 0
1 1 0 1 0
1 1 1 1 1
A full adder can be constructed from two half adders by connecting A and B to the input
of one half adder, then taking its sum-output(S) as one of the inputs to the second half
adder and Cin as its other input, and finally the carry-outputs from the two half-adders are
connected to an OR gate. The sum-output from the second half-adder is the final Sum-
output (S) of the Full-Adder and the output from the OR gate is the final Carry-output
(Cout ).
Two half adders can be combined to make a full adder.
Figure 3
Procedure:
1. Select File > New Project Wizard to reach the window below, which asks for the
name and directory of the project.
2. Set the working directory to be ARCH_LAB; of course, you can use some other
directory name of your choice if you prefer. The project must have a name,
which is usually the same as the top-level design entity that will be included in
the project. Choose half_adder as the name for both the project and the top-
level entity, Press Next. Since we have not yet created the directory
ARCH_LAB, Quartus II software displays the pop-up box in Figure 5 asking if it
should create the desired directory. Click Yes, which leads to the window in
Figure 5.
Figure 5
3. The wizard makes it easy to specify which existing files (if any) should be
included in the project. Assuming that we do not have any existing files, click
Next, which leads to the window in Figure 6.
4. We have to specify the type of device in which the designed circuit will be
implemented. Choose Cyclone II as the target device family. We can let Quartus
II software select a specific device in the family, or we can choose the device
explicitly. We will take the latter approach. From the list of available devices,
choose the device called EP2C5F256C6 which is the FPGA used on Altera’s
DE2 board. Press Next, which opens the window in Figure 7. Click next twice.
Figure 8
Figure 9
9. To include the input and the output nodes of the circuit to be simulated. Click
Edit > Insert >Insert Node or Bus to open the window in Figure 10.
Figure 10
It is possible to type the name of a signal (pin) into the Name box, but it is
easier to click on the button labeled Node Finder to open the window in
Figure 11. The Node Finder utility has a filter used to indicate what type of
nodes are to be found. Since we are interested in input and output pins, set
the filter to Pins: all. Click the List button to find the input and output nodes as
indicated on the left side of the figure.
Figure 12
10. We will now specify the logic values to be used for the input A and B during
simulation. The logic values at the outputs S and C will be generated
automatically by the simulator.
Figure
13
11. To perform the functional simulation, select Assignments > Settings to open the
Settings window. On the left side of this window click on Simulator Settings to
display the window in Figure 37, choose Functional as the simulation mode, and
12. Before running the functional simulation it is necessary to create the required
netlist, which is done by selecting Processing > Generate Functional Simulation
Netlist. A simulation run is started by Processing > Start Simulation, or by using
the icon . At the end of the simulation, Quartus II software indicates its
successful completion and displays a Simulation Report illustrated in Figure 14.
If your report window does not show the entire simulation time range, click on
the report window to select it. Observe that the outputs S and C are as specified
in their truth table(Figure 15).
Figure 14
Figure 15
Figure 16
Part Two: Design the Full Adder using two Half Adders
1. create a new project called full_adder in the same directory of the symbol of
half_adder, if not, we will add the symbol while we are creating the project in
step 2.
2. In the following figure add the symbol of the half adder to the project from its
directory ( ARCH_LAB), click add
Figure 19
The next vector waveform represents a sample of the output for the full adder
The End