prime number generation kla
play

Prime Number Generation KLA Each student is a processor in the - PowerPoint PPT Presentation

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


  1. 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.

  2. 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

  3. 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.

  4. Pipeline Insertion Sort

  5. Pipeline Insertion Sort “Type 2” Pipeline Algorithm

  6. Returning Results

  7. Returning Results

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend