Homebrew: 8-bit Computer Program Counter

From Tampa Hackerspace
Jump to navigation Jump to search

Program Counter

A program is a series of instructions, these instructions, in the case of a computer are mostly stored in sequential format, in the computers memory. Each unit of memory has an address to distinguish it from the other memory. Memory addresses are numbers, so there is a memory unit with the address 0 and 1 and 2 and so on. So if we want the retrieve program instructions from memory we can start with a given address retrieve the instruction at that memory address and just count up by one to retrieve the next instruction. The program counter is what allows us to do this. It stores a number and when commanded to will increment that number up, by one. In addition to this we can also write a number into the program counter, allowing for moving around the program memory in a non sequential way.