the ram thats in megabytes you use is the main memory and its too slow for the cpu. cache is a very small amount of ram, of a different type thats very fast, almost as fast as the cpu that sits between the cpu and main memory, the PC100/133 SDRAM what you call and keeps some bytes that the cpu just read from the main memery at hand, anticipating that the cpu will need them, and if it really does, it can deliver them to it instantly. the cpu will not have to go all the way to the slower main memory, so that speeds up the process. this is called a cache hit. amny a times it also happens that the byte cpu needs is not with the cache, so it has to go to the main memory and fetch it, while cache takes this chance and collects some more bytes from that area in the main memory for the cpu. this is a cache miss and the cpu then has to read the slow main memory. next time the cpu needs a byte from that area the cache has it now.
well, how many bytes does the cache read ahead for the cpu? the cache, depending on its organisation can read from 16 to 64 bytes in advance for the cpu. the cache is only about 64k (remember the 386/486 boards?) to 512k or even 2M on some p-IIIs. compared to the megabytes of main memory teh systems have this is really a tiny amount, so why bother about it?
cache memory is of static type, its a digital circuit and so its larger in size and a bit difficult to make, so its costly. whereas the main memory is of dynamic type, made of capacitors that holds the bits hence it is easier to fabricate as well as its very small in size. but it is much slower than the static ram and has to be refreshed periodically since the capacitor maybe discharged and it will forget about the bit it was storing.
you could well make your system with 256M of static main memory, but you could make its cost ten times!
well, L1 cache is the first level, first place the cpu looks for data, it always runs at full cpu speed and is only about 8k to 128k. if it misses then it could look for it in the main memory, but there is one more box of cache to look in, the second level or L2 cache and if this misses too, it will have to go to the main memory. some older boards (when the L2 started coming with the chip itself) had their own L2, so it had to be content being the L3 cache which actually degraded the performance since a lot of cycles were wasted to fill all the three caches! at best it had to be disabled. so too much cache does not help either. improvement in performance from 256k and 512k cache may not be the same as the amount of improvement from 64k to 512k. it of course depends on the application you are using.
hope you get it
girish