In this tutorial I will explain you the working of a simple digital system known as an Adder. As the name implies an adder is used to add two or more digital numbers. At the start a brief and concise introduction to adder specifically a simplest half adder is provided with the explanation of the output they will show. After that the circuits is simulated using PSPICE and the result are compared with the theoretical discussion provided (which should be same). At the end of the tutorial you are provided with an exercise to do it by yourself, and in the next tutorials I will assume that you have done those exercises and I will not explain the concept regarding them.
Introduction to Half and Full Adders
An adder is a digital circuit and as the name implies is used for addition of two or multiple numbers. A half adder is used to perform the addition between 2 numbers and if we are willing to add three numbers (digital) together than the adder used will be a full adder. A circuit diagram of half adder and full adder is shown in the figure below,
Figure 1: Circuit diagrams
We should also take a glance on the truth tables of these adders. The truth table of half adder will have two inputs as shown in the truth table given below,
Figure 2: Truth table of half adder
Below is given the truth table of a full adder which you can use to complete the exercise given at the end.
Figure 3: Truth table of full adder
Half adder simulation using PSpice
- Lets’ design a simple digital circuit of an adder i.e. Half adder and the full adder is left as an exercise for the reader and the half adder is formed using XOR and AND gates as I will explain shortly in this tutorial. Open the PSPICE design manager on your PC by typing design manager in the search bar. From the design manager click on the run schematic button to open a new blank schematic as shown in the figure below,
Figure 4: Opening the schematic
- After opening the new schematic before jumping into designing first save the schematic by clicking on the file button at the top left corner and then selecting save as so that we can access it anytime in the future. Refer to the figure below,
Figure 5: Saving schematic
- Click on the get new part icon at the top bar of the schematic window in order to search for the components that are needed for circuit designing.
Figure 6: Getting new part
- In the get new part window, type ‘7486’ it will display a XOR gate available in PSPICE. From that list select a simple XOR gate as shown in the figure below,
Figure 7: Placing XOR gate
- Again open the get new part window and in the part name block type 7408, select the AND gate from the list given and then click on place & close as shown in the figure below
Figure 8: Placing AND gate
- Again open the get new part window and in the part name block type STM, select the digital supply from the list given and then click on place & close as shown in the figure below
Figure 9: Placing digital supply
Figure 10: Placed components
- Click on the draw wire icon at the top bar of the schematic window in order to connect the already placed components for circuit designing, as shown in the figure below,
Figure 11: Draw wire
Figure 12: Complete circuit diagram
- If you want to display the voltage at a specific node of the circuit diagram you can do this by placing a voltage marker at that node. On the top of the schematic window, click on the Voltage/Level Marker button as shown in the figure below,
Figure 13: Voltage marker
- Place it at the output i.e. the sum and the carry node and at the input A and B nodes also place a voltage marker as shown in the figure below,
Figure 14: Placed voltage marker
- If we are interested in checking the voltage on a specific wire in spite of checking it at a node, double click on the wire and inn the window that appear as a result, type the name of the wire you want to label it with, as shown in the figure below,
Figure 15: Labeling
Figure 16: Labeled diagram
- Next step is to set the attributes of the input digital supply. Double click on the dstm1 supply you connected in the circuit previously and set the input commands of the digital input system as shown in the figure below,
Figure 17: Input attributes
- The commands in the attributes window represents the value of the input at the corresponding time in the command before the space. The COMMAND1 = 0s 0 shows that at time 0s the value of the input dstm is 0 and the COMMAND2 = 1s 1 shows that the value will update to 1 at time 1 second. Similar is the case with COMMAND3 = 2s 0 that at 2 seconds the value of the input will be 0.
- Next step is to set the attributes of the input digital supply. Double click on the dstm2 which is used as the supply source B you connected in the circuit previously and set the input commands of the digital input system as shown in the figure below,
Figure 18: Input attributes of B
- Next step is to adjust the properties of the simulations in order to produce the graph of the voltage at the marker. Click on analysis and then click on Setup as shown in the figure below
Figure 19: Simulation setup
- A widow will appear, click on the transient block on the window and adjust the properties of the window according to your requirement, refer to the figure below,
Figure 20: Transient properties
- The final time of the response is 2s because we have set the commands for only up to 2s. Now comes the simulation part, click on the analysis at the top bar of the schematic window and then click on simulate as shown in the figure below,
Figure 21: Simulation
- A schematic window will appear showing the voltage at the output wire and the input source as shown in the figure below,
Figure 22: Output of the adder
The output of the half adder is in accordance with the theoretical analysis as you can see from the figure above.
Exercise:
- Design and Simulate the full adder using the information provided in the introduction part and the procedure in the explanation portion