Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Which part of the computer is used to store the address of the next instruction to be executed?

2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article will explain in detail which part of the computer is used to store the address of the next instruction to be executed. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

The part used to store the address of the next instruction to be executed in the computer is the program counter; the program counter is used to store the address of the unit where the next instruction is located; the program counter is a register in the computer processor, it contains the address of the instruction currently being executed, and when each instruction is obtained, the storage address of the program counter is added.

The part in the computer that stores the address of the next instruction to be executed is the program counter.

A program counter is a place where the address of the unit where the next instruction is located is stored.

When executing an instruction, it is first necessary to fetch the instruction from memory to the instruction register according to the instruction address stored in the PC. This process is called "fetching instruction". At the same time, the address in the PC is either automatically added by 1 or the address of the next instruction is given by the transfer pointer. After that, the instruction is analyzed and executed. The execution of the first instruction is completed, and then the address of the second instruction is fetched according to the PC, and each instruction is executed in a loop.

A program counter is a register in a computer processor that contains the address (location) of the instruction currently being executed. When each instruction is obtained, the storage address of the program counter is incremented by one. After each instruction is obtained, the program counter points to the next instruction in the order. When the computer is restarted or reset, the program counter usually returns to zero.

One of the main contents of von Neumann's computer architecture is "program pre-storage, computer automatic execution"! The programs (instruction sequences) to be executed by the processor are pre-stored in the computer's memory in the form of binary code sequences. the processor takes these codes to the processor one by one and then decodes and executes them to complete the execution of the whole program. In order to ensure that the program can be executed continuously, CPU must have some means to determine the address of the next fetch instruction. Program counter (PC) plays this role, so it is often called "instruction counter".

Before the program starts to execute, the starting address of the program instruction sequence, that is, the address of the memory unit where the first instruction of the program is located, is sent to PC,CPU to read the first instruction (fetch instruction) from memory according to the instruction of PC. When executing an instruction, CPU automatically modifies the content of PC, that is, each instruction executed increases the amount of PC, which is equal to the number of bytes (instruction bytes) contained in the instruction, so that PC always points to the address of the next instruction to be fetched. Since most instructions are executed sequentially, the process of modifying PC is usually as simple as adding "instruction bytes" to PC.

When the program is transferred, the end result of the transfer instruction execution is to change the value of PC, which is the destination address to which the PC is transferred. The processor always fetches, decodes and executes the program according to the PC direction, thus realizing the program transfer.

R15 is used as the PC in the ARM processor, which always points to the fetch unit, and there is only one PC register in the ARM processor, which is shared by all modes. R15 has a 32-bit width (marked R15 [31:0] below, indicating 'bit 31' to 'bit 0' of R15), and the ARM processor can directly address the address space of 4GB (2 ^ 32 = 4G).

This is the end of the article on "which part of the computer is used to store the address of the next instruction to execute". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report