Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:multiasm:cs:chapter_3_4 [2025/12/02 10:11] ktokarzen:multiasm:cs:chapter_3_4 [2025/12/02 11:05] (current) – [Execution unit] ktokarz
Line 36: Line 36:
   - If the instruction requires the execution unit operation, the control unit generates signals to control it. In cooperation with the execution unit, it can also read data from or write data to the memory.   - If the instruction requires the execution unit operation, the control unit generates signals to control it. In cooperation with the execution unit, it can also read data from or write data to the memory.
  
-The control unit works according to the clock signal generator cycles known as main clock cycles. With every clock cycle, some internal operations are performed. One such operation is reading or writing the memory, which sometimes requires more than a single clock cycle. Single memory access is known as a machine cycle. As instruction execution sometimes requires more than one memory access and other actions, the execution of the whole instruction is named instruction cycle. Summarising, one instruction execution requires one instruction cycle and several machine cycles, each composed of a few main clock cycles. Modern advanced processors are designed in such a way that they are able to execute a single instruction (sometimes even more than one) every single clock cycle. This requires a more complex design of a control unit, many execution units and other advanced techniques, which makes it possible to process more than one instruction at a time.+The control unit works according to the clock signal generator cycles known as main clock cycles. With every clock cycle, some internal operations are performed. One such operation is reading or writing the memory, which sometimes requires more than a single clock cycle. Single memory access is known as a machine cycle. As instruction execution sometimes requires more than one memory access and other actions, the execution of the whole instruction is named an instruction cycle. Summarising, one instruction execution requires one instruction cycle and several machine cycles, each composed of a few main clock cycles. Modern advanced processors are designed in such a way that they are able to execute a single instruction (sometimes even more than one) every single clock cycle. This requires a more complex design of a control unit, many execution units and other advanced techniques, which makes it possible to process more than one instruction at a time.
  
 The control unit also accepts input signals from peripherals, enabling interrupts and direct memory access mechanisms. For proper return from the interrupt subroutine, the control unit uses a special register called the stack pointer. Interrupts and direct memory access mechanisms will be explained in detail in further chapters. The control unit also accepts input signals from peripherals, enabling interrupts and direct memory access mechanisms. For proper return from the interrupt subroutine, the control unit uses a special register called the stack pointer. Interrupts and direct memory access mechanisms will be explained in detail in further chapters.
Line 44: Line 44:
 ===== Execution unit ===== ===== Execution unit =====
  
-An execution unit, known also as the data processor executes instructions. Typically, it is composed of a few essential elements:+An execution unit, also known as the data processorexecutes instructions. Typically, it is composed of a few essential elements:
   * Arithmetic logic unit (ALU).   * Arithmetic logic unit (ALU).
   * Accumulator and set of registers,   * Accumulator and set of registers,
Line 50: Line 50:
   * Temporal register.   * Temporal register.
  
-The arithmetic logic unit (ALU) is the element that performs logical and arithmetical calculations. It uses data coming from registers, the accumulator or from memory. Data coming from memory data for arithmetic and logic instructions are stored in the temporal register. The result of calculations is stored back in the accumulator, other register or memory. In some legacy CISC processors, the only possible place for storing the result is the accumulator. +The arithmetic logic unit (ALU) is the element that performs logical and arithmetical calculations. It uses data coming from registers, the accumulator or from memory. Data coming from memory for arithmetic and logic instructions is stored in the temporal register. The result of calculations is stored back in the accumulator, another register or memory. In some legacy CISC processors, the only possible place for storing the result is the accumulator. 
-Besides the result, ALU also returns some additional information about the calculations. It modifies the bits in the flag register which comprises flags that indicate the results from arithmetic and logical operations. For example, if the result of the addition operation is too large to be stored in the resulting argument, the carry flag is set to inform about such a situation.+Besides the result, ALU also returns some additional information about the calculations. It modifies the bits in the flag registerwhich comprises flags that are modified according to the results from arithmetic and logical operations. For example, if the result of the addition operation is too large to be stored in the resulting argument, the carry flag is set to indicate such a situation.
  
-Typically flags register include:+Typically, the flags register includes:
   * Carry flag, set in case a carry or borrow occurs.   * Carry flag, set in case a carry or borrow occurs.
   * Sign flag, indicating whether the result is negative.   * Sign flag, indicating whether the result is negative.
Line 61: Line 61:
  
 The flags are used as conditions for decision-making instructions (like //if// statements in some high-level languages). The flags are used as conditions for decision-making instructions (like //if// statements in some high-level languages).
-Flags register can also implement some control flags to enable/disable processor functionalities. An example of such a flag can be the Interrupt Enable flag from the 8086 microprocessor.+The flags register can also implement some control flags to enable/disable processor functionalities. An example of such a flag can be the Interrupt Enable flag from the 8086 microprocessor.
  
-As we mentioned in the chapter about CISC and RISC processors in the first ones there are specialised registers including the accumulator. A typical CISC execution unit is shown in Fig {{ref>CISCexeunit}}.+===== Registers ===== 
 + 
 +Registers are memory elements which are placed logically and physically very close to the arithmetic logic unit. It makes them the fastest memory in the whole computer. They are sometimes called scratch registers, and the set of registers is called the register file.  
 + 
 +As we mentioned in the chapter about CISC and RISC processorsin CISC processors, registers are specialisedincluding the accumulator. A typical CISC execution unit is shown in Fig {{ref>CISCexeunit}}.
  
 <figure CISCexeunit> <figure CISCexeunit>
Line 70: Line 74:
 </figure> </figure>
  
-A typical RISC execution unit does not have a specialised accumulator register. It implements the set of registers as shown in Fig {{ref>RISCexeunit}}.+A typical RISC execution unit does not have a specialised accumulator register. It implements the set of scratch registers as shown in Fig {{ref>RISCexeunit}}.
  
 <figure RISCexeunit> <figure RISCexeunit>
en/multiasm/cs/chapter_3_4.1764670279.txt.gz · Last modified: 2025/12/02 10:11 by ktokarz
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0