Data flows from the memory/input device to main memory, then to cache, and finally to registers. The CPU's ALU performs operations using the registers, and the data flows back to the registers, cache, and finally to the main memory or an output device.