Principles of computer composition-instruction format instruction addressing data addressing CISC RISC

Note sorting comes from Wangdao postgraduate entrance examination

Insert picture description here

Instruction format

  • Also known as machine instruction, it refers to the command for the computer to perform a certain operation, which is the smallest functional unit of the computer operation

  • The set of all instructions of a computer constitutes the instruction set

  • A computer can only execute the instructions of its own instruction system, but cannot execute the instructions of other systems

    Instruction format-address code

  • Fixed length instruction word structure: fixed instruction length

  • Variable length instruction word structure: instruction length is not equal

Insert picture description here


Instruction format-opcode

The opcode is the OP above

  • Fixed length opcode: n bits -> 2^n instructions
  • Variable length opcode -> extended opcode

Extended opcode

  • Short opcodes are not allowed to be prefixes of long codes
  • The opcode of each instruction must not be repeated

In the upper-level instruction format, we leave one or more operands in the instruction number of the opcode as the next-level instruction extension. For example, in the three-address instruction format, we leave all 1s (1111 ) To extend the next level two address instruction format, because the 4-bit opcode and 8-bit opcode may cause recognition problems when reading, so set aside 1111 as the next level extension, which means reading the first 4 bits At 1111, it means that the next read is the opcode, not the address code, which is the format of the second instruction.

  • Under normal circumstances, for instructions with higher frequency of use, shorter opcodes are allocated, and for instructions with lower frequency of use, longer opcodes are allocated to reduce instruction decoding and analysis time

Insert picture description here


example

Insert picture description here


Insert picture description here


Operation type of the instruction

  1. data transmission
  2. Arithmetic logic
  3. Shift operations (arithmetic, logic, loop)
  4. Transfer operation
  5. Input and output operations

Insert picture description here


Instruction addressing

Data storage

  • Byte storage, word storage
  • Machine word length, instruction word length, storage word length

Insert picture description here


Boundary aligned and unaligned storage

Boundary alignment: the starting address is an integer multiple of the word length (in bytes)

Addressing mode (two types)-given by the program counter PC

  • Sequential addressing
  • Skip addressing

Insert picture description here


Data addressing

Operand type

address digital character Logical number
Unsigned number Fixed-point, floating-point, decimal ASCII code logic operation

Addressing mode

Use different addressing methods to process the formal address to find the effective address

Insert picture description here


Address immediately

Insert picture description here

Direct addressing

Insert picture description here

Indirect addressing

Insert picture description here

Register addressing

Registers are some small storage areas used to store data inside the CPU, which are used to temporarily store the data involved in operations and the results of operations

Insert picture description here

Register indirect addressing

Insert picture description here

Implicit addressing

Insert picture description here


Addressing mode Effective address Memory fetches
Implicit addressing Program designation 0
Address immediately A is the operand 0
Direct addressing EA = A 1
Indirect addressing EA = (A) 2
Register addressing EA = Ri 0
Register Clip One Address EA = (Ri) 1

Offset addressing

  1. Base addressing

    Insert picture description here

  2. Indexed addressing

    Insert picture description here

  3. Relative addressing

    Insert picture description here


example

Insert picture description here

Addressing mode Effective address Fetch address
Relative addressing EA = (PC) + A 1
Base addressing EA = (BR) + A 1
Indexed addressing EA = (IX) + A 1

Stack addressing

Insert picture description here

Hardware that implements the stack

  • Hard stack
  • Use main memory to call soft stack

CISC and RISC

CISC RISK
Complex instruction set Reduced instruction set
One instruction completes a complex basic function One instruction completes a basic "action", and a combination of multiple instructions completes a complex basic function
X86 architecture, notebook, desktop ARM architecture, mobile phones, tablets

Insert picture description here


Guess you like

Origin blog.csdn.net/weixin_46250447/article/details/113109336