Memory of a Computer is any physical device which is capable of storing information whether it is large or small and stores it temporarily or permanently. For example, Random Access Memory (RAM), is a type of volatile memory that stores information for a short interval of time, on an integrated circuit used by the operating system.
Memory can be either volatile or non-volatile. Volatile memory is a type of memory that loses its contents when the computer or hardware device is switched off. RAM is an example for a volatile memory i.e. why if your computer gets rebooted while working on a program, you lose all the unsaved data. Non-volatile memory, is a memory that keeps its contents saved even in the case of power loss. EPROM((Erasable Programmable ROM) is an example of a non-volatile memory.
Characteristics of Main Memory
- Known as the main memory.
- Semiconductor memories.
- Faster than secondary memories.
- A computer cannot run without the primary memory.
- It is the working memory of the computer.
- Usually volatile memory.
- Data is lost in case power is switched off.
Units of Memory
A computer processor is made up of multiple decisive circuits, each one of which may be either OFF or ON. These two states in terms of memory are represented by a 0 or 1. In order to count higher than 1, such bits (BInary digiTS) are suspended together. A group of eight bits is known as a byte. 1 byte can represent numbers between zero (00000000) and 255 (11111111), or 2^8 = 256 distinct positions. Of course, these bytes may also be combined together to represent larger numbers. The computer represents all characters and numbers internally in the same fashion.
In practical, memory is measured in KiloBytes (KB) or MegaBytes (MB). A kilobyte is not exactly, as one might expect, of 1000 bytes. Rather, the correct amount is 2^10 i.e. 1024 bytes. Similarly, a megabyte is not 1000^2 i.e. 1, 000, 000 bytes, but instead 1024^2 i.e. 1, 048, 576 bytes. This is a remarkable difference. By the time we reach to a gigabyte (i.e. 1024^3 bytes), the difference between the base two and base ten amounts is almost 71 MegaByte.
Both computer memory and disk space are measured in these units. But it’s important not to confuse between these two. “12800 KB RAM” refers to the amount of main memory the computer provides to its CPU whereas “128 MB disk” symbolizes the amount of space that is available for the storage of files, data, and other type of permanent information.
Types of various Units of Memory-
- Kilo Byte
- Mega Byte
- Giga Byte
- Tera Byte
- Peta Byte
- Exa Byte
- Zetta Byte
- Yotta Byte
In computer systems, a unit of data that is eight binary digits long is known as a byte. A byte is the unit that computers use to represent a character such as a letter, number or a typographic symbol (for example, “h”, “7”, or “$”). A byte can also grasp a string of bits that need to be used in some larger units of application processes (e.g., the stream of bits that composes a visual image for a program that represents images or the string of bits that composes the machine code of a computer program).
A byte is abbreviated with a big “B” whereas a bit is abbreviated with a small “b”. Computer storage is generally measured in multiples of byte. For example, a 640 MB hard drive holds a nominal 640 million bytes – or megabytes – of data. Byte multiples are made up of exponents of 2 and generally expressed as a “rounded off” decimal number. For example, two megabytes or 2 million bytes are actually 2, 097, 152 (decimal) bytes.
The kilobyte is the smallest unit of memory measurement but greater than a byte. A kilobyte is 103 or 1, 000 bytes abbreviated as ‘K’ or ‘KB’. It antecedes the MegaByte, which contains 1, 000, 000 bytes. One kilobyte is technically 1, 000 bytes, therefore, kilobytes are often used synonymously with kibibytes, which contain exactly 1, 024 bytes.
Kilobytes are mostly used to measure the size of small files. For example, a simple text document may contain 10 KB of data and therefore it would have a file size of 10 kilobytes. Graphics of small websites are often between 5 KB and 100 KB in size. Individual files typically take up a minimum of four kilobytes of disk space.
One megabyte is equal to 1, 000 KBs and antecedes the gigabyte(GB) unit of memory measurement. A megabyte is 106 or 1, 000, 000 bytes and is abbreviated as “MB”. 1 MB is technically 1, 000, 000 bytes, therefore, megabytes are often used synonymously with mebibytes, which contain exactly 1, 048, 576 bytes.
Megabytes are mostly used to measure the size of large files. For example, a high resolution JPEG image might range in size from 1-5 megabytes. A 3-minute song saved in a compressed version may be roughly 3MB in size, and the uncompressed version may take upto 30 MB of disk space. Compact Disk’s capacity is measured in megabytes (approx 700 to 800 MB), whereas the capacity of most other forms of media drives, such as hard drives and flash drives, is generally measured in gigabytes or terabytes.
One gigabyte is equal to 1, 000 MBs and precedes the terabyte(TB) unit of memory measurement. A gigabyte is 109 or 1, 000, 000, 000 bytes and is abbreviated as “GB”. 1 GB is technically 1, 000, 000, 000 bytes, therefore, gigabytes are used synonymously with gibibytes, which contain exactly 1, 073, 741, 824 bytes.
Gigabytes, are sometimes also abbreviated as “gigs, ” and are often used to measure storage device’s capacity. e.g., a standard DVD drive can hold 4.7 GBs of data. Storage devices that hold 1, 000 GB of data or more are measured in terabytes.
One terabyte is equal to 1, 000 GBs and precedes the petabyte(PB) unit of memory measurement.A terabyte is 1012 or 1, 000, 000, 000, 000 bytes and is abbreviated as “TB”. 1 TB is technically 1 trillion bytes, therefore, terabytes and tebibytes are used synonymously, which contains exactly 1, 099, 511, 627, 776 bytes (1, 024 GB).
Mostly the storage capacity of large storage devices is measured in TeraBytes. Around 2007, consumer hard drives reached a capacity of 1 Tera Byte. Now, HDDs are measured in Terabytes e.g., a typical internal HDD may hold 2 Terabytes of data whereas some servers and high-end workstations that contain multiple hard drives may even have a total storage capacity of over 10 Tera bytes.
One petabyte is equal to 1, 000 TBs and precedes the exabyte unit of memory measurement. A petabyte is 1015 or 1, 000, 000, 000, 000, 000 bytes and is abbreviated as “PB”. A petabyte is lesser in size than a pebibyte, which contains exactly 1, 125, 899, 906, 842, 624 (250) bytes.
Most of the storage devices can hold a maximum of a few TBs, therefore, petabytes are rarely used to measure memory capacity of a single device. Instead, PBs are used to measure the total data stored in large networks or server farms. For example, Internet Giants like Google and Facebook store more than over 100 PBs of data on their data servers.
One exabyte is equal to 1, 000 PBs and precedes the zettabyte unit of memory measurement. An exabyte is 1018 or 1, 000, 000, 000, 000, 000, 000 bytes and is abbreviated as “EB”. Exabytes are lesser than exbibytes, which contain exactly 1, 152, 921, 504, 606, 846, 976 (260) bytes.
The exabyte unit of memory measurement is so large, that it is not used to measure the capacity of storage devices. Even the data storage capacity of the biggest cloud storage centers is measured in PBs, which is a fraction of 1 EB. Instead, exabytes measure the amount of data over multiple data storage networks or the amount of data that is being transferred over the Internet for a certain amount of time. E.g., several hundred exabytes of data is transferred over the Internet every year.
One zettabyte is equal to 1, 000 exabytes or 1021 or 1, 000, 000, 000, 000, 000, 000, 000 bytes. Zettabyte is little bit smaller than zebibyte that contain 1, 180, 591, 620, 717, 411, 303, 424 (270) bytes and is abbreviated as “ZB”. One zettabyte contains one billion TBs or one sextillion bytes that means it will take one billion one terabyte hard drives to store one zettabyte of data. Generally, Zettabyte is used to measure the large amounts of data and all the data in the world is just a few zettabytes.
One yottabyte is equal to 1, 000 zettabytes. It is the largest SI unit of memory measurement. A yottabyte is 1024 ZettaBytes or 1, 000, 000, 000, 000, 000, 000, 000, 000 bytes and is abbreviated as “YB”. It is little bit smaller than yobibyte, which contains exactly 1, 208, 925, 819, 614, 629, 174, 706, 176 bytes (280) bytes.
1 yottabyte contains one septillion bytes which is exactly same as one trillion TBs. It is a very large number that human can evaluate. There is no practical use of such a large measurement unit because all the data in the world made of just a few zettabytes.
Tabular Representation of various Memory Sizes
|Name||Equal To||Size(In Bytes)|
|Nibble||4 bits||1/2 (rare)|
|Megabyte||1, 024kilobytes||1, 048, 576|
|Gigabyte||1, 024 megabytes||1, 073, 741, 824|
|Terrabyte||1, 024 gigabytes||1, 099, 511, 627, 776|
|Petabyte||1, 024 terrabytes||1, 125, 899, 906, 842, 624|
|Exabyte||1, 024 petabytes||1, 152, 921, 504, 606, 846, 976|
|Zettabyte||1, 024 exabytes||1, 180, 591, 620, 717, 411, 303, 424|
|Yottabyte||1, 024 zettabytes||1, 208, 925, 819, 614, 629, 174, 706, 176|
- Print colored message with different fonts and sizes in C
- Understanding for loops in Java
- Understanding Array IndexOutofbounds Exception in Java
- Program to convert KiloBytes to Bytes and Bits
- Understanding "static" in "public static void main" in Java
- File Permissions in Java
- Delete a file using Java
- Log-Structured File System (LFS)
- Copying file using FileStreams in Java
- Different ways of Reading a text file in Java
- Python | Scramble words from a text file
- Java.io.File Class in Java
- Program to calculate Percentile of Students
- Program to find the time remaining for the day to complete
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.