To understand how a microprocessor works, it is helpful to look inside and learn about the logic used to create one. In the process you can also learn about assembly language — the native language of a microprocessor — and many of the things that engineers can do to boost the speed of a processor.
A microprocessor executes a collection of machine instructions that tell the processor what to do. Based on the instructions, a microprocessor does three basic things:
Using its ALU (Arithmetic/Logic Unit), a microprocessor can perform mathematical operations like addition, subtraction, multiplication and division. Modern microprocessors contain complete floating point processors that can perform extremely sophisticated operations on large floating point numbers.
A microprocessor can move data from onelocation to another.
A microprocessor can make decisions and jump to a new set of instructions based on those decisions.
There may be very sophisticated things that a microprocessor does, but those are its three basic activities. The following diagram shows an extremely simple microprocessor capable of doing those three things:
This is about as simple as a microprocessor gets. This microprocessor has:
An address bus (that may be 8, 16 or 32 bits wide) that sends an address to memory
A data bus (that may be 8, 16 or 32 bits wide) that can send data to memory or receive data from memory
An RD (read) and WR (write) line to tell the memory whether it wants to set or get the addressed location
A clock line that lets a clock pulse sequence the processor
A reset line that resets the program counter to zero (or whatever) and restarts execution