Changes

Jump to: navigation, search
/* Building a 4-Bit Shift Register Using D Flip-Flops */
{{projectinfo|Tutorial| Exploring Flip-Flops and Sequential Logic Circuits |TUT11-97.png|In this project, the basic concepts of RF.Spice A/D are demonstrated, and a simple voltage divider is modeled and examined.|
*[[CubeCAD]]
*[[EM.Tempo#Far Field Calculations in FDTD | Far Fields]]
*[[Advanced Meshing in EM.Tempo]]
|All versions|{{download|http://www.emagtech.com/contentdownloads/project-file-download-repository|EMProjectRepo/DigitalLesson3.Tempo zip Digital Lesson 1|[[EM.Cube]] 14.83}} }}
=== Objective What You Will Learn ===
In this tutorial lesson, first you will build SR flip-flop circuits out of logic gates. You will examine their truth table and use them to verify the operation of B2.Spice's own generic SR latch device. Then you will examine B2.Spice's D flip-flop device and will use four D flip-flops to design a 4-bit shift register. Finally, you will examine B2.Spice's JK flip-flop device and will use four JK flip-flops to design a 4-bit binary counter. You will use both the live timing diagrams and transient analysis in this tutorial lesson.
</table>
[[File:TUT11-15.png|thumb|500px|The property dialog of the D-Type Flip-Flop device.]] To understand the operation of the flip-flop circuit, you will use the "Live Digital Timing Diagram" feature of [[RF.Spice A/D]]. As you earned in the previous tutorial lesson, set the step time to 20ns. Set the input initially to In1 = 0. Then, to activate the timing diagram, click the "'''Show/Hide Live Digital Timing Diagrams'''" [[File:b2Timing_Tool.png]] button of the '''[[Toolbars#Schematic_Toolbar |Schematic Toolbar]]'''. Remember that nothing will happen until you start a [[Digital Simulation|digital simulation]]. Click the "'''Step'''" [[File:b2Step_Tool.png]] button of the '''[[Toolbars#Main_Toolbar |Main Toolbar]]''' or use the keyboard shortcut {{key|Ctrl+H}} to advance the simulation time one step at a time. Step the simulation time to 60ns and then change the input to In1 = 1. Keep stepping to 160ns and then change the input to In1 = 0 again. Continue stepping to 400ns and change the input to In1 = 1 once again and then proceed to 600ns. The table below summarizes the input entries:
{| class="wikitable"
|}
[[File:TUT11-15.png|thumb|500px|The property dialog of the D-Type Flip-Flop device.]]
The timing diagram of your D flip-flop circuit is shown in the figure below. As you can see from the figure, the input first rises from 0 to 1 at t = 160ns. The flip-flop waits until the next rising edge of the clock signal at t = 200ns. The input's high state is transferred to the output Q with a propagation delay of 14ns. According to the property dialog of the D Flip-Flop device, the low-to-high propagation delay of the device is tPLH = 14ns, while its high-to-low propagation delay is tPHL = 1420ns. Therefore, Q rises from 0 to 1 at t = 214ns and stays high for the next several clock cycles. The input next falls from 1 to 0 at t = 260ns. The flip-flop waits until the next rising edge of the clock signal at t = 300ns. The input's low state is transferred to the output Q with a propagation delay of 20ns. Therefore, Q falls from 1 to 0 at t = 320ns and stays low for the next several clock cycles. The input rises again from 0 to 1 at t = 400ns and stay high for the rest of the simulation time. This time the flip-flop has to wait a full clock period until the next rising edge of the clock signal at t = 500ns. The input's high state is transferred to the output Q with a propagation delay of 14ns. Then, Q rises again from 0 to 1 at t = 514ns and stays high for the rest of the simulation time.
|}
A shift register is a multi-output digital circuit that transfer the input data to its outputs sequentially at each clock cycle. Cascade the four D flip-flops as shown on the figure by connecting the Q pin of each to the D pin of the next. All four flip-flops share the same clock signal. Use the same clock settings from the previous part (Period = 100ns and Pulse Width = 50ns). Set the step time to 20ns. Enable the live digital timing diagram. Run a [[Digital Simulation|digital simulation]] and step through 1200ns. Set the value of the input "Data" to 0 and change it to 1 at t = 100ns and change it back to 0 at t = 600ns.
<table>
</table>
<p>&nbsp;</p>
[[Image:Back_icon.png|40px]] '''[[RF.Spice_A/D#RF.Spice_A.2FD_Tutorial 2FD_Tutorials | Back to RF.Spice A/D Tutorial Gateway]]'''
28,333
edits