I do not understand how the correct answer can be A? I get that the first two points will be 2 and 3 respectively, but then I am not so sure.
Any help I could get on this would be much appreciated.
So the shift register gets pre-loaded, before the loop starts with four values: 2, 3, 1 and 6. The loop takes an output from four deep in the shift register each iteration and compares it to the loop index. The max of this comparison is then saved for the plot and also put back onto the shift register.
I do not understand how the correct answer can be A? I get that the first two points will be 2 and 3 respectively, but then I am not so sure.
Any help I could get on this would be much appreciated.
So the shift register gets pre-loaded, before the loop starts with four values: 2, 3, 1 and 6. The loop takes an output from four deep in the shift register each iteration and compares it to the loop index. The max of this comparison is then saved for the plot and also put back onto the shift register.
Iteration Shift Register Contents Loop Index Output of Compare Plot Array
0 2, 3, 1, 6 0 2 2
1 3, 1, 6, 2 1 3 2,3
2 1,6,2,3 2 2 2,3,2
3 6,2,3,2 3 6 2,3,2,6
4 2,3,2,6 4 4 2,3,2,6,4
So the plot will contain the following values: 2,3,2,6,4, which is graph (a). Notice that B has the correct Y values but the X values are wrong.
Well, my spaces in the previous post got all replaced by a single space so the “table” is nearly impossible to read. Sorry !!!