If you’re familiar with the hardware in a computer, you’d definitely know that computer memory basically stores all the data which makes it relatively important.
When we’re talking about computer memory, there are also two major categories: Primary Memory and Secondary Memory. But before we delve deeper into the respective categories, let’s talk about what exactly is computer memory, to begin with?
What is computer memory?
Computer memory is a data storage technology that is capable of storing or saving data, temporarily or permanently. The data stored are in a binary form such as 0 and 1 as well, allowing the user to save and retrieve the information anytime they require it.
Why is computer memory so important?
You can imagine computer memory to be a human brain, a computer memory provides the computer space to access data quickly. This would then allow the processor to communicate with the program much quicker. Without computer memory, the user wouldn’t be able to save anything as well, which makes it incredibly important!
How does computer memory work?
To understand how computer memory work, take a look at this hierarchy:
No matter what’s your input sources, be turning on your computer or typing on your keyboard, it’ll all go to read-only memory (ROM) and performs a power-on self-test (POST) to ensure all components are functioning.
Then, the memory controller will check the memory addresses and perform a quick read/write operation to make sure there are no errors. From there, a basic input/output system (BIOS) from ROM will be loaded, the system will also load the operating system (OS) from the hard drive into the system’s RAM.
So basically, no matter you’re loading or saving a file, it will all go through RAM first. This is because the random-access memory (RAM) will process all the temporary data that is requested by the CPU, none of this data is saved in RAM. And so, once the application is shut down, the data is lost as well.
Main categories of computer memory
After talking about how computer memory is important, we did mention briefly about RAM and ROM earlier, but do you know there are a lot more sub-categories of it?
What will be covered:
- RAM: SRAM, DRAM
- ROM: MROM, PROM, EPROM, EEPROM
- SDD: SATA, PCIe, M.2, U.2, NVMe
- Flash Drives
- Cloud Storage (tertiary memory)
Looks daunting? No fret, we will discuss all these different types of memory in detail later!
Overview of Primary Memory
What is Primary Memory?
The main memory in a computer, also known as internal memory or internal storage. Accessing data from primary memory is pretty fast and it is either volatile like RAM or non-volatile like ROM. The capacity of primary memory is also limited and generally smaller when compared to secondary memory.
RAM: Random-access memory
RAM is the main memory in a computer system, also known as cache memory. It is basically a high-speed component that temporarily stores the device needs, and allow the device to access the data immediately.
With RAM, you won’t have to wait for ages for your CPU to dig through other storage, which usually takes a lot of time. However, RAM is volatile, and so the temporary memory that’s stored there will be lost when you shut down your system.
Even though we generally refer to RAM as RAM, there are 2 primary forms of RAM:
SRAM: Static RAM
SRAM is a type of semiconductor memory and it uses bistable latching circuitry to store each bit, this makes it very fast and thus the name cache memory. However, it is much more expensive than DRAM (we’ll talk about it later) and takes up a lot more space so there’s lesser memory on a chip.
It is also most commonly used as cache in a CPU, usually listed in L2 or L3. But as we mentioned earlier, because it is pretty expensive, so the values of L2 and L3 are generally 1MB to 16MB only.
DRAM: Dynamic RAM
DRAM is another type of RAM that stores each bit of data in a separate capacitor within an integrated circuit. This means that each memory cell in a DRAM chip holds one bit of data and is composed of a transistor and a capacitor. Where the memory controller needs to read the data and then rewrites it, constantly refreshing. Thus, this process makes the DRAM slower than SRAM.
However, DRAM is cheaper than SRAM and so it is used as the main memory in a CPU, though slower than SRAM, it is still relatively fast and is able to connect directly to the CPU bus. Unlike the expensive SRAM, DRAM is typically 4GB to 16 GB in laptops and 1GB to 2GB in smaller devices.
The main difference between SRAM and DRAM:
ROM: Read Only Memory
ROM is also a primary memory just like RAM, but unlike RAM, ROM is able to store data permanently which makes it non-volatile. It is a programmable chip that stores all the most important instructions required to start the system, this process is also known as bootstrap.
With ROM, the system will stay active and your data will not be overwritten, deleted or modified even if you shut it down. Thus its name, Read only memory since the data can only be read and accessed by the user.
Alike to RAM, there are a few different types of ROM:
MROM: Mask ROM
MROM is a hand-wired device, one of the first ROMs. It also contains a software mask that is burned onto the chip during the design phase of the semiconductor manufacturing process. Moreover, it is the most inexpensive ROM out of the rest and contains a pre-programmed set of data.
PROM: Programmable ROM
PROM is as its name states, a read only memory chip that only allows the user to overwrite the data once. What makes it different from regular ROM is that it is a blank memory chip, while ROM comes pre-programmed.
Since there are small fuses inside of the chip itself that allows you to program the PROM, a static electric can cause the fuse to burn out. Thus, making it relatively fragile and is cheaper than ROMs. However, the user would require a PROM programmer or PROM burner in order to write the data.
EROM: Erasable Programmable ROM
Using regular ROMs and PROMs could be pretty wasteful even though they are cheap, but they couldn’t be overwritten and reused. Thus, as EROM’s name states, you’re able to overwrite the data by exposing it to ultra-violet light for up to 40 minutes.
In order to erase the data, you’ll have to expose the quartz transparent window lid to the ultra-violet light. Once you’re done with it, just seal the lid with a sticker and you can use it again! However, if you own an EPROM eraser, you can use that as an alternative as well.
EEPROM: Electrically Erasable and Programmable ROM
A relatively long name, but it works the same way as EPROM! What’s different is just the way of erasing the data. Instead of exposing it to the ultra-violet light, you can just expose it to an electrical charge! So, no transparent window is required.
EEPROM is able to be erased and reprogrammed about 10,000 times, what’s even better is that you’re able to erase one byte at a time which is pretty flexible, despite the erasing process being slow.
The main difference between PROM, EPROM and EEPROM:
Primary Memory: RAM vs ROM
Now that we’ve talked all about primary memory, let’s do a tiny recap and look at RAM and ROM’s differences:
To add-on, RAM and ROM’s physical appearance is pretty different as well and in terms of processing speed, RAM is definitely a lot faster than ROM.
Now that we have a better understanding of primary memory, let’s move on to Secondary memory next!
Overview of Secondary Memory
What is the Secondary Memory?
The secondary memory is also known as external memory or auxiliary memory. Unlike primary memory, secondary memory is generally volatile and they tend to process data slower than primary memory. The secondary is comparably less important than primary memory since they’re basically extra storage for more data.
SSD: Solid-State Drive
SSD uses a simple memory chip called NAND flash memory, and it is a newer kind of storage devices used in computers, meant to replace HDDs (we’ll address this later). SSDs are able to speed up your computer which could improve the overall performance.
The NAND flash has transistors that would conduct current and set the value to 1, and when it doesn’t, the value will be set to 0. Through this, the SDD will be able to store data at a high speed.
With that said, we can classify SSD into memory chip and interface, here are several types of SSDs based on the interface:
SATA: Serial Advanced Technology Attachment
SATA SSDs are pretty common and they are a type of interface connection that allows SSDs to communicate data with the system. You can basically use SATA with any laptop or computer, even if its a very old one.
As of current, SATA 3.0 is the most versatile form of SDD and it has a transferring rate of 6Gb/s, but usually, the actual transfer speed would be 4.8Gb/s due to physical overhead. There’s also SATA 2.0 apart from 3.0 as well.
Speaking of which, we do offer SATA 3.0 here at Seeed as well! However, do note that it’s only compatible with our ODYSSEY-X86J4105 and they use M.2 PCIe Slots Key B. Feel free to check them out if you’re interested!
PCIe: Peripheral Component Interconnect Express
PCIe, also abbreviated as PCI Express, is a solid-state drive connected to a computer system using a PCIe interface. Since it is plugged into the sever’s backplane, it is able to integrate flash directly on the sever’s motherboard which greatly improves the transfer speed. This also makes PCIe the fastest SSD when compared to the rest.
M.2 SSD was previously known as NGFF (Next Generation Form Factor), which contains flash memory and controller chips. You might have already realised it, but M.2 look rather similar to RAM, though it is much smaller and is a standard in ultrabooks or tablet computers!
M.2 also supports multiple protocols and applications like Wi-Fi, USB, PCI Express and SATA, which makes it incredibly versatile. The standard size of an M.2 SDD is 22 mm width for computers and laptops.
U.2 SSD is previously known as SFF-8639, an interface that is defined as SSD Form Factor Working Group (SFFWG). It is similar to M.2, which utilises PCIe interface to send data. It is versatile and compatible with SATA, SATA-E, PCIe etc.
The main difference between M.2 and U.2 is that the capacity is not bound by the small circuit board (in M.2) and this allows more space for flash-memory chips, which just allows higher capacity SSD!
NVM Express or NVMe is short for Non-Volatile Memory Host Controller Interface Specification (NVMHCIS). It is basically attached to a PCIe slot on the mainboard, which reduces I/O overhead and helps to improve the disk’s performance. This includes multiple long command queues and reduced latency.
The NVMe is developed for SSDs to overcome the bottleneck due to the older SATA. Though they’re amazing, it comes at a high price and they are only available on desktops as well.
HDD: Hard Disk Drive
HDD is a traditional storage device, also known as magnetic storage devices, where the data is stored using a magnetized medium. These devices usually have very large capacities and they’re pretty affordable too!
Since the data is read and written by a head, similar to how vinyl works, it is also very easy to read or write the data as well. Though their data accessing power is slow, it is used in RAM that has good data accessing power.
To help you visualise how an HDD’s moving parts look like, here’s a labelled diagram of it:
Flash drives are also known as thumb drives, pen drives and sometimes USB drives, it is also one of the most popular secondary storage devices. They are basically a small portable storage device that allows you to store, rewrite, and delete data easily.
All you have to do it plug it in your computers’ USB port to access the data inside, you can also use it with your mobile phones or tablets. Nowadays, the storage capacity is from 8GB to 64GB, but there are also some that go up to 1T!
NAS: Network-Attached Storage
NAS is a type of storage network, it is basically a specialised file server. What’s great about NAS is that it has a ton of space and as long as you have an ethernet connection, you’ll be able to gain access.
Though NAS is not too great for databases as it is not as fast as SAN (will address this later), it is really cheap which makes it a great option to start. It supports high-end applications such as rendering and 3D animation, as well as for analytics!
SAN: Storage Area Network
SAN is also another type of storage network, similar to NAS, SAN takes storage devices away from the server to create a central pool of data. However, SAN is not dependant on Local Area Network (LAN), the capacity is pooled and provided a dedicated network.
The data is stored in block-level storage as well, where the data is not tied to a file but is rather controlled by the operating system. Thus SAN is a better option for easy storage database management.
At this point, if you’re still unsure about SSD form factors, do check out the video below to help you!
Tertiary Memory: Cloud Storage
Cloud storage or clouding as some may refer it, is relatively common these days and it is basically a collection of networked computer hardware that provides the many aspects of computing in the form of online services.
Just like its name, cloud storage is untouchable and you can’t see it either, but you can control it remotely. This is great if you constantly need to access and save a large amount of data, for instance, large organisations or even for personal use!
You might be thinking, how is it able to store large amounts of data without compromising the safety? There’s actually a data encryption system that allows safe use and efficient data storage. The process of data encryption look as such:
Secondary Memory: SSD vs HDD, NAS vs SAN
Now that we’ve talked about secondary memory, let’s first compare the difference between SSD and HDD:
|Access Time||Much faster than HDD||Pretty fast as well but slower than SSD|
|Reliability||No movable parts, thus its much more reliable||Consists of different movable parts, thus it is more prone to errors|
|Power||Low power consumption as compared to HDD||HDD requires more power to move the different parts|
|Heat||Less heat is generated||Generates a lot of heat which causes damage to the parts overtime|
Next up, NAS vs SAN:
Primary vs Secondary Memory
After talking about primary and secondary memory in detail, let’s finally look at their differences to help you understand better:
|Primary Memory||Secondary Memory|
|Nature||Can be volatile (RAM) and non-volatile (ROM)||Non-volatile|
|Alias||Internal memory||Auxiliary memory|
|Price||Typically more pricy than secondary memory||Cheaper than primary memory|
|Access||Accessed directly by processing unit||Accessed indirectly, need to be transferred to the primary memory before accessed by CPU|
|Accesses||Accessed by the data bus||Accessed by I/O channels|
|Formation||Volatile memory won’t retain data||Non-volatile memory will be able to retain data|
|Capacity||Usually smaller storage than secondary memory||Has much more power to store data|
And that’s all on Primary and Secondary memory! Did you learn something new? We covered everything from the basics of computer memory to the subcategories of primary and secondary memory. Hope that you’ve gained a better understanding of computer memory!
Enjoyed this article? Check out more related articles below!
Overview of Computer Ports: Types, Functions and Comparison – Learn more about computer connectors!
All about CPUs: Microprocessor, Microcontroller and Single Board Computer – Want to learn more about computer-related content? Check out CPUs!
Bluetooth Protocol: Overview and Bluetooth Module – If transferring wireless data or content interest you, check out Bluetooth!