Lab #4 Solution

$30.00

Description

Total Points: 100 – Please read the entire lab before starting.

Part 1: Adders

Half-Adder

  1. Open a new project called Adders. Rename the Page and the Schematic “Half_Adder.” This is an important step, don’t skip it.

  1. Create your half-adder. Name the upper input “X” and the lower input “Y.” The outputs should be named “SUM” and “CARRY.” IMPORTANT: Use XOR 7486

  1. Place the ports. DO NOT use DSTIM1 as the inputs for x and y. Use PORTRIGHT-R. This port can be found in the same place as PORTLEFT-L. This is because you will be creating a user-defined part for the half adder later on. If you do use a DSTM1 input at this point you WILL create a problem which will require you to start this part of the lab over.

  1. SAVE YOUR DESIGN. Do NOT simulate this design at this point!!! Since you have no DSTM1 inputs applied to your circuit, you CANNOT simulate the circuit.

Creating a part.

You can generate a part for any circuit design you create. This increases the flexibility of the software and the simplicity of designs.

To generate a part from your design, complete the following steps.

  1. In the Project Manager window (this is the tab which shows all the folders in the project), select the Half_Adder folder.

  1. From the Tools Menu, (top menu bar), select Generate Part.

  1. In the Generate Part dialog box which appears, specify the location (Netlist/source file) of the design file that contains the circuit for which the part is to be made – adders.dsn. It may or may not be filled in for you, but if you follow the directions it will be.

  1. In the Netlist/source file type drop-down box, specify the source type as Capture Schematic/Design.

  1. In the Part Name text box, specify Half_Adder.

6. The name and location of the library that will contain the created part is ….\adders.olb.

  1. Save the source schematic by selecting the Copy Schematic to library check box. This is not checked in the picture above. Be sure you do select it for this part.

  1. Be sure Create new part is selected.

  1. To specify the schematic folder that contains the design for which the part is to be made, select Half_Adder from the Source Schematic name drop-down list box. Then click Save. You should see something like this.

If you don’t see all your inputs then most likely you are using a DSTM as an input instead of a port. This is where you can change the location of your ports, if for some reason Orcad’s part generator doesn’t place your ports where you want them.

Building a Full-Adder

  1. In the Project Manager window, right-click on Adders.dsn and select New Schematic. Name it Full_Adder and click OK.

3

  1. A folder named Full_Adder should appear below the Half-Adder folder.

  1. Save the design.

  1. Make the full adder circuit design root. Right click on Full_Adder and select Make Root. The Full_Adder folder moves up and a forward slash appears in the folder.

  1. Right-click on Full_Adder and select New Page, specify the page name as Full_Adder and click OK. A new page, Full_Adder, gets added below the schematic folder Full_Adder

  1. Open the Full_Adder page you just added to open it for editing.

  1. In the place part menu, under libraries click on ADDERS. The part you made previously should be here.

  1. Use the Half_Adder part you created and make a full adder.

  1. Place an OR gate (7432) to the schematic. Then add the wires as shown in the figure below.

  1. At this point you are ready to add the stimulus to the design. Add DigStim1, from the Part List, to the inputs on the left of the design. Remember to hit escape when done.

  1. Change the Implementation Value of the three inputs to Carry_in, X, and Y, respectively. Carry_in should be the name of the top-most input.

  1. Select the Place Port button and add a port (PORTLEFT-L) to the output of the OR gate. Change the port name to CARRY_OUT. Also add a port for the SUM and rename it appropriately.

13. Save the design.

Annotate the design

This is different than what you have done previously so carefully follow all steps. The difference is because you are now annotating a design which uses a usercreated part.

  1. In the Project Manager window, select the .dsn file.

  1. Choose Tools – Annotate.

  1. In the Packaging tab of the Annotate dialog box, specify whether you want the complete design or only a part of the design to be updated. Select the Update entire design option.

  1. In the Actions section, select the Incremental reference update option.

  1. Select the Update Occurrences option.

Note: When you select the Update Occurrences option, you may receive a warning message. Ignore this message because for all complex hierarchical designs, the occurrence mode is the preferred mode. The Use instances option is shown as preferred because the project type is Analog or Mixed A/D.

  1. For the rest of the options, accept default values and click OK to save your settings.

The Undo Warning message box appears.

  1. Click Yes.

A message box stating that the annotation will be done appears.

  1. Click OK.

Your design is annotated and saved. You can view the value of updated cross reference designators on the schematic page.

Please note that each time you make a change to parts/wires/components in a design you will need to re-annotate the design. If you have used a part you created you may need to update occurances. You definitely will if you change the part design and recreate the part.

Test Your Full Adder

  1. To test your design, you will have to create a stimulus file with 3 inputs. You will need to ensure that whatever frequencies you select for your inputs, you cover all the possible combinations of the three inputs. Remember with 3 inputs there are 2n = 8 possible combinations. It is strongly suggested that with each input you double the previous frequency to ensure you create all possible combinations of the inputs.

  1. Once you have created your stimulus file, simulate your design.

Build a 2 bit adder.

  1. two-bit adder is one that can add numbers consisting of 2-bits, i.e. 112.

    1. Create a part for the Full-Adder. You will need to ensure that you replace the DigiStim inputs on the previous design with ports. If you do not your design will not work right.

    1. Use your newly created part to create a 2 bit adder. This is an adder which adds 2 2-bit numbers.

    1. Simulate your design using the provided 2BitAdderTest.stl file.

Part 2. Deliverables Uploaded to CANVAS

Please name your files in such a way that the name is descriptive of what part of the lab they pertain to. Example: Full_Adder_Circuit, Full_Adder_Stimulus,

Full_Adder_Results. Files named 1 or part1 will not be accepted for full credit.

  1. A pdf of every schematic

  1. A pdf of the results of the simulations.

  1. A pdf of your simulation file(s).

6