Skip to content

9618 · 15.1

Processors, Parallel Processing and Virtual Machines — practice questions

Practice and worked examples for 9618 Processors, Parallel Processing and Virtual Machines. Short previews only — attempt the full question in MarkScheme against the official scheme.

Worked example 1

A non-pipelined processor takes 8 ns to execute one instruction. A functionally equivalent 4-stage pipelined processor is designed. Due to latch overhead, the clock cycle time for the pipelined processor is 2.5 ns. Calculate the time saved by using the pipelined processor to execute 200 instructions.

Show solution outline

To solve this, we calculate the total time for each processor and then find the difference.

1. Non-Pipelined Processor Time: Total Time = Number of instructions × Time per instruction Total Time = 200 × 8 ns = 1600 ns

2. Pipelined Processor Time: The formula for a pipelined processor is: Time = (k + n - 1) × T_cycle Where k = number of stages, n = number of instructions, T_cycle = clock cycle time. Time = (4 + 200 - 1) × 2.5 ns Time = 203 × 2.5 ns = 507.5 ns

3. Time Saved: Time Saved = Time_non-pipelined - Time_pipelined Time Saved = 1600 ns - 507.5 ns = 1092.5 ns

Answer: The time saved is 1092.5 ns.

Worked example 2

A cloud server has 128 GB of RAM, 16 CPU cores, and 4 TB of disk space. A client wishes to provision two types of VMs:

  • Type A (Web Server): 2 vCPUs, 8 GB RAM, 50 GB disk
  • Type B (Database): 4 vCPUs, 32 GB RAM, 200 GB disk

What is the maximum number of Type A VMs that can be run if four Type B VMs are already running? Assume resources cannot be over-provisioned.

Show solution outline

First, calculate the resources consumed by the existing Type B VMs.

1. Resources used by 4 × Type B VMs:

  • CPU Cores: 4 VMs × 4 vCPUs/VM = 16 cores
  • RAM: 4 VMs × 32 GB/VM = 128 GB
  • Disk: 4 VMs × 200 GB/VM = 800 GB

2. Calculate remaining resources on the host server:

  • Remaining CPU Cores: 16 (host) - 16 (used) = 0 cores
  • Remaining RAM: 128 GB (host) - 128 GB (used) = 0 GB
  • Remaining Disk: 4 TB (4000 GB) - 800 GB = 3200 GB

3. Determine how many Type A VMs can be provisioned: We need to check the constraints for each resource for one Type A VM (2 vCPUs, 8 GB RAM, 50 GB disk).

  • Based on CPU: There are 0 cores left, so we cannot add any VMs that require CPU cores.
  • Based on RAM: There is 0 GB RAM left, so we cannot add any VMs that require RAM.

Answer: Since both CPU and RAM resources are fully consumed by the four Type B VMs, the maximum number of additional Type A VMs that can be run is 0.