How does a Program counter works?

in progress 0
HINDUJA 3 years 2018-12-05T15:49:17+00:00 1 Answer 182 views Beginner 0

Answer ( 1 )


    PC contains 0x00000000 (say this is start address of program in memory)
    Encoded instruction is fetched from the memory and placed into PC.
    The instruction is decoded and executed.
    Now it is time to move onto the next instruction so we go back to the PC to see what the address of the next instruction is. However, we have a problem because PC’s previous address was removed so we have no idea where the next instruction is.

    Therefore, we need another register to hold the actual instruction fetched from memory. Once we fetch that memory, we increase PC so that we know where to fetch the next instruction.

Leave an answer