Prime Number Generation KLA Each student is a processor in the pipeline. Sequence of numbers will be passed down the pipeline. If you receive a number and do not currently possess a number, that number becomes yours. If you receive a number and you do possess a number, check if the number you received is perfectly divisible by your number. ◦ If the number received is perfectly divisible, pass the number received to the next processor in the pipeline ◦ Else if the number received is not perfectly divisible, drop the number.
Prime Number Generation Sieve of Erathosthenes Series of all prime numbers is generated starting from 2. As numbers are passed down the pipeline, if a number reaches an empty processor, that number is kept. If the number is a multiple of the number in the processor, the passed number is deleted because they cannot be prime. Otherwise the number is passed on to the next processor in the pipeline. This process is repeated with each remaining number. The algorithm removes non-primes, leaving only primes. “Type 2” Pipeline Algorithm
Pipeline Insertion Sort KLA Each student is a processor in the pipeline. One student will act as the cycle counter. Sequence of numbers will be passed down the pipeline. As you receive the numbers, you will do one of the following ◦ If you do not currently have a number, hold on to that number ◦ Compare the numbers and pass the larger number to the next processor in the pipeline This will continue until all of the numbers have been sorted.
Pipeline Insertion Sort
Pipeline Insertion Sort “Type 2” Pipeline Algorithm
Returning Results
Returning Results
Recommend
More recommend