How many instructions does the CPU execute?

2

New! Save questions or answers and organize your favorite content.
Learn more.

  • A processor has 4 cores
  • Each core has 2 - Hyper threads
  • Its clock frequency is 2 GHz
  • On average, an instruction needs 4 cpu cycles to execute on each hyperthread

How many instructions can it execute in one second? I need help as to which equations to use. I know that 1 GHz has 1 cpu cycle at 1 nano second so therefore the 2 GHz will do one cpu cycle in .5 nano seconds.

asked Mar 6, 2014 at 9:18

1

Well, I'll get you started, but it's a basic math problem.

2Ghz - frequency, in [cycles/second]. 4 - instruction duration, in [cycles/ops].

So 2Ghz [cycles/second] / 4 [cycles/ops] = 0.5Ghz [ops/second]. Note that the cycles unit cancels out and this "feels right" because we're left with the units that are being asked for :)

Do similar math to account for the Hyper-threads and Cores - only it will be multiplication. (You can carry through the units, e.g. [ops*threads*cores/second], but they can be dropped in context of the answer which is asking for ops/second across all v-cores.)

answered Mar 6, 2014 at 9:25

user2864740user2864740

58.2k14 gold badges135 silver badges209 bronze badges

3

This question is a bit incomplete. Just because, on average an instruction takes 4 cycles doesn't mean that a processor cannot work on more than one thing at a time. Instruction level parallelism (ILP) is had by employing concepts like super-scalar execution, pipelining and out-of-order execution mean that we have processors are capable of completing 4 instructions (or more) on every cycle. So the numbers you need are the processor frequency, the number of cores, and the number of instructions per second (IPC) that each core can sustain. Things like hyperthreading, caching, prefetching, etc. are just features that help the processor reach the IPC that it was designed for. Check out computer architecture books like Hennesy & Patterson's Computer Architecture: A Quantitative Approach. Generally ILP is covered in one of the first couple of chapters.

answered Mar 8, 2014 at 6:15

Nathan BinkertNathan Binkert

8,5981 gold badge28 silver badges37 bronze badges

1

View Discussion

Improve Article

Save Article

  • Read
  • Discuss
  • View Discussion

    Improve Article

    Save Article

    You may be speculative however the central processor is programmed. It contains a special register — the instruction register — whose bit pattern determines what the central processor unit can do. Once that action has been completed, the bit pattern within the instruction register may be modified, and also the central processor unit can perform the operation nominative by this next bit pattern.

    Since directions are simply bit patterns, they will be kept in memory. The instruction pointer register continuously has the memory address of (points to) the next instruction to be executed. so as for the management unit to execute this instruction, it’s derived into the instruction register. the case is as follows:

    1. A sequence of instructions is stored in memory.
    2. The memory address wherever the first instruction is found is copied to the instruction pointer.
    3. The CPU sends the address within the instruction pointer to memory on the address bus.
    4. The CPU sends a “read” signal to the control bus.
    5. Memory responds by sending a copy of the state of the bits at that memory location on the
      data bus, that the CPU then copies into its instruction register.
    6. The instruction pointer is automatically incremented to contain the address of the next
      instruction in memory.
    7. The CPU executes the instruction within the instruction register.
    8. Go to step 3

    Steps 3, 4, and 5 are called an instruction fetch. Notice that steps 3 – 8 constitute a cycle, the instruction execution cycle. It is shown graphically below.

    How many instructions does the CPU execute?

    Does a CPU execute instructions?

    The CPU executes a program that is stored as a sequence of machine language instructions in main memory. It does this by repeatedly reading, or fetching, an instruction from memory and then carrying out, or executing, that instruction.

    What types of instructions can CPU execute?

    The CPU performs basic arithmetic, logic, controlling, and input/output (I/O) operations specified by the instructions in the program.

    How many instructions can a CPU execute per second?

    The two main elements of the control unit are the clock and the decoder. speed of around 3GHz which means the CPU can carry out three thousand million instructions per second!

    How many instructions do modern CPUs have?

    Keep in mind that this architecture is complex and that there are up to 12 types of instructions.