当前位置:网站首页>Functions and basic structure of CPU

Functions and basic structure of CPU

2022-06-23 06:35:00 Picchu moving forward

The article is written by observing the principle of Kingway computer composition

a central processor CPU

1.CPU Basic function

  • CPU: a central processor
  • CPU It consists of an arithmetic unit and a controller
  • When you use a computer to solve a problem, write a program for it
  • Program is a Command sequence , It tells the computer what to do , Where to find the data to operate on
  • Once the program is loaded into memory , The computer can automatically complete the task of fetching and executing instructions

 Insert picture description here
CPU Other features :

Handling interrupts :
① Control the input and output of the program , That means controlling the host and IO Exchange information of equipment , For example, our program is running , To give an input from can let the program continue to run , otherwise , The program will get stuck , This applies to handling interrupts
② Bus management , Request handling of exceptions and special cases during operation
 Insert picture description here
 Insert picture description here

2. Workflow

Let's first review the composition of the controller , The following knowledge needs to be used
 Insert picture description here
The first step is to take the finger
According to the program counter PC Specified main memory address , From main memory ( Or cache ) Read instruction , Place in instruction register IR
 Insert picture description here

reflection : After the program starts executing , It will execute the program according to the relationship of instructions , So who gave the first instruction ?
For example, we installed on the computer QQ, When we want to run , Double click on it , Because we installed QQ When , It is installed on the hard disk , When you double-click , The operating system will transfer the program from the hard disk to the memory , The place to be transferred to memory is not fixed , Because memory is dynamically managed , That is to say, the location where the first instruction at the beginning of a program is stored is controlled by the operating system

We know that after taking out the instruction , You must want to do the corresponding operation , But we must know what to do first , That is, the meaning of the instruction code , To operate , So the next step is decoding .
The second step is decoding
according to IR The instructions in , Combined with the instruction system specification , Decomposing the opcode of an instruction 、 Address code, etc
opcode —— Indicate what to do
Address code —— Indicates how to get operands 、 How to save the result and how to form the subsequent instruction address
Step 3
Step 4 write back
Save the calculation results to main memory ( Or cache )
Step 5 interrupt
Respond to external requests
The next step is the cycle of these steps
This is the picture below CPU workflow
 Insert picture description here

3.CPU Basic composition of

 Insert picture description here

1. Arithmetic unit

 Insert picture description here

2. Register group

 Insert picture description here

3. Control unit

seeing the name of a thing one thinks of its function , The arithmetic unit is used to do arithmetic , Then the control part must be used to control

The control unit is mainly used to decode instructions , And send out control signals for various operations required to complete the command function , For example, tell each component , Which components need to be operated , What specific operations should be carried out

We know that everyone has a different point of view , Therefore, different people have different feelings about the same thing , alike , The working process of the computer is different from different angles .

  • From the user's point of view : The working process of a computer is the continuous execution of a sequence of instructions
  • From the internal implementation mechanism : The working process of a computer is the transmission of information under control commands , It is the process of integrating control flow and information flow

For control components , The most important is the control command ( Micro command ) Generating parts
 Insert picture description here
It is obvious who will execute first , There must be a sequence , In stages , There should be a time signal , Here, it is controlled by the timing system

4. Sequential systems

Sync : There is a definite time limit for doing something , When will it start , When will it end
 Insert picture description here

5.CPU Internal data path structure

 Insert picture description here

  • CPU Internal single bus mode : Connect the input and output of all registers to a common path , Only one component can transmit data at a time
  • If connected directly with wires , It is equivalent to multiple registers simultaneously and all the way to ALU To transmit data ----> The accumulated signal is obtained at each input , It can't tell who is sending it data now
     Insert picture description here
  • There are four general purpose registers ,R0 To R3, Used to store operands ( Source operands , Destination operands , In the middle ) And various address information .
  • If you perform an addition operation , Select two operands to add ( In two registers ), The resulting structure is returned to one of the registers (R2), that R2 The original content will be replaced
  •  Insert picture description here

 Insert picture description here
 Insert picture description here
 Insert picture description here

 Insert picture description here

4. Instruction cycle and its data flow

 Insert picture description here
 Insert picture description here
We know that instructions have different cycles , We can use triggers to determine which cycle the instruction is in
 How to determine which cycle
The address of the instruction is placed in PC in ,CPU Communication with the memory depends on MAR and MDR
 Insert picture description here
 Insert picture description here
 Insert picture description here

 Insert picture description here

5. Data access

5.1CPU Internal single bus mode

  • Data access : The transfer path of data between functional units
  • The basic structure of data path :
    • ①CPU Internal single bus mode
    • ②CPU Internal multi bus mode
    • ③ Dedicated data path mode

Single bus mode : Each component is connected to the bus , But the parts are not connected
The connection mode between each component and the bus is controlled by a control signal that can control the on-off of the signal
 Insert picture description here
 Insert picture description here
practice
 Insert picture description here
 Insert picture description here

5.2 Dedicated data path

 Insert picture description here
 Insert picture description here

 Insert picture description here
 Insert picture description here

 Insert picture description here
 Insert picture description here
 Insert picture description here
 Insert picture description here

6. Function and working principle of the controller

 Insert picture description here

6.1 Structure and function of the controller

 Insert picture description here
The controller is the command center of the computer system , The main functions of the controller are as follows :

  • Take an instruction from main memory , And indicate the position of the next instruction in main memory
  • Decode or test instructions , Generate the corresponding operation control signal , In order to start the specified operation
  • Command and control CPU, Main memory , The direction of data flow between input and output devices
     Insert picture description here
    CU The design of the :
  • Hardwired ( Combinational logic circuit + trigger )
  • Microprograms

6.2 Hardwired controllers

 Insert picture description here
 Insert picture description here
Design steps

  • ① Analyze the micromanipulation sequence of each stage
  • ② choice CPU Control mode of
  • ③ Schedule micro operations
  • ④ Circuit design

6.2.1 CPU The control mode

 Insert picture description here
 Insert picture description here

6.2.2 The principle of scheduling micro operations

 Insert picture description here
Unrelated operations can be scheduled to be completed at the same time
 Insert picture description here

 Insert picture description here
 Insert picture description here

6.2.3 Combinatorial logic design

Design steps

  • List the operation schedule
  • Write the simplest expression of micro operation command
  • Draw a logic diagram
原网站

版权声明
本文为[Picchu moving forward]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/174/202206230439226295.html