Part 2 – Solid-State Drive
In the previous article of this series, we looked at the hard disk drive (HDD) to understand how it works. In this article, we will be looking at the solid-state drive.
What is a Solid-State Drive?
The solid-state drive (SSD) is an electrical device and a solid-state storage that comes in a variety of form factors. It is called solid-state because there are no moving parts inside. Fundamentally, it is no different from a USB flash drive in terms of the storage technology used except for its higher performance and capacity. Consumer-grade SSD that can be purchased off the shelves typically comes in two form factors: 2.5-inch or M.2.
How does the SSD work?
Like the HDD, there are various components that makes up a SSD but we will only focus on two of the components here. The first component is the memory controller which is responsible for managing stored data and handling communication with the various electronics in the host system, including the drive itself. The second is the NAND flash chip where data are physically stored.
The memory controller is one of the most complex piece of integrated circuit found on the drive. It is responsible for the following operations:
1. Reads, writes and erases data in flash memories
2. Moves data between the system, on-device cache (typically DRAM-based) and the flash memories
3. Interacts with the host system
4. Corrects bit errors when reading data from memory cells
5. Selects memory blocks to read and write or erase data
6. Performs wear levelling of the flash memories by ensuring all the memory cells are being written at an equal rate because each cell supports a limited number of write-erase cycle
7. Performs background garbage collection where memory cells containing data marked for deletion are cleared for new data
A NAND flash is an integrated circuit designed to hold information for a period of time even when there is no power to the device. It is typically packaged and shipped as a black plastic chip that you find on the circuit boards of SSDs or any other flash-based storage device.
Within the chip, there can be one or more silicon-based NAND flash dies. Manufacturers stack multiple memory dies and wire them up inside so that they can increase the storage capacity per chip, to reduce cost and improve performance. And recently, manufacturers have also implemented Vertical NAND, which is the creation of multiple layers of memory cells within a die, to further reduce cost and boost performance.
Each die contains arrays of memory cells made out of floating gate transistors, which we will look at in detail later, and various other circuitries for the management of the cells and their data.
A memory cell either holds an electrical charge or is empty. Depending on the SSD and the market it serves, it could be using a certain type of memory cells. The most expensive and durable type of memory cell is the single-level cell (SLC) where it only stores one bit of data. Due to its price and endurance, it is typically found in servers in data centres that have to write more data than it reads. The next most expensive but less durable is the multi-level cell (MLC) where it stores two bit of data. Then, there is the triple-level cell (TLC) which stores three bit of data and is the most common of memory cells found in consumer-based SSD. Finally, there is the quad-level cell (QLC) which stores four bit of data. This is the cheapest memory cell but also the least durable.
Regardless of the memory cell types, they are typically arranged in a grid formation for density and cost reasons. Within that formation, the most basic unit is a page, which is a row of memory cells. Each page can contain a specified amount of data, which could be anywhere from 2KB to 8KB. This is up to the manufacturers to decide during the design stage. Multiple pages, which can be anywhere between 32 to 256 pages, are linked up to make up a block. The blocks are then wired up to form a plane. Multiple planes, at least two, make up the memory die.
Now that we know how a NAND flash is organised, we will dive in for a look at the floating gate transistor.
Floating Gate Transistor
The floating gate transistor is the main component that make up the memory cell of NAND flash. But first, let us take a look at the parts in a normal transistor and how it is applied to a floating gate transistor to understand how it works.
A transistor is an electronically controlled switch which consists of three parts. Like the switch we find in our homes, a transistor has a similar component to turn it on, albeit via electricity. This component is called the control gate (CG). The part where electricity enters the switch is referred to as the source and the part where electricity exits is referred to as the drain.
And in a floating gate transistor, there is an electrical cage between the CG, source and drain. This is where the electrical charge is stored.
To turn on a normal transistor, a voltage has to be applied to the CG. This allows current to flow from the source to the drain. But when a floating gate is involved, the behaviour is different.
If the floating gate holds a charge, the voltage threshold to open the switch will change. Applying a high enough voltage to the CG, typically above 0.5V, will turn the switch on whereas a voltage lower than that will turn the switch off. And if the floating gate holds no charge, then applying a low voltage to the CG will still turn the switch on, just like in a normal transistor.
Reading and Writing Data
Earlier on, we saw how memory cells are arranged in a grid formation and that there are three parts (source, control gate and drain) for a floating gate transistor. We will now look at the wiring of the transistors to better understand how the NAND flash reads and writes data.
<Click on image to enlarge>
The image above is a simplified diagram of the NAND flash memory layout to help us understand the wiring within a NAND flash.
The control gates of a page are wired together to form the wordline. A NAND string refers to the memory cell column and is formed by connecting the drain of one transistor to the source of another. The sources for first page/row of a block are connected to their respective normal transistors to form the source select line (SSL) which is connected to a common source line. At the other end of the columns, the drains for the last page of transistors are connected to their respective normal transistors to form the ground select line (GSL). The drains of the ground select line are connected to the bit lines.
Now that we understand the wirings of the NAND flash, we can dive into how data are written and read.
To write data, the memory controller has to first identify and select a free valid page. This is because the NAND flash does not allow in-place update of memory cells in a page. Once it finds a valid page, it sends the ‘program’ command, data and the physical address of the page to the flash memory.
Within the flash memory is a row decoder that is connected to the wordlines and source select lines. This decoder handles the actual selection of the page.
For cells that will store “0”, the decoder performs three operations. First, it raises the wordline voltage for the page. Then it turns on the right transistors based on the decoded address on the SSL to let electric current through. Finally, it turns off GSL which ultimately creates a high potential difference between the floating gates and their respective drains. This allows the electrons to enter the floating gates of the selected cells via a quantum process known as Fowler–Nordheim tunnelling (also known as FN Injection).
And for cells that will store “1”, their state must remain the same as before the writing process. To achieve that, transistors on the GSL that correspond to these cells are raised to the voltage of “1” while the SSL transistors that correspond to these cell are turned off. This boosts the voltage potential across the floating gates and prevents electrons from moving across the insulators and into the floating gates.
To read data, the memory controller first identifies the page’s location and sends the command to the flash chip. Then the decoder raises the wordline voltage for whole block to the predefined read voltage (typically above 0.5V) while keeping the wordline voltage of the selected page low (typically below 0.5V). The GSL is also activated. This is to ensure the memory cells in the columns conduct electricity to the bit lines regardless if they store any charge. If the selected cell contains a charge, then the whole column will not let the current through because of the transistor’s higher electrical threshold. And if a cell does not contain a charge, then the low voltage on the CG will still turn on the transistor and let the whole column conduct electricity. At the end of the bit lines are sense amplifiers that detect the currents flowing through. If there is current, then it is a value of “1”. Otherwise, it is a “0”.
With that, we now understand how a SSD works.
In the next and final article of this series, we will make a comparison between the HDD and SSD to determine which is best for your needs.