Microcontroller Architecture and Memories 1
Microcontroller Architecture and Memories 1
HAKAN TÜRKÖZ
2
Terms and Definitions
• As with all new technologies, computers bring with them abbreviation,
acronyms and terms that are new to us all; some of these are explained in
the, following paragraphs.
• Byte : The basic unit of information used in practical computer storage and
processing. A byte consists of eight (8) adjacent binary bits and this
string of bits is processed as one unit by a computer; they are the smallest
operable units of storage in computer technology. An individual byte can
represent the equivalent of a single character, such as the letter B, a
comma, or a percentage sign (%); or it can represent a number from 0 to
255. Because a byte contains so little information, the processing and
storage capacities of computer hardware are usually given in kilobytes
(1,024 bytes) or megabytes (1,048,576 bytes).
3
Terms and Definitions
• Hardware: Hardware is the collection of components such as display,
keyboard and other base units. These are the most basic units that are
gathered together and constructed without specialist knowledge or tools.
4
Classifications
• Classification of microcontrollers depends on the various technology used,
for example mechanical, electromechanical or electronic, the purpose for
which they were designed; by the type of data they can handle, i.e. digital or
analogue; by the amount they cost and even by their physical size.
• Components or tools of a microcontroller system are grouped into two
categories, Hardware or Software.
Hardware
• The individual components that make up the machine that constitutes a
computer system are called hardware.
• This hardware includes all the mechanical, electrical, electronic, and
magnetic devices within the computer itself, the Central Processing Unit
(CPU), and all related peripheral devices, (printers, magnetic tape units,
magnetic disk drive units, etc).
5
Computer Hardware
7
Central Processing Unit (CPU)
3. a means of providing input and output (I/O) (for example, a keypad for input
and a display for output).
8
Central Processing Unit (CPU)
9
Central Processing Unit (CPU)
• The basic components of the system (CPU, RAM, ROM and I/O) are linked
together using a multiple wire connecting system known as a bus (see
above Figure).
3. the control bus which provides timing and control signals throughout the
system.
10
Central Processing Unit (CPU)
• The number of individual lines present within the address bus and data bus
depends upon the particular microprocessor employed.
• Signals on all lines, no matter whether they are used for address, data or
• control, can exist in only two basic states: logic 0 (low) or logic 1 (high).
• Data and addresses are represented by binary numbers (a sequence of 1s
and 0s) that appear respectively on the data and address bus.
• Some basic microprocessors designed for control and instrumentation
applications have an 8-bit data bus and a 16-bit address bus.
• More sophisticated processors can operate with as many as 64 or 128 bits
at a time.
11
Central Processing Unit (CPU)
• The largest binary number that can appear on an 8-bit data bus
corresponds to the condition when all eight lines are at logic 1.
• Therefore, the largest value of data that can be present on the bus at any
instant of time is equivalent to the binary number 11111111 (or 255).
• Similarly, the highest address that can appear on a 16-bit address bus is
1111111111111111 (or 65,535).
• The full range of data values and addresses for a simple microprocessor of
this type is thus:
12
Central Processing Unit (CPU)
13
DATA REPRESENTATION
14
DATA REPRESENTATION
• A single byte of data can be stored at each address within the total memory
space of a computer system.
• Hence, one byte can be stored at each of the 65,536 memory locations
within a microprocessor system having a 16-bit address bus. Individual bits
within a byte are numbered from 0 (least significant bit, or LSB) to 7 (most
significant bit, MSB). In the case of 16-bit words (which are stored in
consecutive memory locations) the bits are numbered from 0 (LSB) to 15
(MSB).
• Negative numbers (or signed numbers) are usually represented using two’s
complement notation where the leading (most significant) bit indicates the
sign of the number (1 = negative, 0 = positive).
• For example, the signed 8-bit number 10000001 represents the decimal
number
–1.
15
DATA REPRESENTATION
16
COMPARISION
17
MICROPROCESSOR
• Microprocessors are the core of any modern computer: they are single chip
processing units responsible for computing each operation stored in the
program. The microprocessor reads the algorithm from an external memory,
and executes the commands using a specific language. This language
defines the type of microprocessor, which can be RISC (Reduced
Instruction Set Computer) or CISC (Complex Instruction Set Computer).
• The entire design chain of a microprocessor is focused on improving its
computational power and efficiency, with little to no care for internal
peripherals. This allows the creation of extremely fast, precise, and efficient
computation units. However, because the entire manufacturing process is
dedicated for processing only, a microprocessor requires the use of external
peripherals, such as memory, I/O pins, serial communication, power control.
Figure 1 shows the functional diagram of a digital board applying a
microprocessor, and how it interacts with the external peripherals. Because
it does not have internal memories, the microprocessor cannot be
programmed directly, and it can only run instructions provided by the ROM
memory.
18
MICROPROCESSOR
19
MICROCONTROLLER
20
MICROCONTROLLER
21
Application Comparison
22
MICROCONTROLLER
23
Application Comparison
24
Conclusion Microcontroller vs Microprocessor
25
COMPARISION
26
DATA STORAGE
Classifications of Memory
27
DATA STORAGE RAM
28
DATA STORAGE RAM
29
DATA STORAGE RAM
30
DRAM structure
31
DATA STORAGE RAM
• Each bit of memory (or RAM cell) in a RAM has the same functional
behavior as the circuit in Figure . The storage device in each cell is a D
latch. When a cell's SEL_L input is asserted, the stored data is placed on
the cell's output. When both SEL_L and WR_L are asserted, the latch is
open and a new data bit is stored.
• RAM cells are combined in an array with additional control logic to form a
complete static RAM, as shown in Figure for an 8 x 4 RAM. As in a simple
ROM, a decoder on the address lines selects a particular row of the SRAM
to be accessed.
32
SRAM structure
A SRAM cell
33
DATA STORAGE DRAM
34
DRAM structure
35
DATA STORAGE SRAM
• SRAM chips, on the other hand, can retain their stored information without
being continuously refreshed by the computer.
• SRAM chips use a matrix of 4 or 6- transistors and no capacitors and
accessing data in SRAM chips is up to ten times faster than accessing
memory in DRAM chips.
• In SRAM two of the transistors are used to provide access to the memory.
• When the cell is not addressed, the two access transistors are closed and
the data is kept to a stable state.
• The data in an SRAM cell is volatile, but does not "leak away" like in a
DRAM, so the SRAM does not require a refresh cycle.
• However, SRAM chips can store less information and are more expensive to
produce.
• Technically speaking, the RAM memory does not have any kind of influence
on the processor performance of the computer. RAM memory does not
actually have the capability to make the computer processor work faster,
therefore does not increase the processing performance of the processor.
36
DRAM
Four transistor version of the SRAM cell Six transistor version of the SRAM cell
37
DATA STORAGE SRAM
• There are two key features to SRAM - Static Random Access Memory, and
these set it out against other types of memory that are available:
• The data is held statically: This means that the data is held in the
semiconductor memory without the need to be refreshed as long as the
power is applied to the memory.
• SRAM memory is a form of random access memory: A random access
memory is one in which the locations in the semiconductor memory can be
written to or read from in any order, regardless of the last memory location
that was accessed.
• The circuit for an individual SRAM memory cell comprises typically four
transistors configured as two cross coupled inverters. In this format the
circuit has two stable states, and these equate to the logical "0" and "1"
states.
• The transistors are MOSFETs because the amount of power consumed by
MOS circuit is considerably less than that of bipolar transistor technology
which is the other feasible option, but it will consume much more.
• Using bipolar technology limits the level fo integration because the issue of
heat removal becomes a major issue. In view of this bipolar technology is
rarely used.
38
DATA STORAGE SRAM
• The main advantage of the six transistor SRAM circuit is the reduced static
power. In the four transistor version, there is a constant current flow through
one or other of the pull down resistors and this increases the overall power
consumption of the chip. This can limit the level of integration as well as
increasing the circuit design issues as a result of increased power
dissipation.
• It is also worth mentioning that the four transistor SRAM computer memory
cell provides some advantages in terms of its density but this comes at the
cost of manufacturing complexity as resistors need to be fabricated and this
requires additional processing. Also, the resistors must have small
dimensions and large values to meet the requirements for the cell.
39
COMPARISION OF SRAM AND DRAM
40
DATA STORAGE ROM
41
ROM
42
DATA STORAGE PROM
• PROM
• An alternative to ROM is Programmable Read Only Memory (PROM) that
can be purchased already programmed by the manufacturer or as a blank
unit.
• By using a blank PROM, designers and programmers can put their own
information into the memory, but once the PROM has been written into, it
can never be altered or changed.
• Therefore, it has the advantage of ROM with the additional flexibility to
program the memory to meet a unique or specific need.
• The main disadvantage of PROM is that if a mistake is when inputting data
into the PROM, it cannot be corrected or erased; in addition, a special
device called a PROM programmer or PROM bumer is required to input or
'burn' the data into PROM.
43
DATA STORAGE EPROM
• EPROM
• The Erasable Programmable Read-Only Memory (EPROM) was
developed to overcome the one-time use of the PROM.
• EPROMs can also be purchased blank from the manufacturer and
programmed locally as with PROM, but the big difference between them is
that EPROM can be erased if and when it is necessary.
• Each of its arrays of memory elements is designed to accept and retain a
charge of electrons, and hence assume either of the two logic states
needed for programming.
• Elements that are to read logic 1 are given a charge and those, which are to
be read logic 0, are left unchanged.
• A programmer is also used for this purpose.
• To erase a program the memory elements are exposed to ultraviolet light
radiated through a 'window' in the cover of the IC pack causing the electron
charge to leak away.
44
DATA STORAGE EEPROM
45
RAM and EPROM
46
DATA STORAGE Cache Memory
• Cache Memory
• The most microcontrollers use DRAM chips for their main RAM.
• However, modern microcontrollers usually also include an internal memory
cache, located on the CPU itself, together with an external memory cache,
that uses SRAM chips, to speed up memory access.
• Cache memory is extremely fast memory that is built into a computer's
central processing unit (CPU), or located next to it on a separate chip.
• The CPU uses cache memory to store instructions that are repeatedly
required to run programs, improving overall system speed.
Internal Memory Cache
• A memory cache has been integrated on Intel processors since the
introduction of the Intel 80486 series and this stores data that the CPU is
most likely to request from RAM.
• As the internal cache is integrated with the CPU it can supply data much
more quickly than either RAM or external caches can and so can improve
the computer's performance significantly.
• Internal memory cache is also sometimes called a Primary or Level One
cache.
47
DATA STORAGE
48
DATA STORAGE
49
DATA STORAGE Cache Memory
52