Topic 1
Topic 1
Memory
LEARNING OUTCOMES
By the end of this topic, you should be able to:
1.
Explain the types of memory, ways of accessing data and the capacity
of each memory; and
2.
INTRODUCTION
Read Only Memory (ROM): type of memory that only can read the
contents.
(b)
Random Access Memory (RAM): type of memory that can read and write.
Besides these types of memory, there are two others in a computer system i.e
Associate Memory and Cache Memory.
1.1
MEMORY ADDRESS
SELF-CHECK 1.1
The basic unit in a memory is binary code, which is called a bit. Bit uses the
symbols 0 and 1. The combination of eight bit is known as 1 byte.
Memory has a number of cells and locations, each of it can save one data.
A cell in a memory is known as word. The word size in a machine is not
necessary the same as in other machines. Each of the word has its own number,
which is called address. The location of each data or instruction in a memory can
be referred through this address. If a memory has n word, then it has an address
from 0 until n-1. The number of location depends on the address size. If m bit
data is used to save address, then the number of cells can be referred as 2m. The
illustration of a memory and the concept of address memory locations are shown
in Figure 1.1.
Memory Address
0
1
2
3
4
5
Data
Data 0
Data 1
Data 2
Data 3
Data 4
Data Max
Max
ACTIVITY 1.1
1.
2.
1.2
16 bit
32 bit
1024
2048
CAPACITY
Capacity is the total of bits that can be loaded into a memory. This capacity is
usually measured by using short forms K, M, or G where the actual meaning is
kilobytes, megabytes and gigabytes.
1 K byte = 1024 byte
1 M byte = 1024 K byte
1.3
BYTE ARRANGEMENT
The byte in a word can be numbered from left to right or from right to left. In a
Motorola Chip (Figure 1.2a), the numbering starts from the left, whereas Intel
starts the numbering from the right as shown in (Figure 1.2b). Numbering that
starts from left is called Big endian, whereas numbering that starts from left is
called little endian.
0
4
8
12
0
4
8
12
1
5
9
13
2
6
10
14
3
7
11
15
3
7
11
15
2
6
10
14
1
5
9
13
0
4
8
12
0
4
8
12
Both types of numbering can be used. Problems will only arise when a machine
tries to send a record to another machine, which uses a different type of
numbering. The machine that receives the record will translate it incorrectly. The
solution to this problem is to use a software that can change the record by using
its own numbering.
SELF-CHECK 1.2
Describe the term byte.
ACTIVITY 1.2
State the representation of AHMADNAZRI by using the big endian and
little endian numbering method.
1.4
Computer memory sometimes faces errors and failures that cause changes to the
saved data.
To control these errors, most memory use Error Detection Code. Through this, a
few additional bits are added into a memory word through a certain method.
When a codeword is read from the memory, these additional bits will be checked
for errors. If there is an error, then the Hamming Alkhwarizmi is used to correct
these errors. In order to understand the Hamming Alkhwarizmi, we need to have
the knowledge on the Hamming Distance concept.
The Hamming Distance between two binary strings can be obtained by
calculating the number of different bits in between these two strings.
10001001
10110001
0 0 1 1 1 0 0 0 (Output of XOR)
From the output, we can conclude that there are three different bits. This shows
that the Hamming Distance between the two codeword is 3 (three).
In Hamming Alkhwarizmi, we have to perform two actions as stated below:
(a)
Obtain the Hamming Distance in between the codeword with the valid
codeword.
(b)
Example:
For an example, consider the memory with only three valid codeword:
00011111, 11111100 and 11110100
if the codeword 11111110 is arrive, the processor will be able to know that the
original codeword should be 11111100, because it is the only codeword that has
minimum Hamming Distance compared to the other three codeword as shown
as below:
Table 1.1: Hamming Distance Calculation
00011111
4
11111100
1
11110100
2
ACTIVITY 1.3
Based on the above example, what is the original codeword, if the
received codeword is:
(a)
00101100
(b)
11011111
1.5
TYPES OF MEMORY
SELF-CHECK 1.3
In the early days (from early 1950s to 1970s) memory is made of magnets. These
types of memory are small and very expensive.
After the 1970s, the semiconductor memory was invented and now most of the
computers use this type of memory. Computer memory can be classified into a
few types as below:
1.5.1
RAM is divided into two types, which are static and dynamic. Static RAM
(SRAM) can retain its contents as long as power remains.
Dynamic RAM (DRAM) is different because it is an array of small capacitors.
Each of this capacitor can be charged or discharged. As the capacitors leak
charge, each bit in DRAM has to be refreshed every a few million nanoseconds to
avoid data from disappearing. As DRAM uses tiny capacitors, it can be built with
a very big capacity.
There are few types of DRAM as below:
(a)
EDO DRAM
(b)
CDRAM
(c)
SDRAM
(d)
1.5.2
The data stored into the ROM at the manufacturing stage. Most of the computer
game tools store data in the ROM. In most computer system, ROM is used to
save a boot program known as Bootstrap Loader. The main function of a
Bootstrap Loader is to start the computer operating system when the computer is
turned on.
The production cost for ROM is lower compared to RAM if it is purchased in
large quantities. However, the contents cannot be modified and you would have
to wait several weeks before you receive your ROM chip from the factory. Most
factories have enhanced ROM technologies such as PROM (Programmable Rom).
It is similar to the ROM chip but allows data/information to be written by using
a programming technique known as Field Programming.
One step up from the PROM is the EPROM (Erasable Programmable Rom),
which is a ROM that can be reprogrammed and erased. The EPROM technology
is followed by the development of EEPROM or also known as EAROM, in which
data can be erased or reprogrammed by applying higher than normal electrical
voltage.
1.5.3
Associative Memory
Generally, the main memory is arranged in sequence. To access data from main
memory, a data search through address is performed. Every word in the main
memory is checked until the search is successful.
The time required for a search can be reduced considerably if it is by content of
data as oppose to its address. Memory that is accessed this way is known as
Associative Memory or Content Addressable Memory.
The Associative Memory saves the time required in accessing data. However, it is
more expensive in comparison to the random access memory. This is because
each cell has the capability to save data and has logic circuits to erase the
contents.
Thus, Associative Memory is only used in applications that require fast searches
of database.
1.5.4
Cache Memory
Accessing data from the memory takes a longer time compare to processing the
data. However, analysis shows that access to memory at one point in time is
referenced to one location only.
This phenomenon is called locality of reference.
Thus, if the memory is located in a smaller and high-speed storage, the process of
accessing memory is significantly faster. This memory system is called Cache
Memory.
A Cache Memory operates in the following manner:
(a)
(b)
(c)
If not, a block of memory that has the particular entry word will be taken
and saved into cache memory.
Figure 1.4: Information for every section is stored in a traditional memory hierarchy
1.6
MEMORY CHIP
10
1.7
MEMORY ORGANISATION
Memory chip can be organised in two ways, whether to form a memory with
capacity for words or capacity for word size.
As example, four chips of 32K x 8 can be arranged to form a memory of 128K x 8
or a memory of 32K x 32.
Byte
RAM (Random Access Memory)
ROM (Read Only Memory)