Table of contents
1.
Introduction 
1.1.
Memory in Terms of Size
1.1.1.
Bit
1.1.2.
Nibble
1.1.3.
Byte
1.1.4.
Word
1.2.
Practical Units of Memory
1.2.1.
Kilobyte(KB)
1.2.2.
Megabyte(MB)
1.2.3.
Gigabyte(GB)
1.2.4.
Terabyte(TB)
1.2.5.
Petabyte(PB)
1.3.
Other Classification Criteria
1.3.1.
RAM(random access memory)
1.3.2.
ROM(read-only memory)
2.
Frequently Asked Questions
2.1.
What is memory in a computer?
2.2.
What are some of the types of memory in a computer system?
2.3.
What's the relationship between the access speed of the memory, its price, and the size generally used in computers?
2.4.
What are computer registers used for?
2.5.
Which is the largest unit of memory?
3.
Conclusion
Last Updated: Mar 27, 2024

Introduction To Memory And Its Units

Career growth poll
Do you think IIT Guwahati certified course can help you in your career?
Operating Systems

Introduction 

Memory is one of the most integral parts of any computer system. It is used to store the data and instructions. The capacity or the amount of data a given memory unit can store is called its capacity. It is measured in various ways depending on the memory's nature and its application. But before getting into it, let's first learn how the data is stored in the memory.

Also see, Memory Hierarchy and its Characteristics, Multiprogramming vs Multitasking

Memory in Terms of Size

At a very broad level, the memory is divided into cells, and each of these cells has a unique address in the memory. The range for this address is from zero to one less than the memory size. So, the unit in the case of memory also has a very similar meaning as they have in the case of any other quantity. One memory unit is the amount of data that one piece of memory can hold. 

So let's see the units one by one, starting with the smallest unit. 

Bit

It is the smallest unit of memory and stores data in the binary format; it can only have either of the two values 0 or 1. 1 refers to an active state, and 0 refers to an inactive state. 

Nibble

It is another memory storage unit, which is slightly larger than the bit. One nibble is equal to 4 bits. 

Byte

It is also a very common memory unit, equal to either 8 bits or two nibbles. Also, it is the smallest memory unit that can store a character or data item in it.

Word

Generally, the computer can't work efficiently with such small memory units for practical purposes, so they use larger units as basic units. Hence computers define this basic memory unit as words, which can vary from 8 bits to 96 bits. Though it varies from computer to computer, it is fixed for a computer. 

Practical Units of Memory

The memory units we saw till now are very small units that are not suitable for practical usage, and we won't find a standalone storage unit of that size in practice. So, let's move on to the memory higher memory units, which can contain much more data in them-

Kilobyte(KB)

As the name suggests, Kilobyte refers to a memory unit of 1024 bytes.

1 Kilobyte = 1024 bytes.

Megabyte(MB)

A megabyte refers to a memory unit of 1024 Kilobytes.

1 Megabyte = 1024 Kilobytes = 1024*1024 bytes.

Gigabyte(GB)

Gigabyte refers to a memory unit of size equal to 1024 Megabytes.

1 Gigabyte = 1024 Megabytes = (1024)^3 bytes.

Terabyte(TB)

Terabyte refers to a memory unit of 1024 Gigabytes.

1 Terabyte = 1024 Gigabytes = (1024)^4 bytes.

Petabyte(PB)

Petabyte refers to a memory unit of size 1024 Terabytes.

1 Petabyte = 1024 Terabytes = (1024)^5 bytes 

There are larger units of memory listed below that keep increasing in the multiples of 1024 from their predecessor, but we will be discussing them in detail in some other article.

Other Classification Criteria

The memory is also divided into various categories depending on their speeds and level of interaction with the processor if they are rewritable or non-rewritable. We have the following types of memory -

RAM(random access memory)

Random Access Memory is the primary memory, also known as the Main Memory. Their further classification is done in the following types on the basis of their behavior:

  • Static Random Access Memory.
  • Dynamic Random Access Memory.

ROM(read-only memory)

Read-Only Memory is known as non-volatile memory, and it is generally used where there are fewer chances of changes in the memory during its usage. It is also further classified into 

the following four types: 

  • Mask Read-Only Memory.
  • Programmable Read-Only Memory.
  • Erasable Programmable Read-Only Memory.
  • Electrically Erasable Programmable Read-Only Memory. 

 We will cover these different types in some other blogs. So let's move on to the FAQs.

You can also read about the interleave memory and Open Source Operating System.

Frequently Asked Questions

What is memory in a computer?

Memory is the essential part of the computer that stores the information and instruction processed by the computer. A computer won't be able to process any tasks without any memory.

What are some of the types of memory in a computer system?

The main categories in which computer memory is classified are -
Primary memory - it is mainly used by the computer while processing mode. It is generally smaller in size, but it allows fast access to its data.
Secondary memory- it is used for prolonged storage of data that is less frequently used by the computer.

What's the relationship between the access speed of the memory, its price, and the size generally used in computers?

Generally, the fast read and write speed memory is much costlier than their slow counterparts. And thus, their small size of them is used where it is essentially required for the machine's performance.

What are computer registers used for?

Registers are another type of computer memory that is used for faster acceptance, storage, and transfer of data, it generally works in integration with the CPU and is often called processor registers.

Which is the largest unit of memory?

Yottabyte is the largest unit of memory, which is equal to 10^23 bytes.

Conclusion

In this article, we have extensively discussed memory and the various units used to measure memory. We started by discussing the various categorization of memory based on different characteristics. Then we learned about the various units of memory to measure its size, some very basic units, then the units more frequently used for practical purposes. We lastly wrapped up the blog with some faqs related to the topic.

Recommended Reading:

Do check out The Interview guide for Product Based Companies as well as some of the Popular Interview Problems from Top companies like Amazon, Adobe, Google, Uber, Microsoft, etc. on Coding Ninjas Studio.

Also check out some of the Guided Paths on topics such as Data Structure and Algorithms, Competitive Programming, Operating Systems, Computer Networks, DBMS, System Design, etc. as well as some Contests, Test Series, Interview Bundles, and some Interview Experiences curated by top Industry Experts only on Coding Ninjas Studio.

Live masterclass