2. (1 pt) Consider the following sorting network you saw in class: IN OUT Assume
ID: 3706830 • Letter: 2
Question
2. (1 pt) Consider the following sorting network you saw in class: IN OUT Assume each comparator (i.e. the circles) takes 1 millisecond (1/1000th of a second) to compare its two elements and output its results and that the time for a data value to go from one comparator to the next is negligible. We wish to sort 2000 sets of 6 integers each (a) If we sort one set of 6 integers completely before starting the next set, how long will it take to sort the 2000 sets in seconds? (Remember that some of the comparators are operating concurrently.) b) If we use the principle of pipelining, how long will it take to sort the 2000 sets, rounded to the nearest second? (NOTE: To simplify the problem, assume there are some dummy comparators inserted into the network as shown below so that all results arrive at the output terminals at the same time.) IN OUTExplanation / Answer
a) A integer has to go through at max 5 comparators so 1 sort operation take 5ms and therefore 2000 sorting operations take 10000ms ie. 10s(answer)
b) Time taken for the 1st dataset to flow to 5th layer 4ms after that in each millisecond 1 dataset is sorted so it takes 2004ms or 2.004s and 2s(answer) after rounding
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.