The cache is a small amount of high speed memory. When a program loop is executed, the CPU repeatedly refers to the set of instructions in memory that constitute the loop. If an active portion of the program and data are placed in a fast small memory, the average memory access time can be reduced, thus reducing the total execution time of the program. Such a fast small memory is referred to as a cache memory. It is placed between the CPU and main memory. In this view, we consider in this paper to optimize the cache memory access time which eventually optimizing the average access time.