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

prime number generation kla
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 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.
slide-2
SLIDE 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

slide-3
SLIDE 3
slide-4
SLIDE 4

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.

slide-5
SLIDE 5

Pipeline Insertion Sort

slide-6
SLIDE 6

Pipeline Insertion Sort

“Type 2” Pipeline Algorithm

slide-7
SLIDE 7
slide-8
SLIDE 8

Returning Results

slide-9
SLIDE 9

Returning Results