Posted 13 February 2014 - 09:40 PM
Most CPU instructions require a register, a memory address, a constant, or a combination of them.
opcode address register
opcode register address
opcode register constant
and so on.
Older machines (and sometimes modern microprocessors) did not have any memory cache on the processor. If the opcode required a memory address then everything stops and waits for the memory's content to be moved to or from the processor.
So now moving on to the questions.
>>Why does cache on CPU require both data and address of program's instruction?
A cache is just a local copy so the wait doesn't take as long. You need the address (where the copy is supposed to be from) and the data (the stuff at that address).
Many modern processors include caches dedicated to the data and instructions separately because they have different access patterns. Instruction caches make sense to keep the contents of functions in place. Data caches make sense to keep source and target buffers in place. Different access patterns mean different algorithms are helpful.
>> Why does loading an instruction from a program sequential require RAM or main memory?
I'm going to have to guess at the meaning because either some words were left out or there is an English translation issue.
Instructions are generally run sequentially. The first instruction is run, then the second, then the third. There are a few instructions that cause it to jump to a different place; some are conditional jumps and others are unconditional jumps. You write conditional jumps in high level languages with if statements, loops, and anything that says "if a condition is true, do something different". An unconditional jump simply moves to a new location, like a function call or a function return; no questions asked, you just go there.
>> It seems every a load instruction takes place it consume main memory but I am not sure why.
I want to give an answer but do not understand the question.
Because of all the questions you keep asking, you might enjoy looking at some old 6502 programs. There are quite a few games for the Atari 2600, the most popular game console at the end of the 1970s, that could be fun to study. Google turns up hundreds of good emulators, and also a large number of good tutorial sites that can help build simple games fairly easily. You won't be writing million-copy blockbusters, but just learning simple things like how to cycle through the screen colors on an old 6502-chip system is both very easy and very instructive.
I've seen people pick up some of the old 6502-chip systems where the first week is trying to figure out what is going on, the second week is experimenting with crazy ideas, and the third week is pushing out minimalist clones of pong, ski and other ancient games. Considering programmers of that era often only had 40 to 60 working days to create blockbuster titles, with today's shared information and super-large storage there are hobby developers who put together some amazing games on that generation's hardware. I had a co-worker who was very into those, he had programmable Atari 2600 cartridges, programmable Vectrex cartridges, and a few others with rather amazing homebrew games on them.
First off, you've asked a lot of hardware questions and mostly they've been for personal learning, but if I find out it is for homework I'll hunt you down. :-)