1
  1. Is it correct that:

    • a microinstruction is what can be executed directly on hardware?

    • an instruction in ISA either can run on hardware (in this case, the instruction is a microinstruction?), or must be interpreted by a microprogram to be a sequence of microinstructions to run on hardware?

  2. From Tanenbaum's Structured Computer Organization, are "instructions", "register-memory instructions" and "register-register instructions" mentioned in the following quote microinstructions or instructions in ISA?

    Most instructions can be divided into one of two categories: register-memory or register-register.

    Register-memory instructions allow memory words to be fetched into registers, where, for example, they can be used as ALU inputs in subsequent instructions. (‘‘Words’’ are the units of data moved between memory and registers. A word might be an integer. We will discuss memory organization later in this chapter.) Other register-memory instructions allow registers to be stored back into memory.

    A typical register-register instruction fetches two operands from the registers, brings them to the ALU input registers, performs some operation on them (such as addition or Boolean AND), and stores the result back in one of the registers. The process of running two operands through the ALU and storing the result is called the data path cycle and is the heart of most CPUs. To a considerable extent, it defines what the machine can do. Modern computers have multiple ALUs operating in parallel and specialized for different functions. The faster the data path cycle is, the faster the machine runs.

  3. Is the "instruction" in a fetch-decode-execute cycle mentioned in the following quote a microinstruction or an instruction in ISA?

    If "instruction" means a microinstruction, what is a "cycle" for an instruction in ISA when it needs to be interpreted by a microprogram?

    When running a register-memory instruction (as in part 2) to fetch memory words into registers, does it call itself to fetch itself from memory into the instruction register in step 1?

    The CPU executes each instruction in a series of small steps. Roughly speaking, the steps are as follows:

    1. Fetch the next instruction from memory into the instruction register.
    2. Change the program counter to point to the following instruction.
    3. Determine the type of instruction just fetched.
    4. If the instruction uses a word in memory, determine where it is.
    5. Fetch the word, if needed, into a CPU register.
    6. Execute the instruction.
    7. Go to step 1 to begin executing the following instruction.

    This sequence of steps is frequently referred to as the fetch-decode-execute cycle.

  4. When talking about RISC or CISC, are they referring to microinstructions, or instructions in ISA? Thanks.

1
  1. I agree with your interpretation. And if an ISA instruction ties to a single microinstruction, I would still call the instruction an instruction and the microinstruction a microinstruction, even knowing that there's a 1:1 tie. There are all sorts of chip architectures, but I imagine that internally there are differences in naming and things are kept separate that way, e.g. a chip designer might say something like "the MOV instruction implementation consists solely of invocation of the _mov microinstruction". I'm making up my own naming convention here; the point is that there are still two different entities here, even if they happen to correspond 1:1.

  2. Those operations would be instructions; whether they are implemented as single microinstructions or as microprograms, they are still conceptually instructions.

  3. Those operations would also be instructions; the CPU will never have to "fetch" a microinstruction. It already has the correct microinstructions necessary for any given instruction it fetches burned into its circuit design.

  4. In a pure RISC architecture, there is no instruction / microinstruction distinction. Each instruction is basically a single microinstruction, although the term "microinstruction" would not typically by used (since it's not necessary to draw such a distinction). When talking about a CISC device, I'd imagine that people would talk mostly about instructions; if they're referring to the internal microinstructions (which are less likely to be a topic of everyday discussion, in my experience), then people will explicitly say "microinstruction".

  • Thanks. In 2, (1) From the quote, what a register-register instruction does is just: moving operands from registers to ALU input registers, ALU performing an operation, and storing results from ALU output register to a register. It is called a data path. It seems very basic, and might it be a microinstruction? (2) From the quote, a register-memory instruction also seems to move a word between a register and memory. It sounds very basic, and might it be always microinstruction? – Tim Feb 20 '15 at 18:25
  • A register-memory operation would likely be implemented as a single microinstruction. I guess it could be more granular than that, e.g. there could be a microinstruction to move the data from a register to some staging area, and another to get it from there to memory, but that seems overwrought. Something like a register increment instruction, though, could break down into multiple microinstructions, e.g. "move the contents of register A0 to the ALU input register (a microinstruction), run the ALU increment logic (another one), and move the ALU output to A0 (a third microinstruction)." – user1172763 Feb 20 '15 at 18:31
  • in 3, Is each of the 7 steps in a fetch-decode-execute cycle of an instruction done by a single microinstruction? If yes, doesn't an instruction always correspond to more than one microinstructions? If no, what each step is done by? (After step 6, why isn't a step for writing the result from register to memory opposite to step 1?) – Tim Feb 20 '15 at 18:54
  • If a ISA instruction is to move some data in the memory to another place in the memory or to some IO device, is the "word" fetched into cpu register in step 4 and 5 be fetched the addresses of the source and destination, or the data themself – Tim Feb 20 '15 at 20:21
  • Tim, in #3, I wouldn't refer to the parts of the fetch / execute cycle as microinstructions. They're something else... really, I'd just refer to them as the fetch / execute logic. They are their own thing, though I can see why you'd think they resemble microinstructions. Even a RISC chip will have a fetch / execute cycle. And as for why "a step for writing the result" isn't included after #6, the reason is that this is part of item #6. If an instruction calls for a result to get written somewhere, then doing so is part of #6, "execute the instruction". – user1172763 Feb 20 '15 at 21:38
1

1) An Instruction Set Architecture defines the interface that is used to program a processor. Note that this does not define the implementation. When a CPU designer goes about designing the processor, they may implement this ISA in various different ways. In fact, the various Intel processors have each implemented the x86 ISA in many different ways over the years.

Computer architecture is generally delineated around an ISA. Computer microarchitecture is very specific to a particular processor. For example, a Pentium vs. a Pentium Pro implement for the most part the exact same instruction set, i.e. the x86 ISA. But their microarchitectures were drastically different. (The Pro was out of order for example).

One of the methods often used to get pipelines to be very fast is to reduce the more complex instructions to microinstructions. These are used by the "back-end" of the processor, which is the part that has one or more execution units.

Therefore, the point of the two types of instructions ISA instruction vs. microinstruction has to do with whether you are discussing the ISA, i.e. the interface, or the microarchitecture, i.e. the implementation.

2) As far as your second question, Tanenbaum was almost certainly talking about ISA level instructions because his books are about computer architecture. Microarchitecture is much more hardware designer centric. See John Stokes, "Inside the Machine" if you are interested in microarchitecture.

3) For most real processors, fetch-decode-execute is entirely too simplistic to describe what really goes on inside. However, from an ISA point of view, it defines a good abstraction to the steps an instruction takes.

The instruction fetch is done by dedicated hardware, so it is different from the load instruction data fetch. Usually there are actually two bus masters, instruction and data. These buses often have their own caches. In some cases, i.e. harvard architectures, the data and instruction memory maps are entirely separate.

4) RISC vs. CISC is entirely regarding the ISA, i.e. the interface. However, the RISC mindset of using a reduced instruction set is very much to simplify the microarchitecture. The effect is that the microarchitectural instructions are generally exactly the same as the ISA instructions in RISC processors.

  • Thanks. (1) Is each of the 7 steps in a fetch-decode-execute cycle of an instruction done by a single microinstruction? If yes, doesn't an instruction always correspond to more than one microinstructions? If no, what each step is done by? (2) After step 6, why isn't a step for writing the result from register to memory opposite to step 1? – Tim Feb 20 '15 at 19:09
  • (1)The steps are being performed by the CPU hardware not by instructions. Each instruction will go through all 7 steps. So, instructions are software, the steps are done by hardware. (2) Because not all instructions write from register to memory. (For example, branch instructions, compare instructions, etc.) In this simplified model, the ones that do write to memory will do it during the execute phase. – caveman Feb 20 '15 at 21:29
  • (1) by "The steps are being performed by the CPU hardware not by instructions", do you mean the steps are microinstructions? Or microinstructions are also software? – Tim Feb 20 '15 at 21:52
  • You are missing a fundamental concept of what hardware does. Not all hardware is programmable. Some of it just does a fixed thing all the time without any software at all. "Programmable" hardware has some sort of configuration inputs to guide it. The steps themselves are implemented by the hardware. Instructions/microinstructions/software guide it. – caveman Feb 20 '15 at 22:09
  • Does a cpu execute a microinstruction also in the same fetch-decode-execute cycle? – Tim Feb 20 '15 at 23:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.