Why is register faster than memory?

Source: Internet
Author: User

Source: Chinese, English

The storage level (memory hierarchy) of the computer, the Register (register) is the fastest, the second, the slowest is the hard disk.
  
Also are transistor storage devices, why register faster than memory?

Reason one: distance is different

Distance is not the main factor, but it is best to understand, so put it on the front. Memory is far away from the CPU, so it takes longer to read.
In the case of 3GHz CPUs, the current can oscillate 3 billion times per second, which takes approximately 0.33 nanoseconds each time. Light in 1 nanosecond time, can advance 30 centimeters. That is, in a clock cycle of the CPU, the light can advance 10 centimeters. Therefore, if the memory is more than 5 centimeters away from the CPU, it is not possible to complete the reading of the data in a clock cycle, which does not take into account the limitations of the hardware and the current actually does not reach the speed of light. In contrast, registers are inside the CPU, which of course reads faster.
The distance to the desktop computer has a large impact on the phone is much smaller. The phone's CPU clock is slow (IPhone 5s is 1.3GHz), and the phone's memory is next to the CPU.

Reason two: different hardware design

Apple's new iphone 5s,cpu is A7, with more than 6,000 registers (31 64-bit registers plus 32 128-bit registers). The memory of the iphone 5s is 1GB, about 8 billion bits (bit). This means that high-performance, high-cost, high-power designs can be used on registers, which are more than 6,000, and cannot be used in memory. Because the cost and energy consumption of each bit is increased by just a little bit, it will be magnified 8 billion times times.
In fact, the design of the memory is relatively simple, each bit is a capacitor and a transistor, and the register design is completely different, more than several electronic components. And after the power, register the transistor has been a power, and the memory of the transistor only used to have electricity, useless to the power, this is beneficial to power saving. These design factors determine that the register is faster than the memory read speed.

Reason three: different ways of working

Registers work in a very simple way, with only two steps: (1) Find the relevant bits, (2) read the bits.
The way memory works is much more complicated:
(1) A pointer to the data is found. (The pointer may be stored in the register, so this step includes the full work of the Register.) )
(2) Send the pointer to the Memory management Unit (MMU), which translates the virtual memory address into the actual physical address by the MMU.
(3) Send the physical address to the memory controller and the memory controller to find out which memory slot (bank) the address is on.
(4) Determine which memory block (chunk) the data is on, and read the data from that block.
(5) The data is sent back to the memory controller, then sent back to the CPU, and then started to use.
The workflow of memory is a lot more than the register. Each step creates a delay, which accumulates to make the memory much slower than the register.
To mitigate the huge speed differences between registers and memory, hardware designers have made a lot of effort, including setting up caches inside the CPU, optimizing how the CPU works, and trying to read all the data from the memory commands at once, and so on.

Copyright NOTICE: This article is for bloggers original article, Welcome to Inquire Email: [Email protected]

Why is register faster than memory?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.