Need Help Understanding a Problem About CPUs

• olen501
In summary, the original CPU has better performance because it can complete the same task in less time.
olen501

Homework Statement

This is the problem:

Consider a CPU that has a clock cycle of 20 nanoseconds (ns). It is possible to remove some instructions from its assembly language instruction set to form a second CPU and reduce its clock cycle to 18 ns. These instructions comprise 4 percent of all code in a typical assembly language program, and each of these removed instructions would have to be replaced by 3 instructions from the reduced set. Assume that every instruction requires the same number of clock cycles, c, to complete (i.e., to be fetched, decoded, and executed with results written back).
(a.)
Which CPU has the better performance?
(b.)
What percentage of typical code would the removed instructions have to comprise in order for the two CPUs to have the same performance?
(c.)
For what clock cycle for the original CPU would the two CPUs have the same performance?

Homework Equations

T = (N*S)/R

N = actual number of instructions
executed in program
S = average number of cycles for
instructions in program
R = clock rate
T = program execution time

The Attempt at a Solution

I actually don't need help solving the problem (not yet anyways).
My problem is that to me it seems this problem is worded kind of
poorly and I don't really understand what it's trying to say about
the new instructions comprising 4 percent of the code and the
removed instructions being replaced by 3 instructions from the
reduced set. Can someone explain this problem to me?

olen501 said:
I actually don't need help solving the problem (not yet anyways).
My problem is that to me it seems this problem is worded kind of
poorly and I don't really understand what it's trying to say about
the new instructions comprising 4 percent of the code and the
removed instructions being replaced by 3 instructions from the
reduced set. Can someone explain this problem to me?

Let's say that there are instructions A-Y and performing instructions BCD in order will do the same thing as instruction A will do by itself. Now, you have the choice between a chip that will do all of A-Y in 20 ns each, or one that will do B-Y (so you have to replace all the A's with BCD) in 18 ns each.

Thanks for the help, I've got it now

1. What is a CPU and what does it do?

A CPU (Central Processing Unit) is the main component of a computer that is responsible for carrying out instructions and performing calculations. It acts as the brain of the computer, handling tasks such as running programs, processing data, and managing system resources.

2. How does a CPU work?

A CPU works by receiving instructions from the computer's memory, decoding them, and then executing them. The instructions are in the form of binary code, which the CPU can understand and process. It also has multiple components such as the arithmetic logic unit (ALU) and control unit that work together to perform calculations and manage the flow of data.

3. What factors affect a CPU's performance?

There are several factors that can affect a CPU's performance, including clock speed, number of cores, cache size, and architecture. Clock speed refers to the number of instructions the CPU can process in a given time, while the number of cores indicates how many tasks it can handle simultaneously. Cache size is the amount of memory the CPU has for storing frequently used data, and architecture refers to the design and organization of the CPU's components.

4. What is the difference between a CPU and a GPU?

A CPU and a GPU (Graphics Processing Unit) are both processors, but they have different functions. A CPU is responsible for general computing tasks, while a GPU is specifically designed to handle graphics and image processing. GPUs have more cores and a higher clock speed than CPUs, making them better suited for tasks that require a lot of parallel processing.

5. How can I choose the right CPU for my needs?

Choosing the right CPU depends on your specific needs and budget. Factors to consider include the type of tasks you will be using it for, the amount of processing power you require, and compatibility with other components in your computer. Researching and comparing different CPU models can help you make an informed decision.

Similar threads

• Engineering and Comp Sci Homework Help
Replies
7
Views
3K
• Programming and Computer Science
Replies
25
Views
2K
• Engineering and Comp Sci Homework Help
Replies
5
Views
2K
• Engineering and Comp Sci Homework Help
Replies
23
Views
5K
• Programming and Computer Science
Replies
6
Views
1K
• Engineering and Comp Sci Homework Help
Replies
8
Views
2K
• Programming and Computer Science
Replies
3
Views
1K
• Programming and Computer Science
Replies
13
Views
5K
• Engineering and Comp Sci Homework Help
Replies
1
Views
1K
• General Engineering
Replies
1
Views
12K