
Shrirang K. answered 03/27/19
Tutor
5
(252)
PhD in Electrical Engineering with minor in Computer Science
Wow, there are so many confusing things in your question... (not a criticism, more of a suggestion so you look more closely at the terminology)
To answer your specific question:
- Memory just holds bits. It does not know or care if those bits represent data or instructions. This is one of the reasons why the computing model we use is so successful. Think about what a compiler does - it is generating instructions as output (view this as data) but when these are executed, they are interpreted as instructions
- Processors have multiple levels of cache. Typically, L2 and L3 are just cache, and L1 is split into data and instruction caches
- L2 and L3 can hold whatever is frequently (both temporally and spatially) accessed. The access patterns can be used to predict the next memory being accessed, but this works for both data and instructions