2.1 Designing for Performance
COS2621 - Computer Organisation · 2. Performance Issues
Designing for Performance
Understanding Performance in Computer Design
Performance is a critical factor in computer design. It refers to how effectively a computer can execute tasks and process data. Several factors influence performance, including the processor speed, memory hierarchy, and system architecture.
Key Factors Affecting Performance
1. **Clock Speed**: The clock speed of a processor, measured in gigahertz (GHz), indicates how many cycles per second the CPU can execute. A higher clock speed generally means better performance.
2. **Instruction Set Architecture (ISA)**: The ISA defines the set of instructions that a processor can execute. A well-designed ISA can optimize the performance of applications by allowing more efficient execution of tasks.
3. **Pipelining**: This technique allows multiple instruction phases to be processed simultaneously. For example, while one instruction is being executed, another can be decoded, and a third can be fetched from memory. This overlapping of instruction processing can significantly improve performance.
Example of Pipelining
Consider a simplified pipeline with three stages: Fetch (F), Decode (D), and Execute (E). If we have three instructions (I1, I2, I3), the pipeline execution would look like this:
Time | Stage 1 | Stage 2 | Stage 3
-----|----------|----------|----------
1 | F | |
2 | D | F |
3 | E | D | F
4 | | E | D
5 | | | E
In this example, the pipeline allows all three instructions to be processed in five cycles instead of nine if executed sequentially.
Memory Hierarchy
The memory hierarchy is crucial for performance. It includes registers, cache, main memory, and secondary storage. Each level has different speeds and sizes. Faster memory (like cache) is smaller and more expensive, while slower memory (like hard drives) is larger and cheaper.
Example of Memory Hierarchy
Consider a computer with the following memory characteristics:
- Registers: 1 ns access time
- Cache: 5 ns access time
- Main Memory: 100 ns access time
- Hard Disk: 10,000 ns access time
Using cache effectively can reduce the average memory access time significantly. If 80% of accesses hit the cache, the average access time can be calculated as:
Average Access Time = (Hit Rate × Cache Time) + (Miss Rate × Main Memory Time)
Average Access Time = (0.8 × 5 ns) + (0.2 × 100 ns) = 4 ns + 20 ns = 24 ns
Conclusion
Designing for performance involves optimizing various aspects of computer architecture, including clock speed, instruction set, pipelining, and memory hierarchy. Understanding these concepts helps in creating efficient and effective computer systems.
Remember: Performance can be improved by optimally using pipelining and memory hierarchy.
Check your understanding
- What is the role of clock speed in computer performance?
- Explain how pipelining improves instruction execution.
- Describe the different levels of the memory hierarchy.
- How does cache memory affect average access time?
Test yourself
4 quick questions on this lesson. Pick an answer to see if you're right.
1. What is the primary benefit of pipelining in CPU design?
2. What does a higher clock speed in a CPU generally indicate?
3. Which of the following best describes the role of cache memory in a computer system?
4. Which of the following factors does NOT directly affect computer performance?