Microcontrooller and Microprocessor-Lecture 3
Microcontrooller and Microprocessor-Lecture 3
Lecture Three
applied. Generally, this type of memory has been more difficult to write to
electrically, for example in terms of time or power taken, or complexity of the
writing process. Non-volatile memory is used for holding the computer
program and for historical reasons has commonly been called ROM (Read-
Only Memory). A more descriptive name is ‘program memory’.
However, based on the above mentioned memories there are six different types of
memories as follows:
3.2.1 Random Access Memory
Random access memory (RAM) is a general-purpose memory which usually
stores the user data in a program. RAM memory is volatile in the sense that it
cannot retain data in the absence of power, i.e. data are lost after the removal of
power. Most microcontrollers have some amount of internal RAM. Several
kilobytes are a common amount, although some microcontrollers have much
more, and some less. RAM chips can be designed in two different forms which
we call static RAM (SRAM) and dynamic RAM (DRAM), as seen in Figure 3.2.
Static memory (SRAM) is faster than dynamic memory (DRAM). Also, SRAM
consumes less power than DRAM. SRAM is more expensive, since it takes more
space on silicon.
computer has just one address bus and one data bus, and the same address and
data buses serve both program and data memories. The input/output may also be
interconnected in this way and made to behave like memory as far as the CPU is
concerned. The Von Neumann structure is simple and logical, and gives a certain
type of flexibility. The addressable memory area can be divided up in any way
between program memory and data memory. However, it suffers from two
disadvantages. One is that it is a ‘one size fits all’ approach. It uses the same data
bus for all areas of memory, even if one area deals with large words and another
deals with small. It also has the problem of all things that are shared. If one person
is using it, another can’t. Therefore, if the CPU is accessing program memory,
then data memory must be idle and vice versa.
An alternative to the Von Neumann structure is seen in Figure 3.5. Every memory
area gets its own address bus and its own data bus. Because this structure was
invented in the university of the same name, this is called a Harvard structure. In
the Harvard approach we get greater flexibility in bus size, but pay for it with a
little more complexity. With program memory and data memory each having
their own address and data buses, each can be a different size, appropriate to their
needs, and data and program can be accessed simultaneously. On the minus side,
Mechanical Engineering Dept. Microprocessor and Microcontroller Dr. Alaa Abdulhady Jaber
the Harvard structure reinforces the distinction between program and data
memory, even when this distinction is not wanted. This disadvantage may be
experienced, for example, when data is stored in program memory as a table, but
is actually needed in the data domain.
to execute. Another approach is to keep the CPU very simple and have a limited
instruction set. This leads to the RISC approach – the Reduced Instruction Set
Computer. The instruction set, and hence overall design, is kept simple. This
leads to fast operation. One characteristic of the RISC approach is that each
instruction is contained within a single binary word. That word must hold all
information necessary, including the instruction code itself, as well as any address
or data information also needed. A further characteristic, an outcome of the
simplicity of the approach, is that every instruction normally takes the same
amount of time to execute.