This is how they work...
The software instrutions that enter through the CPU originate from some form of memory storage device for example; a flpooy disk, a hard disk or a CD-ROM. Then these instructions pass into the computers main RAM (random access memory) , this is where each instruction is given a specific address or a memory location. The CPU can access specific things of data in RAM by spcifying the address of the data it wants.
As the program is executed, the data flow from the RAM through an interface of wires called a bus, this then links the CPU to the RAM. All the data is then decoded by an instruction decoder that explains and carries out software instructions.
Then from there the data passes to the arithmatic and logical unitwich then carries out calcuations and comparisons. The data may be stored by the ALU in temporary memory locations where it could be collected as quickly as possible. The ALU carries out specific operations such as; addition, multiplication, and other conditional tests, sending the resulting data back to the RAM.
During this process, a unit called the program counter keeps track of every successful instruction to make sure that the instuctions are followed by the CPU instructions in the correct order.