# How binary numbers helps in storing data

The most common method of storing data on any device is to use the binary number system. The word “binary” refers to the two states used in the devices. In the binary number system the digits used are 0 and 1.

The use of only two states is very convenient, because there are various ways to represent just two alternatives. For example, “up” and “down” bumps, North and South magnets, opaque and transparent materials, are all ways to represent the two possible states.

### How Binary is Used to Represent Data

Information stored on everyday devices is stored as a set of binary numbers. The type of information is generally a number, a character, or a unit of information on an image, called a pixel.

### How Decimal Numbers are Converted to Binary Numbers

Numbers can be represented as binary numbers. Here are some examples:

1 is represented as 00000001

2 is represented as 00000010

3 is represented as 00000011

10 is represented as 00001010

127 is represented as 01111111

### How Keyboard Characters are Stored as Binary Numbers

There are several methods available, but the ASCII code set will be used here. The ASCII coding system assigns a number to every character. For example, the letter “A” in upper case has the code 65. The character for the digit “9” is 71. The question mark “?” has the code 63. So in binary representation:

“A” is stored as 01000001

“9” is stored as 01000111, and

“?” is stored as 00111111

### How Images are Stored as Binary Numbers

The smallest unit in an image is called a pixel. Each pixel is given a value represented by three numbers, one for each of red, green and blue. The numbers vary from 0 to 255. As for numbers and characters, an 8-bit sequence gives 256 possible values for each color in the pixel. In the RGB (Red Green Blue) system, pure white is made up from 100% red plus 100% blue plus 100% green.

The code for white is therefore 111111111111111111111111. Pure blue is 100% blue, and 0% of the other colors, and so it has the code 000000000000000011111111.

### Summary of How Binary Numbers are Used to Store Data

The binary number system is the keystone of data storage. All of the main data storage devices used are able to convert the data to be stored into a binary number, whether the data format is numeric, text or graphical. DVDs and CDs use the methods described in How DVDs and CDs Store Data and disk drives use the method described in How Disk Drives Store Data.

## What’s Inside a Hard Disk Drive?

With the continuous growth in the availabilty of digital media, all this information must be stored somewhere. In the majority of personal computers, most files are stored on a hard disk drive.

### What is a Hard Disk Drive?

A hard disk drive is a device used to store digital information. The hard disk was originally developed to store information for computer systems, but over the past decade or so the applications of hard disks have expanded to include many consumer devices (such as digital audio players and digital cameras). A hard disk is what is known as a non-volatile storage system; that is, the device retains data once the power to the device is removed.

### How a Hard Disk Drive Works

As the platters spin, the magnetic read/write heads can write data by magnetizing minute areas of the magnetic surface and read data by detecting the magnetism of the previously written areas. The arms containing the read/write heads are moved using a voice coil that allows the heads to move over almost the entire surface of the platters. In order to read or write a particular piece of information on the platter, the arm moves to the appropriate position over the platter and waits for the rotation of the platter to bring the requested data under the read/write head. The movement of the arms over the surface of the platters is what makes the clicking noises that can be heard from some types of hard disk.

Data is transmitted to and from the hard disk device by one of several different interface types. They are ATA (also known as IDE, EIDE or PATA), serial ATA (SATA), SCSI, Serial Attached SCSI (SAS) and Fibre Channel. The most common interface used in everyday PCs was ATA, but most modern PCs use the SATA interface. SCSI, SAS and Fibre Channel are normally used in high performance applications such as servers.

### Applications of Hard Disk Drives

In a typical PC application, one or more hard disks are used to store information that is to be retained once the power to the PC is switched off. In most PC applications, the operating system (such as Windows, OSX or Linux) is stored on a hard disk. The PC is instructed to read the operating system from the disk by a boot program stored on a chip on the main circuit board of the computer.

Over the past several decades, the amount of data that can be stored on a hard disk has increased at an exponential rate. Today, a single hard disk drive can hold approximately one terabyte of data. One or more disks can be combined using the appropriate technology into a RAID array (RAID stands for Redundant Array of Inexpensive Disks) to create a single unit of a larger size, greater reliability, or higher performance, or any combination of the three.

### The Future of Computer Storage

In some applications, particularly in the mobile computer and consumer device markets, solid-state disks, based on flash memory, are replacing hard disk drives. These devices, whilst more expensive than current hard disk units have several advantages. They use less power, and as they have no moving parts, data can be accessed much more quickly and they are more reliable.

Whilst other methods of storage are increasing in capacity and reducing in price, it will be a long time, if ever, before they can match the low cost of data storage of a hard disk drive. Therefore, for the foreseeable future, any application that needs to store large amounts of data will utilize hard disk technology.