1 / 11

EET 2259 Unit 6 Shift Registers

EET 2259 Unit 6 Shift Registers. Read Bishop, Section 5.3. Midterm Exam this week. Lab #6 and Homework #6 due next week . Shift Registers and Feedback Nodes. When programming with loops, you may need to access data from previous iterations of the loop.

phuc
Download Presentation

EET 2259 Unit 6 Shift Registers

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. EET 2259 Unit 6Shift Registers • Read Bishop, Section 5.3. • Midterm Exam this week. • Lab #6 and Homework #6 due next week.

  2. 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: • Shift registers • Feedback nodes (Bishop, p. 227) • I recommend not using feedback nodes; use shift registers instead.

  3. 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. 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. 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. Using a Shift Register (Continued) • The shift register’s 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 register’s final value can be used by wiring the right terminal to an element outside of the loop. (Bishop, pp. 228-231)

  7. 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. 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. Feedback Nodes (Continued) • A Feedback Node appears as an arrow inside a rectangle, along with an associated Initializer Terminal on the loop’s left border. (Bishop, p. 234)

  10. 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. 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.

More Related