There are only two ways to tell somebody thanks: Kudos and Marked Solutions Unofficial Forum Rules and Guidelines "Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
I get C too. (9 minus 5 => 4) I was not able to solve this just in my head. I had to print it out and had to use pens with diffrent coulors to keep track of. So I am not sure if I could solve this in an environment of a real exam from NI ... I should try to solve more Daily CLADs from the past 😉
@crossrulz: OK, thank you. I try to remeber your words next time if the question is from similiar type.
The inner loop runs 6 times (2*3=6) and the feedback node is initialized to 3. So for the top, you get 2*3*1+3 = 9. Since the bottom loop reinitializes the feedback node each time the outter loop is ran, you get 2*1*1+3 = 5. 9-5=4.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions Unofficial Forum Rules and Guidelines "Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
C. The top for loop has it's outer loop initialized to three and it won't re-initialize until the loop is called again else where. Since that doesn't happen the end result should be 9.
The bottom for-loop has it's inner loop initialized to three and every time it's called the inner loop re-initializes. This happens every time the bottom outer loop is calls it so the end result should be 5. Subtracting the two should result in 9-5=4.
Feedback Nodes work just like shift registers: they pass data from one loop iteration to the next.
The point to notice here is where the shift register is being initialized.
The top diagram has the Feedback Node being initialized on the outer loop. This would be equivalent to having a shift register on both loops and initializing the outer loop's shift register.
The botton diagram has the Feedback Node being initialized on the inner loop. This would be equivaltent to having a shift register on just the inner loop. This also means that the feedback node is re-initialized with each iteration of the outer loop.
Here is what the equivalent would be using shift registers:
There are only two ways to tell somebody thanks: Kudos and Marked Solutions Unofficial Forum Rules and Guidelines "Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Wait, are you saying I'm not awesome? That hurts...
There are only two ways to tell somebody thanks: Kudos and Marked Solutions Unofficial Forum Rules and Guidelines "Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5