teach-ict.com logo

THE education site for computer science and ICT

2. Sequence

A typical algorithm is shown below

  1. Ensure the data to be added is present in memory
  2. Identify the file to be opened
  3. Open the file
  4. Move to the end of the file
  5. Append the data from memory to the end of the file
  6. Save and close the file

It does not matter at this point about the purpose of the algorithm but note one very important thing: Each instruction is laid out one after another (numbering each line is up to you)

This is called 'sequence'. What this implies is that the algorithm will be able to run on a sequential CPU. Most ordinary CPUs are sequential. They handle instructions one at a time.

The opposite of sequence is 'parallel'. Which means more than one instruction is carried out at the same time. Parallel processing does have its uses and advantages but most of the time sequential algorithms are used.

Interesting fact:

Modern computer chips are often 'multi-core' which means they contain more than one CPU. But even if more than one core is used in parallel, each one is only handling instructions in sequence.

 

Challenge see if you can find out one extra fact on this topic that we haven't already told you

Click on this link: Sequential computer