C + + Bottom system concept (ii) How to play----hardware

Source: Internet
Author: User

We do not speak the language first, from the hardware-level image of the explanation of how the CPU to complete various functions
    int A, B, C;     >> a >> b;     = a + b;

Here the C + + code is only three lines to see what the hardware does to implement such a function

CPU read-in instructions

Cin >> a >>b

  CPU: I just received a task from the organization to get us two integers and put them in memory corresponding to the two memory addresses provided by the organization .
keyboard: Okay, if someone knocks on me, I'll let you in.
CPU: Okay .
CPU: User knocked a 1 graphics card you go to the 1 of the image information in your video memory so that our screen brothers can read your memory to illuminate its corresponding LED bulb display to the user to see let the user know that he knocked a 1
Graphics: Yes
..... Until the user has typed in 1 2 press ENTER
CPU: Oh, mom, you can press ENTER, quick and fast. Memory transports the 1 and 2 from your input buffer memory to the memory of A and B to complete the a=1 b=2
Memory: Well, it's done .
CPU: I've been tasked with the organization, and he wants us to open up a memory space, C, and put A+b in.
Cpu:a+b, I've already worked it out. I just applied for a memory address, and the Memory brothers put A+b in the memory address.
Memory: OK


Summary: The memory bar is specifically responsible for the storage and reading of the data CPU to the address to be read to the memory Bar memory bar to find this memory to take the value inside out to the CPU
The display card display card also has a storage data place called the memory screen to read the memory can know that the light bulb needs to glow
Keyboard keyboard Whenever someone knocks on it, he tells someone (in fact, the memory has an area with keyboard keys, the keyboard is knocked to change the memory of the value of the CPU by reading this memory to know the keyboard key state)




C + + underlying system concept (ii) How to play hardware----

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.