You are on page 1of 10

Topic Main

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.

Explain the process of byte arrangement.

INTRODUCTION

Memory is a computer component that saves instruction and data.


The process of entering instruction and data into a memory is called Write,
whereas the process of accessing instruction and data from a memory is known
as Read.
The memory can be divided into two:
(a)

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

TOPIC 1 MAIN MEMORY

MEMORY ADDRESS
SELF-CHECK 1.1

Explain the difference between memory address and data address?

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

Figure 1.1: Illustration of a memory and the address

TOPIC 1 MAIN MEMORY

ACTIVITY 1.1
1.

How many locations exist if the address size is


(a)
(b)

2.

What is the address size if the number of location is


(a)
(b)

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 G byte = 1024 M 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

Figure 1.2 (a): Big endian

3
7
11
15

2
6
10
14

1
5
9
13

0
4
8
12

0
4
8
12

Figure 1.2 (b): Little endian

TOPIC 1 MAIN MEMORY

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

ERROR CORRECTION CODE

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.

For an example, we are given two codeword 10001001 and 10110001.


In order to identify the number of different bits in the above codeword, we have
to perform exclusive OR on each bit in between these two codeword. This is done
by calculating the number of bit 1 in the new codeword. In the example below,
the exclusive OR is performed on the two codeword by comparing both
codeword bit by bit.

TOPIC 1 MAIN MEMORY

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)

Determine the correct codeword by looking at the valid codeword, which


has the minimum Hamming Distance with the wrong codeword.

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

Hamming Distance from 11111110

00011111
4

11111100
1

11110100
2

TOPIC 1 MAIN MEMORY

Figure 1.3: Hamming distance usage

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

Do you know why does a computer need several types of memory?

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:

TOPIC 1 MAIN MEMORY

1.5.1

RAM (Random Access Memory)

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)

RDRAM (RAMbus DRAM)

1.5.2

ROM (Read Only Memory)

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

TOPIC 1 MAIN MEMORY

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)

A search for the entry word in the cache is performed.

(b)

If the entry word is found, it is taken.

(c)

If not, a block of memory that has the particular entry word will be taken
and saved into cache memory.

TOPIC 1 MAIN MEMORY

Figure 1.4: Information for every section is stored in a traditional memory hierarchy

1.6

MEMORY CHIP

The Semiconductor Memory is in a form of integrated circuits or also known as


chip.
The advancements of technologies have enabled memory chips to have bigger
capacities at a low production cost.
The amount of bits in a memory chip increases by four times every three to four
years. In the early 1970s, a chip only contains 1KB. This number then increased to
4K, 64K and 256K. In the year 1990, memory chips with 4 million bits or 4M were
introduced. Today, memory chips with 128M are widely used.
Interestingly enough, prices of memory technologies have become cheaper. The
128M chips can now be purchased at the same price as a 16M chip a few years
ago.

10

1.7

TOPIC 1 MAIN MEMORY

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.

Understanding the data operation can help to enhance the effectiveness of a


computer operation. The rapid technology advancements have encouraged
the production of more effective and efficient memory.

Byte
RAM (Random Access Memory)
ROM (Read Only Memory)

You might also like