Program Memory and Data Memory in Microprocessor and Microcontroller




There are many different kinds of memory used in embedded systems and new kinds are being developed all the time. However, we can split memory into two types; RAM and ROM

RAM stands for random access memory. The are two features of RAM which distinguish it from ROM:
RAM is read/write - data can be written to and read from RAM.
RAM is volatile - data is lost once the power to a RAM chip is lost.
Random access refers to the fact that data from any location in the memory chip is accessible at any time . However, RAM is actually a poor choice of name for this type of memory (its name is rooted in history) because it does not refer to its main features and it may lead you to believe other types of memory are not random access. A memory chip is of little use if it's not random access.

ROM stands for read only memory. As with RAM, it is random access but it differs from RAM in two ways:
ROM, as the name suggests, is read only. You cannot write to a ROM chip. A ROM chip must be programmed once and  it cannot be (easily) changed.
ROM is non-volatile - when power is removed from the chip data is not lo

Difference Between Microprocessor and Microcontroller


A microprocessor system consists of a processor with memory, input ports and output ports connected to it externally. A microcontroller is a single chip containing a processor, memory, input ports and output ports. Since all four blocks reside on the one chip, a microcontroller is much faster than a microprocessor system.

Basic units of Microprocessor



Three Basic Elements of a Microprocessor

A microprocessor has three basic elements, as shown above. The ALU( Arithmetic and Logic Units) performs all arithmetic computations, such as addition, subtraction and logic operations (AND, OR, etc). It is controlled by the Control Unit and receives its data from the Register Array.
The Register Array is a set of registers used for storing data. These registers can be accessed by the ALU very quickly. Some registers have specific functions - we will deal with these later.
The Control Unit controls the entire process. It provides the timing and control signals for getting data into and out of the registers and the ALU and it synchronizes the execution of instructions