Presentation is loading. Please wait.

Presentation is loading. Please wait.

Floyd, Digital Fundamentals, 10 th ed EET 2259 Unit 6 Shift Registers Read Bishop, Section 5.3. Midterm Exam this week. Lab #6 and Homework #6 due next.

Similar presentations


Presentation on theme: "Floyd, Digital Fundamentals, 10 th ed EET 2259 Unit 6 Shift Registers Read Bishop, Section 5.3. Midterm Exam this week. Lab #6 and Homework #6 due next."— Presentation transcript:

1 Floyd, Digital Fundamentals, 10 th ed EET 2259 Unit 6 Shift Registers Read Bishop, Section 5.3. Midterm Exam this week. Lab #6 and Homework #6 due next week.

2 Floyd, Digital Fundamentals, 10 th ed Shift Registers and Feedback Nodes When programming with loops, you may need to access data from previous iterations of the loop. LabVIEW provides two ways to do this: 1. Shift registers 2. Feedback nodes (Bishop, p. 227) I recommend not using feedback nodes; use shift registers instead.

3 Floyd, Digital Fundamentals, 10 th ed Shift Registers Shift registers transfer values from one iteration of a For Loop or While Loop to the next iteration. To create a shift register, right-click on the left or right border of a loop and select Add Shift Register. (Bishop, p. 227)

4 Floyd, Digital Fundamentals, 10 th ed Shift Registers (Continued) A shift register appears as a set of arrows on the borders of the loop: an up arrow on the right border, and one or more down arrows on the left border. These arrows are terminals that can be wired to other items inside or outside the loop. (Bishop, p. 228)

5 Floyd, Digital Fundamentals, 10 th ed Using a Shift Register The terminal on the right border receives and stores a data value as each iteration of the loop finishes. This value then becomes available from the terminal on the left-hand border during the next iteration. (Bishop, p. 228)

6 Floyd, Digital Fundamentals, 10 th ed Using a Shift Register (Continued) The shift registers initial value is set by wiring the left terminal to a constant or a control or another element outside of the loop. For consistent results, always initialize your shift registers. The shift registers final value can be used by wiring the right terminal to an element outside of the loop. (Bishop, pp )

7 Floyd, Digital Fundamentals, 10 th ed Example Program Write a program that finds the sum of all integers from 0 to 9. (Can easily extend this to find the sum of all integers from 0 to any positive integer). They key is to use a shift register to keep track of the running total as we add each new integer.

8 Floyd, Digital Fundamentals, 10 th ed Feedback Nodes Feedback Nodes offer another way to transfer values from one iteration of a loop to the next iteration. Shift registers are more powerful because they can remember as many of the previous values as you want, while feedback nodes can only remember one previous value. (Bishop, p. 233)

9 Floyd, Digital Fundamentals, 10 th ed Feedback Nodes (Continued) A Feedback Node appears as an arrow inside a rectangle, along with an associated Initializer Terminal on the loops left border. (Bishop, p. 234)

10 Floyd, Digital Fundamentals, 10 th ed Converting Between Shift Registers & Feedback Nodes A Feedback Node can be converted to a shift register (or vice versa) by right- clicking and selecting Replace with Shift Register (or Replace with Feedback Node). (Bishop, p. 234)

11 Floyd, Digital Fundamentals, 10 th ed Creating Feedback Node by Wiring Output to Input A Feedback Node will appear automatically if you wire the output of an element or group or elements to the input of that same element or group.


Download ppt "Floyd, Digital Fundamentals, 10 th ed EET 2259 Unit 6 Shift Registers Read Bishop, Section 5.3. Midterm Exam this week. Lab #6 and Homework #6 due next."

Similar presentations


Ads by Google