Page 1 of 7 SPC 2314: Microprocessor and Interfacing Lecture Notes
Computer storage
How data/programs are stored in a computer.
Can be:
o Primary storage
Main memory.
Directly accessible by the microprocessor.
o Secondary storage
Auxiliary memory
Not directly accessible by the microprocessor.
Primary memory devices - made of semiconductor materials and are therefore commonly referred to as
semiconductor memory.
o Include:
i. Registers – they are present inside the microprocessor and store information on an instruction to be
carried out. They are also referred to as internal memory because of their placement inside the
microprocessor.
ii. Read-Only-Memory (ROM) – it stores the system programs including the basic input/output
system (BIOS), start-up programs, etc.
iii. Random-Access-Memory (RAM) - it stores the programs that are currently being run and the data
related to these programs. Because of its role in a computer system, it is also referred to as the
working memory.
Cache memory – RAM that can be accessed more quickly than regular RAM ≡ computer memory.
o Some notable differences between RAM and ROM include:
i. While being used in a system, information can be written to RAM at any time, but it cannot be
written to ROM. It can, however, be read from both devices at any time.
ii. RAM is a volatile memory while ROM is non-volatile in the sense that the contents in RAM are
lost when power is turned off while those in ROM are not lost.
o There are two major types of RAM:
i. Static RAM (SRAM) - uses a flip-flop as its basic storage element.
ii. Dynamic RAM (DRAM) - uses a capacitor as its basic storage element.
Some differences between SRAM and DRAM:
SRAM DRAM
Faster Slower
More expensive Less expensive
More power consumption Less power consumption
Does not need to be refreshed Needs to be refreshed thousands of times per second
o There are various types of ROM including:
i. Mask ROM – it is programmed at the time of manufacturing, as the last process of fabrication,
according to the information specified by a user.
ii. PROM (programmable ROM) – it is programmed only once using a device, a PROM
programmer, after which its contents are permanently fixed as in a ROM.
NB: Supplement your learning from the lecture and lecture notes by independent study and discussions.
Page 2 of 7 SPC 2314: Microprocessor and Interfacing Lecture Notes
iii. UV-EPROM (ultraviolet erasable PROM) – it can be programmed, erased and reprogrammed
multiple times. Erasing is done using ultraviolet light.
iv. EEPROM (electrically erasable PROM) - it can be programmed, erased and reprogrammed
multiple times. Erasing is done electrically.
Secondary memory devices
o Are used to store programs and data for future use.
o Strictly speaking, therefore, they are not termed as microcomputer memory, but rather as storage
drives.
o Most commonly used storage drives include the hard disk drive (HDD), solid-state drive (SSD),
compact disk (CD), Digital Video disk, USB drive, etc.
Hard disk drive (HDD)
NB: Supplement your learning from the lecture and lecture notes by independent study and discussions.
Page 3 of 7 SPC 2314: Microprocessor and Interfacing Lecture Notes
Solid-state drive (SSD)
Blu-ray disk
Digital video/versatile disk
(DVD)
Compact disk (CD)
NB: Supplement your learning from the lecture and lecture notes by independent study and discussions.
Page 4 of 7 SPC 2314: Microprocessor and Interfacing Lecture Notes
USB drive/flash disk
Semiconductor memory organization and operation
Semiconductor memories consist of arrays of storage elements that are either flip-flops (which switch
between two states representing one and zero), or capacitors (storing a charge for one, no charge for zero).
Each storage element/memory cell retains either a 1 or a 0.
Memory cells cascaded together into a row.
The number of memory cells in a row → word size.
A row → memory location.
Illustrative example:
address (dec) word size = 8 bits
0 ←
Memory locations
1 ←
2
3
4
5
6
7
8
9
10
The memory size of a memory chip is obtained from:
𝑚𝑒𝑚𝑜𝑟𝑦 𝑠𝑖𝑧𝑒 = 𝑛𝑜. 𝑜𝑓 𝑚𝑒𝑚𝑜𝑟𝑦 𝑙𝑜𝑐𝑎𝑡𝑖𝑜𝑛𝑠 (𝑀) × 𝑤𝑜𝑟𝑑 𝑠𝑖𝑧𝑒 (𝑁)
o 𝑀 and 𝑁 varies from one memory chip to another.
o A block diagram of an 𝑀 × 𝑁 memory chip is shown below:
NB: Supplement your learning from the lecture and lecture notes by independent study and discussions.
Page 5 of 7 SPC 2314: Microprocessor and Interfacing Lecture Notes
o Three fundamental input terminals connecting to a memory chip include:
i. The address input terminal – connects to the system address bus.
Each of the 𝑀 locations of the memory device is defined by a unique address.
Therefore, in order to access any of the 𝑀 locations, 𝑃 address inputs are required where 2𝑃 = 𝑀.
ii. The data I/O terminal – connects to the system data bus.
There are 𝑁 data lines connecting to the data bus. These are the lines which are required,
- for storing data into any memory location of the memory device i.e. a write operation, or
- for reading data from any memory location of the memory device i.e. a read operation.
The number of data lines corresponds to the word size 𝑁 of the memory device.
NB: The data terminal is bidirectional.
iii. The control input terminal – connects to the system control bus.
Control inputs give commands to the memory device to perform a desired operation.
- A command signal is required to enable the memory device so that data may be read from it
or written to it. The control input that does this is referred to as a chip enable (CE) or chip
select (CS) input.
- Once the memory device is enabled, a command signal is required to tell the memory whether
a read operation is required using the read (RD) control input, or
a write operation is required using the write (WR) control input.
Note: Memory read and write operations can only be performed when the chip select input is
enabled/asserted.
Illustrative example: Consider a memory chip with a capacity of 1024 words and 16 bits word size.
o The number of words, 𝑀 = 1024.
o 𝑀 × 𝑁 = 1024 × 16
o 𝑀 = 2𝑃 , where,
NB: Supplement your learning from the lecture and lecture notes by independent study and discussions.
Page 6 of 7 SPC 2314: Microprocessor and Interfacing Lecture Notes
log 𝑀 log 1024
𝑃= = = 10 ≡ 𝑡ℎ𝑒 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑎𝑑𝑑𝑟𝑒𝑠𝑠 𝑙𝑖𝑛𝑒𝑠
log 2 log 2
o Each memory location, therefore, can be identified by a unique 10 bit binary address.
o The addresses range from (0000000000)2 for the first memory location to (1111111111)2 for the
last memory location. This corresponds to the decimal address range from 0 to 1023.
o The figure below illustrates a possible organization and content in this memory device.
o The byte (B) is the smallest addressable unit of memory.
o It is also customary to use one of the following to refer to the size of memory:
˗ K (kilo, = 210 )
˗ M (mega, = 220 )
˗ G (giga, = 230 )
˗ T (tera, = 240 )
˗ Others are: Peta, Exa, Zetta, and Yotta.
o Since 16 bits constitute 2 bytes, the memory chip in the illustration above can then be said to be of
size 1024 × 2 𝑏𝑦𝑡𝑒𝑠 = 2048 bytes or 1𝐾 × 2 𝑏𝑦𝑡𝑒𝑠 = 2𝐾 bytes (2𝐾𝐵).
NB: Supplement your learning from the lecture and lecture notes by independent study and discussions.
Page 7 of 7 SPC 2314: Microprocessor and Interfacing Lecture Notes
Memory write operation - transfer into memory of a new word to be stored.
Memory read operation
o A read operation is a transfer or copy of a stored word out of memory.
NB: Supplement your learning from the lecture and lecture notes by independent study and discussions.