Changes

Digital Tutorial Lesson 1: Examining Logic Gates

3,595 bytes removed, 23:41, 21 September 2015
Finally, use one the wiring methods you learned in the earlier tutorial lessons to connect all the parts and I/O ports. At the end, you should have a digital circuit similar to the figure shown at the beginning of this lesson. Straight wires can always be drawn by simply clicking on device pins and dragging a line out of the pins. For drawing bent lines and multi-segment lines, sometimes you have to use the '''Wire Tool'''.
=== Testing the Digital Circuit by Stepping Manually === 
{{Note|In digital circuit simulations, device propagation delays are typically in the order of nanoseconds. It is important to set the step size of the simulation so that each step still allows you to see the resulting changes without slowing the simulation too much. A step size of 20ns is suggested but can be adjusted from there.}}
Note that at each time step, the state of all the wire including the output of the NAND gate is displayed on the circuit.
=== Using Live Digital Timing Diagrams ===
[[B2.Spice A/D]] allows you to view the state of your digital inputs and outputs graphically in real time using "'''Live Timing Diagrams'''". The timing diagrams appear at the bottom of the Workshop just like a regular graph. However, these are interactive "live" graphs that change and expand with every time step. For this part of the lesson, you keep the value of "Time Step" at 20ns. First, reset your simulation engine by clicking the "'''Stop/Reset'''" [[File:b2Stop_Tool.png]] button of the [[Main toolbar|Main Toolbar]], or using the keyboard shortcut "'''Ctrl+E'''". Also reset the values of all the three inputs to 0.
{{Note|The timing diagram updates only when there is a change of states of the inputs.}}
 
=== Running a Transient Test of the Digital Circuit ===
 
[[File:b2TUT4_16.png|thumb|400px]]
[[File:b2TUT4_15.png|thumb|360px|Property Dialog of Digital Source]]
Since digital simulations take place in the time domain, you can also run a transient test on them. Recall from previous tutorial lessons that unlike live simulations, [[tests]] are preplanned simulation. In other words, in a test, the inputs are completely known and will not change during the period of time when the simulation engine is doing its job. At the end of a test, you will see the final results. Contrast this to a live [[Digital Simulation|digital simulation]], when the engine waits for you to make your next move. Then it responds to your action. For transient test of digital circuit, [[B2.Spice A/D]] offers another type of digital input called a "'''Digital Source'''". A digital source is indeed the same as a digital input except for the fact that it contains a preloaded "'''Time-Value Array'''". This means that a digital source knows in advance what values it will take at certain times during the simulation.
 
At this point, go back to your circuit and delete all the three digital inputs. Select each part and press the keyboard's '''Delete Key'''. Next, from the '''Parts Menu''', select the '''Digital I/O''' submenu and then select "'''Digital Source'''". Place the source in your circuit at the location where you used to have Input 1 and connect it to the same wire. Use the keyboard's '''SPACE Bar''' to duplicate the digital source twice and place them at the locations of the old Input 2 and 3. Your digital circuit should now look like the opposite figure.
 
Double-click the first digital source to open its property dialog as shown below. In the table titled "'''Edit Time-Value Array'''", enter the binary values of the source as a function of time according to the state table shown in the previous section. Enter time in nanoseconds and use the values in "Input 1" column for the first digital source. Similarly, open the property dialogs of the second and third digital sources and enter their time-value arrays using the values in the "Input 2" and "Input 3" columns of the above table, respectively.
 
{{Note|The "Time-Value" array of a digital source can be conveniently loaded from a text file.}}
 
{| border="0"
|-
| valign="bottom"|
[[File:b2TUT4_17.png|thumb|left|220px|Edit Graph Dialog]]
| valign="bottom"|
[[File:b2TUT4_18.png|thumb|left|220px|Edit Axis Dialog]]
|-
|}
 
[[File:b2TUT4_19.png|thumb|640px| The output graph of transient analysis of the digital circuit.]]
 
Next, bring up the '''Transient Test''' from the '''[[Tests]] Toolbox''', and set the [[parameters]] for the test as follows:
 
Start Time: 0
 
Stop Time: 420n
 
Linearize Step: 1n
 
Step Ceiling: 1n
 
Click the Run button to run the transient test. The following graph will appear at the bottom of the Workshop. This is indeed identical to the timing diagram you viewed in the previous step of the lesson. However, this digital graph is a regular [[B2.Spice A/D]] graph with full analysis and customization capability. For example, you can zoom in on the rising and falling edges of the pulses and examine the propagation delays.
 
 
=== Saving the Circuit ===
 
Save your first digital circuit using the keyboard shortcut "'''Ctrl+S'''" or by selecting "'''Save'''" from the '''File Menu'''. Since your circuit does not have a name yet, the program will prompt you for a name. Then quit the [[B2.Spice A/D]] and take a break. Congratulations! You have built a 3-input And function, similar to the 74LS11.
<p>&nbsp;</p>
[[Image:Back_icon.png|40px]] '''[[RF.Spice_A/D#RF.Spice_A.2FD_Tutorial | Back to RF.Spice A/D Tutorial Gateway]]'''
28,333
edits