Suppose we have 32 numbers to be added. You must use the following numbers as ex
ID: 3875845 • Letter: S
Question
Suppose we have 32 numbers to be added. You must use the following numbers as examples for illustration purposes: 1, 62, 80, 7, 6, 10, 20, 4, 57, 60, 37, 40, 55, 65, 60, 12, 16, 21, 20, 70, 85, 90 34, 25, 28, 36, 42, 3, 6, 46, 50, 100. We have 8 processors available. Using a diagram or a verbal description, clearly show how you would add up the numbers in parallel. You must say which processor does what, what happens first, what happens next, etc. The processing goal should be to minimize the time period between the time the addition begins and ends. Assume that a processor can add at most 2 numbers at any point in time, but have unlimited memory.
Explanation / Answer
Answer:
Since we have 32 numbers and 8 processors, this means that even after parallel processing we need to divide the numbers into batches in such a way that the parallel processing is 100% utilized.
so we will divide this number into 2 batches and then perform the addition the result will be 16 numbers.
Batch 1: 1, 62, 80, 7, 6, 10, 20, 4, 57, 60, 37, 40, 55, 65, 60, 12
Batch 2: 16, 21, 20, 70, 85, 90 34, 25, 28, 36, 42, 3, 6, 46, 50, 100
After addition
Batch 1: 63, 87, 16, 24, 117, 77, 120, 72
Batch 2: 37, 90, 175, 59, 64, 45, 96, 150
Now we will add these,
100, 177, 191, 93, 181, 122, 216, 222
Now only four processors required to add these
277, 284, 303, 438
561, 741
1302, final sum
The approach which we have used to add the numbers has utilized the processors in en efficient manner.
Please provide your valuable feedback.