== Testing the Digital Circuit by Stepping Manually ==
{{Note|In digital Digital circuit simulationssimulation is a time domain simulation. Furthermore, device propagation delays are typically in the order of nanosecondsit is an event-driven simulation. It is important to set means that the step size simulation engine waits for changes in the input(s) of the circuit and then updates the digital state of various nodes in response to those state changes. You can run a time domain simulation so that each in three different modes: '''Step''', '''Walk''' or '''Run'''. "Stepping" increments time a single time step still allows you at a time. "Walking" is faster than stepping and increments time by multiple steps at a time determined using a "Walk Factor". "Running" is equivalent to see the resulting changes without slowing the analog live simulation too muchand continues indefinitely until you pause it or stop it and reset. A The first thing you always do in a [[Digital Simulation|digital simulation]] is to set the time step size of 20ns is suggested but can be adjusted from there.}}
Digital {{Note|In digital circuit simulation is a time domain simulation. Furthermoresimulations, it is an event-driven simulation. It means that the simulation engine waits for changes device propagation delays are typically in the input(s) order of the circuit and then updates the digital state of various nodes in response to those state changesnanoseconds. You can run a time domain simulation in three different modes: '''Step''', '''Walk''' or '''Run'''. "Stepping" increments time a single time step at a time. "Walking" is faster than stepping and increments time by multiple steps at a time determined using a "Walk Factor". "Running" is equivalent to the analog live simulation and continues indefinitely until you pause it or stop it and reset. The first thing you always do in a [[Digital Simulation|digital simulation]] It is important to set the time step size. Note of the simulation so that "'''Step Size'''" is different from "'''Step Ceiling'''". Step size specifies how large each time step of still allows you to see the simulation is when using the "Simulation Stepping" feature. Step Size does not factor into resulting changes without slowing the simulation when running the engine in "'''Walk'''" or "'''Run'''" modes, where the simulation engine itself decides how large a step to taketoo much. On the other hand, Step Ceiling is the maximum value that you specify for the automatically calculated time A step when a simulation size of 20ns is "Walked" or "Run"suggested but can be adjusted from there.}}
To set the step size, go to [[File:b2TUT4_8.png|thumb|left|300px|The Simulation Time Options dialog.]]Also note that "'''Simulate MenuStep Size''' and select the " is different from "'''Time Options...Step Ceiling'''" to open . Step size specifies how large each time step of the simulation is when using the "Simulation Time Options DialogStepping" feature. Or click Step Size does not factor into the button labeled simulation when running the engine in "'''...Walk'''" on the or "'''[[Toolbars#Main_Toolbar|Main Toolbar]]Run''' on " modes, where the left of simulation engine itself decides how large a step to take. On the Run button as shown in other hand, Step Ceiling is the figure below. You can also use maximum value that you specify for the keyboard shortcut automatically calculated time step when a simulation is "Ctrl+IWalked" to open this dialog, which is shown below: or "Run".
{| border=To set the step size, go to '''Simulate Menu''' and select the "0'''Time Options...'''"to open the Simulation Time Options Dialog. Or click the button labeled {{key|-| valign="top"...}} on the '''[[Toolbars#Main_Toolbar|[[File:b2TUT4_7.pngMain toolbar|thumb|left|480px|Simulation Portion of Main MenuToolbar]]| valign=]]''' on the left of the Run button as shown in the figure below. You can also use the keyboard shortcut "bottomCtrl+I"|[[Fileto open this dialog, which is shown below:b2TUT4_8.png|thumb|left|270px|Simulation Time Options Dialog]]|-|}
Set the "'''Time Step'''" to 20n, leave the "'''Walk Factor'''" at the default value of 2 and close the dialog. Now start the [[Digital Simulation|digital simulation]] by "Stepping" your digital circuit. Click the "'''Step'''" <table><tr><td>[[File:b2Step_Toolb2TUT4_7.png]] button |thumb|left|570px|Simulation Portion of the '''[[Main toolbar|Main Toolbar]]''' or select "Step" from the "'''Simulate Menu'''" or simply use the keyboard shortcut "'''Ctrl+H'''". The simulation time will increase to 20ns, and the outputâs value will change to 0. Note that all your three input have initial values of 0. The state of your circuit is shown in the figure below on the left. Next, change the value of Input 1 to 1 and leave the Input 2 and Input 3 at 0. During a live simulation, you can change the values of inputs by clicking on their "'''Up'''" and "'''Down'''" arrow buttons at their right end. Note that by changing the input values, the output doesn't change immediately. This is because you the engine is waiting for you to step the time to compute the next state of the circuit. Click the "'''Step'''" [[File:b2Step_Tool.png]] button or type "'''Ctrl+H'''" one more time. The simulation time increases to 40ns, but the outputâs value stays at 0. This is expected as a three-input AND circuit requires all three inputs to be 1 to have an output of 1. The state of the circuit at t = 40s is shown below in the middle figure. Finally, change the values of Input 2 and Input 3 to 1. Step the simulation to 60ns. This time, the output changes to 1 as shown below in the figure on the right. </td></tr></table>
{| border=Set the "0'''Time Step'''"|-| valign=to 20n, leave the "bottom'''Walk Factor'''"|at the default value of 2 and close the dialog. Now start the [[File:b2TUT4_9.png|thumbDigital Simulation|left|360px|State of Circuit at t = 20nsdigital simulation]]| valign=by "bottomStepping" your digital circuit. Click the "'''Step'''"|[[File:b2TUT4_10b2Step_Tool.png]] button of the '''[[Main toolbar|thumbMain Toolbar]]''' or select "Step" from the "'''Simulate Menu'''" or simply use the keyboard shortcut {{key|Ctrl+H}}. The simulation time will increase to 20ns, and the outputâs value will change to 0. Note that all your three inputs have initial values of 0. The state of your circuit is shown in the figure below on the left. Next, change the value of Input 1 to 1 and leave the Input 2 and Input 3 at 0. During a live simulation, you can change the values of inputs by clicking on their {{key|360pxUp Arrow}} and {{key|State of Circuit Down Arrow}} buttons at their right end. Note that by changing the input values, the output doesn't = 40ns]]| valign=change immediately. This is because the engine is waiting for you to step the time to compute the next state of the circuit. Click the "bottom'''Step'''"|[[File:b2TUT4_11b2Step_Tool.png]] button or type {{key|thumb|left|360px|State Ctrl+H}} one more time. The simulation time increases to 40ns, but the outputâs value stays at 0. This is expected as a three-input AND circuit requires all three inputs to be 1 to have an output of Circuit 1. The state of the circuit at t = 40s is shown below in the middle figure. Finally, change the values of Input 2 and Input 3 to 1. Step the simulation to 60ns]]|-|}. This time, the output changes to 1 as shown below in the figure on the right. Note that at each time step, the state of all the wires including the output of the NAND gate is displayed on the circuit. The binary states are shown in small black box labels. You can also tell the state of a wire from its color. Blue is 0 and red is 1.
Note that at each time step, <table><tr><td>[[File:DigiTUT1_3.png|thumb|480px|State of the state digital circuit at t = 20ns.]]</td></tr><tr><td>[[File:DigiTUT1_4.png|thumb|480px|State of all the wire including the output digital circuit at t = 40ns.]]</td></tr><tr><td>[[File:DigiTUT1_5.png|thumb|480px|State of the NAND gate is displayed on the digital circuitat t = 60ns.]]</td></tr></table>
== Using Live Digital Timing Diagrams ==