Short answer: it doesn’t.
Longer answer: A CPU issues an instruction to a storage device (which likely has its microprocessor to convert that instruction to a series of lower-level commands) telling it to copy a block of data into a certain location in memory. There are a few ways it could issue this instruction, but one is that a certain memory address is reserved as the storage device’s command input, and the CPU writes specific data to it that tell it what the instruction is.
How does it know that it needs to do this? The CPU receives it’s own instructions, which were ultimately written by a programmer. Each instruction is just a long number. The first thing it does for each instruction is to decode it, which means figure out what it is supposed to do. It might use a system like “if the first digit is a 0, do arithmetic; if the first digit is 1, write to memory; if the first digit is 2, read from memory; …”. Then the other digits provide more information, like what specific arithmetic operator to use and what numbers to use it on.
Latest Answers