Home Common Problem Where the program must be stored before it can be accessed and executed by the CPU

Where the program must be stored before it can be accessed and executed by the CPU

Aug 29, 2020 am 10:54 AM
cpu program

The program must be stored in the memory before it can be accessed and executed by the CPU, and the contents of the instruction register need to be transferred to the address bus first. When the PC runs the program, it transfers the program from the external memory to the RAM. When the CPU is running, the program is directly read from the flash.

Where the program must be stored before it can be accessed and executed by the CPU

When the CPU executes a program, the instruction must exist in the memory, and the contents of the instruction register need to be transferred to the address bus first.

The specific way for x86cpu and microcontroller to read the program. When running the program, the pc transfers the program from the external memory (hard disk) to RAM and runs it from Programs and data are read from the RAM, while the program of the microcontroller is solidified in the flash. When the CPU is running, the program is read directly from the flash, and the data is read from the RAM. The specific reasons for this difference are analyzed. The x86 architecture CPU is based on Feng Neumann system, that is, data and programs are stored together, and the RAM resources of PCs are quite abundant, ranging from tens of M to hundreds of M or even several G, which can objectively withstand a large amount of program data.

The architecture of single-chip microcomputers is mostly Haval system, that is, programs and data are stored separately, and the on-chip RAM resources of a single chip are quite limited. Excessive internal RAM will bring costs. substantial improvement. From the above analysis, it can be known that the program of the microcontroller can be stored in flash based on two considerations, namely the architecture and the amount of RAM resources.

Therefore, today, as technology not only advances but on-chip RAM capacity continues to increase, RAM resources are no longer the main factor restricting this difference. For the system structure, we only need to change the way the CPU reads the program. .

The specific method of storing embedded system programs in RAM "For many embedded systems, many of their codes are stored in norflash and run directly in flash. I recently learned that my new A piece of code in the company's software was loaded into RAM in order to improve the running speed. They spent a lot of time solving this problem at that time. I carefully studied the link script and used the GNU Linux cross tool chain. .Address allocation is written in an ld script.

They are implemented as follows: 1. Write the code you need to run in ram in a separate c file, and then set it in the script The running address is separated from the storage address. Set the necessary flag variables for the start and end of the code. 2. Copy the code at the storage address to the running address in the code. The difference between the Von Neumann system and the Harvard system The difference is whether the program space and the data space are integrated.

Most early microprocessors adopted the von Neumann structure, with the typical representative being Intel's X86 microprocessor. Take Instructions and operand fetching are both on the same bus and are performed through time-division multiplexing. The disadvantage is that when running at high speed, instructions and operands cannot be fetched at the same time, thus forming a bottleneck in the transmission process.

The application of Harvard bus technology is represented by DSP and ARM. The internal program space and data space of the chip using the Harvard bus architecture are separated, which allows instructions and operands to be fetched at the same time, thereby greatly improving the computing power. For example, the STM320LF240x series DSP is an enhanced Harvard structure that accesses multiple storage spaces through three sets of parallel buses.

If you want to learn more about programming, please pay attention to the php training column !

The above is the detailed content of Where the program must be stored before it can be accessed and executed by the CPU. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to make Google Maps the default map in iPhone How to make Google Maps the default map in iPhone Apr 17, 2024 pm 07:34 PM

The default map on the iPhone is Maps, Apple's proprietary geolocation provider. Although the map is getting better, it doesn't work well outside the United States. It has nothing to offer compared to Google Maps. In this article, we discuss the feasible steps to use Google Maps to become the default map on your iPhone. How to Make Google Maps the Default Map in iPhone Setting Google Maps as the default map app on your phone is easier than you think. Follow the steps below – Prerequisite steps – You must have Gmail installed on your phone. Step 1 – Open the AppStore. Step 2 – Search for “Gmail”. Step 3 – Click next to Gmail app

What should the CPU utilization be when gaming? What should the CPU utilization be when gaming? Feb 19, 2024 am 11:21 AM

It's common for games to slow down your computer because they consume a lot of resources. It's crucial to understand your CPU usage when gaming so you can avoid overloading it. Therefore, keeping track of appropriate CPU usage is key to keeping your gaming experience smooth. In this article, we'll look at the appropriate CPU usage you should achieve while your game is running. CPU utilization during gaming CPU utilization is an important indicator of processor workload and depends on the performance specifications of the CPU. More powerful CPUs generally have higher usage. A CPU with more cores and threads can improve the overall performance of your system. Multi-threading support helps unleash the full potential of your CPU. In games, CPU usage depends on processor utilization, which can affect the game

How to set CPU performance to full in Win11 How to set CPU performance to full in Win11 Feb 19, 2024 pm 07:42 PM

Many users find that the computer is not running smoothly enough when using the Win11 system. They want to improve CPU performance, but they don't know how to do it. The following will introduce in detail how to set the CPU performance to the highest level in Win11 system to make your computer more efficient. Setting method: 1. Right-click "This PC" on the desktop and select "Properties" in the option list. 2. After entering the new interface, click "Advanced System Settings" in "Related Links". 3. In the window that opens, click the "Advanced" tab at the top, then click the & at the bottom of "Performance"

How to undervolt and overclock your CPU using Intel XTU How to undervolt and overclock your CPU using Intel XTU Feb 19, 2024 am 11:06 AM

Intel XTU is a powerful application that allows you to easily manage your computer's performance. You can fix overheating issues by adjusting the CPU voltage, or boost performance by overclocking. In this article, we'll look at how you can take advantage of Intel XTU to optimize your computer's performance, whether that's adjusting voltage or overclocking. What effect do undervolting and overclocking have on the CPU? Before we move on to learning how to undervolt and overclock a CPU, we first have to understand what they are. Undervolting refers to gradually reducing the voltage required by the CPU. This process helps reduce heat emissions, as high voltage results in higher temperatures. By reducing the voltage supply to the CPU, the temperature can be effectively reduced. If your laptop starts to slow down after getting hot, you should solve the problem promptly.

How to increase the clock frequency of your computer's CPU How to increase the clock frequency of your computer's CPU Feb 20, 2024 am 09:54 AM

How to Overclock Computer CPUs With the continuous advancement of technology, people's demand for computer performance is also getting higher and higher. An effective way to improve computer performance is to increase the CPU's operating frequency through overclocking. Overclocking allows the CPU to process data faster, providing higher computing power. So, how to overclock a computer CPU? The following will introduce you to the basic principles and specific operation methods of overclocking. First, let's understand how overclocking works. The operating frequency of the CPU is determined by the crystal oscillator on the motherboard

The operation process of WIN10 service host occupying too much CPU The operation process of WIN10 service host occupying too much CPU Mar 27, 2024 pm 02:41 PM

1. First, we right-click the blank space of the taskbar and select the [Task Manager] option, or right-click the start logo, and then select the [Task Manager] option. 2. In the opened Task Manager interface, we click the [Services] tab on the far right. 3. In the opened [Service] tab, click the [Open Service] option below. 4. In the [Services] window that opens, right-click the [InternetConnectionSharing(ICS)] service, and then select the [Properties] option. 5. In the properties window that opens, change [Open with] to [Disabled], click [Apply] and then click [OK]. 6. Click the start logo, then click the shutdown button, select [Restart], and complete the computer restart.

144-core, 3D-stacked SRAM: Fujitsu details next-generation data center processor MONAKA 144-core, 3D-stacked SRAM: Fujitsu details next-generation data center processor MONAKA Jul 29, 2024 am 11:40 AM

According to news from this website on July 28, foreign media TechRader reported that Fujitsu introduced in detail the FUJITSU-MONAKA (hereinafter referred to as MONAKA) processor planned to be shipped in 2027. MONAKACPU is based on the "cloud native 3D many-core" architecture and adopts the Arm instruction set. It is oriented to the data center, edge and telecommunications fields. It is suitable for AI computing and can realize mainframe-level RAS1. Fujitsu said that MONAKA will achieve a leap in energy efficiency and performance: thanks to technologies such as ultra-low voltage (ULV) technology, the CPU can achieve 2 times the energy efficiency of competing products in 2027, and cooling does not require water cooling; in addition, the application performance of the processor It can also reach twice as much as your opponent. In terms of instructions, MONAKA is equipped with vector

Leak reveals key specs of Intel Arrow Lake-U, -H, -HX and -S Leak reveals key specs of Intel Arrow Lake-U, -H, -HX and -S Jun 15, 2024 pm 09:49 PM

IntelArrowLakeisexpectedtobebasedonthesameprocessorarchitectureasLunarLake,meaningthatIntel'sbrandnewLionCoveperformancecoreswillbecombinedwiththeeconomicalSkymontefficiencycores.WhileLunarLakeisonlyavailableasava