EET 2259 Unit 6 Shift Registers

Slides:



Advertisements
Similar presentations
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.
Advertisements

Floyd, Digital Fundamentals, 10 th ed EET 2259 Unit 10 Clusters and Matrices  Read Bishop, Sections 6.4 to  Lab #10 and Homework #10 due next week.
Loops in LabVIEW (while,for and case)
Floyd, Digital Fundamentals, 10 th ed EET 2259 Unit 5 Loops  Read Bishop, Sections 5.1 and 5.2.  Lab #5 and Homework #5 due next week.  Exam #1 next.
Loops A.About While Loops B.About For Loops C.About Case structures D.Sequence Structures E.Formula Node You Will Learn:
CS320n –Visual Programming LabVIEW Control Structures.
Floyd, Digital Fundamentals, 10 th ed EET 2259 Unit 4 SubVIs  Read Bishop, Chapter 4.  Lab #4 and Homework #4 due next week.
Workshop 3 of 7 Welcome!. Today's Topics Review of Workshop 2 Loops While For Auto-indexing Shift registers Case Structure.
EET 2259 Unit 7 Case Structures; Sequence Structures  Read Bishop, Sections 5.4 and 5.5.  Lab #7 and Homework #7 due next week.  Quiz #3 next week.
CS320n –Visual Programming
Floyd, Digital Fundamentals, 10 th ed EET 2259 Unit 9 Arrays  Read Bishop, Sections 6.1 to 6.3.  Homework #9 and Lab #9 due next week.  Quiz #5 next.
Digital Electronics and Computer Interfacing Tim Mewes 2. LabVIEW Basics part II.
EGR 2261 Unit 13 Classes Read Malik, Chapter 10.
CSC 211 Java I for loops and arrays.
EET 2259 Unit 13 Strings and File I/O
EET 2259 Unit 4 SubVIs Read Bishop, Chapter 4.
UMBC CMSC 104 – Section 01, Fall 2016
Applied Discrete Mathematics Week 2: Functions and Sequences
EGR 2201 Unit 6 Theorems: Thevenin’s, Norton’s, Maximum Power Transfer
Multiplication
Repetition Structures
EGR 2261 Unit 10 Two-dimensional Arrays
EET 2259 Unit 11 Charts and Graphs
EGR 2261 Unit 9 One-dimensional Arrays
EGR 2261 Unit 5 Control Structures II: Repetition
Chapter 5: MACHINATIONS
Loops BIS1523 – Lecture 10.
Topics Introduction to Repetition Structures
EGR 2201 Unit 5 Linearity, Superposition, & Source Transformation
CS/COE 0447 (term 2181) Jarrett Billingsley
EET 2259 Unit 5 Loops Read Bishop, Sections 5.1 and 5.2.
Multiplication
EET 2259 Unit 3 Editing and Debugging VIs
Topics Introduction to Repetition Structures
CLOSE Please YOUR LAPTOPS, and get out your note-taking materials.
Course Learning Map Lesson # Lesson Title Lesson 3 Lesson 2 Lesson 1
Introduction to LabVIEW
Using a Stack Chapter 6 introduces the stack data type.
Lab 2 : Structures Muhammad Zaigham Abbas Shah DIGITAL INSTRUMENTATION SYSTEMS.
Print slides for students reference
While loops The while loop executes the statement over and over as long as the boolean expression is true. The expression is evaluated first, so the statement.
Using a Stack Chapter 6 introduces the stack data type.
More Loops.
EET 2259 Unit 5 Loops Read Bishop, Sections 5.1 and 5.2.
Introduction to TouchDevelop
For Loops.
EGR 2201 Unit 5 Linearity, Superposition, & Source Transformation
Introduction to Programming
3.1 Iteration Loops For … To … Next 18/01/2019.
Computing Fundamentals
Structures- case, sequence, formula node
Latches The second part of CS231 focuses on sequential circuits, where we add memory to the hardware that we’ve already seen. Our schedule will be very.
Using a Stack Chapter 6 introduces the stack data type.
CST-115 Introduction to Computer Programming
EET 2259 Unit 9 Arrays Read Bishop, Sections 6.1 to 6.3.
University of Warith AL-Anbiya’a
EET 2259 Unit 13 Strings and File I/O
EGR 2131 Unit 12 Synchronous Sequential Circuits
Variables in C Topics Naming Variables Declaring Variables
Introduction to Programming
EET 2259 Unit 7 Case Structures; Sequence Structures
EET 2259 Unit 5 Loops Read Bishop, Sections 5.1 and 5.2.
EET 2259 Unit 11 Charts and Graphs
EET 2259 Unit 2 Virtual Instruments
EET 2259 Unit 4 SubVIs Read Bishop, Chapter 4.
James Wei Professor Peck 9/20/2013
EET 2259 Unit 6 Shift Registers
EET 2259 Unit 8 Other Structures; Local Variables
EET 2259 Unit 3 Editing and Debugging VIs
Presentation transcript:

EET 2259 Unit 6 Shift Registers Read Bishop, Section 5.3. Exam #1 this week. Lab #6 and Homework #6 due next week. -This week’s big idea is an extension of the loop idea from last week. -Example: E-Mail Notification.vi from two weeks ago contains a loop with shift regs.

Recalling Data From Previous Loop Iterations When programming with loops, you may need to recall data from previous iterations of the loop. Example: This program generates and displays a new random number each time through the loop. But the program “forgets” each earlier number every time it generates a new one. What if we need to remember the earlier values?

Recalling Data From Previous Loop Iterations (Cont’d.) LabVIEW provides two ways to “give your loops memory” and let them access data from previous iterations of a loop: Shift registers Feedback nodes I recommend not using feedback nodes; use shift registers instead. And definitely don’t use shift registers and feedback nodes in the same program—this gets very confusing. -Sometimes it’s a matter of personal preference whether you use a shift reg or a feedback node. But shift regs are more flexible and powerful.

Iteration Counter Provides One Form of “Memory” Within a Loop Before looking at shift registers, note that the iteration terminal automatically remembers one piece of information, namely, how many times you’ve executed the loop so far. In some cases this is all you need to remember, so you don’t need a shift register. Build and demo program shown.

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)

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) Shift register

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) -Demo by using WHILE loop to generate random #’s, displaying current and previous random #’s. Show how to drag down the left-hand terminal to display more than one previous number.

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) -Note how previous example, in which we didn’t initialize shift regs, gives misleading results. Fix this. -Have them save this example as shiftReg.vi.

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). The key is to use a shift register to keep track of the running total as we add each new integer. -For loop with N=10, shift reg + i back into shift reg. -Have them save as runningTotal.vi for future use. -Mention lab exercise that decides whether a voltage is increasing, decreasing, or staying constant; also mention warm-cold guessing game, which we’ll do in a future week.

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 the last previous value. (Bishop, p. 233)

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) Feedback node

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) Demo by changing shift reg in previous example to a feedback node.

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. Don’t use feedback nodes and shift registers in the same loop.