Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

How data is stored in a memory? | How storage devices store data | how media files are created and stored

How files are created and stored


Image source bindersinc

               Today, the digital devices are effectively ruling this world. There was a day when peoples were used symbols and pictures to Store the data in a visual form to pass it on to the next generation. As the time has been passed the technology improved, and peoples started using different languages, pen-paper, and other mediums to store the data in a written/verbal form.

               Today, the way of storing the data and information has been changed effectively. Today, we use different digital storage devices and tools to store the data in a digital form. As compared to the other storage mediums, the digital data is 1000 times durable and secure. Did you ever ask yourself that how the data is being stored in the memory? how your movie is getting stored in the HDD or any other storage device? Why and how the image quality remains exactly the same after the years of the creation of the original file? If yes, then you'll get the answers to all these questions within a minute.


How the Digital Storage Device Works?

               Today every storage device has some limitations, and one of them is its capacity. Every digital storage device can store a specific amount of data, let's say 4GB USB flash drive can store up to 4GB of data even if the physical size of 4GB USB flash drive is same as 8/16/32 GB USB flash drive.                      
               The storage capacity of every storage device is generally available in a range of the power of 2, for example, USB drives are available in 2, 4, 8, 16GB and above. Storage devices are not available in all possible storage capacities because every digital device can understand only the Binary language (the language of 0's and 1's). Everything in the memory is stored using its equivalent Binary Code. For example, to store a single character in a memory, the Operating System/device driver converts the character into its ASCII (American Standard Code for Information Interchange) value, then convert this ASCII value into the binary code, and then this binary code is stored into the memory.


How the ASCII code is converted into the binary code

               In day to day life, we use the decimal number system, the decimal number system contains 10 symbols (0, 1, 2, 3, 4, 5, 6, 7, 8, 9). We can use this system in the digital system, but we don't use it because it will become a complicated process to handle these 10 symbols at a time, and it will also become a complex process to store and retrieve the data in the memory. In the digital world, every symbol (i.e. 0, 1, 2, etc.) is known as a bit.


Image source researchgate



               We can manufacture the devices which can simultaneously work with any number of bit's, but it is very difficult for us to understand and command the digital devices with a greater number of bits. This is the main reason why we use the binary language to store the data in the memory.
The ASCII code is nothing but the identification number given to each symbol. This number is given in decimal format, which we use in our daily life, and these numbers are given by the ASCII the global organization for standards.


Do You Know?
                  This article is referring to the ASCII standards because it is easy to understand. There is the number of organization and their standards are being used by almost every storage device and operating systems, knowingly or unknowingly we use all these different standards regularly in our daily life.





  
               This ASCII value is converted into the binary format and then it is stored into the memory. To convert the decimal number into the binary format the simple algorithm is used. For example, to store 18(integer number) into the memory we'll first convert the 18 into the binary language. In the binary language, the position of every bit has some weight. This weight is calculated by the formula (bit)*(2^position). (here in binary language, the bit can be either 0 or 1 and the position always starts with zero ('0') and position is counted from Right side to the Left side). To store the value 18, we'll insert 1 in every appropriate location to get value 18. 1 0 0 1 0 is the binary code for the integer value 18. To read or create the binary code we'll use the above formula.

bit (position)
bit (position) = (bit)*(2^position)      
                                                           
1 (4) = (bit)*(2^position) = 1 * 2^4 = 16
0 (3) = (bit)*(2^position) = 0 * 2^3 = 00
0 (2) = (bit)*(2^position) = 0 * 2^2 = 00
1 (1) = (bit)*(2^position) = 1 * 2^1 = 02
0 (0) = (bit)*(2^position) = 1 * 2^0 = 00

               Now add all these values to get an original value (16 + 0 + 0 + 2 + 0 = 18).

               Almost every storage device is available in the range of power of 2 storage capacity.
The main reason for using the power of 2 storage capacity for every storage device is, we use binary language to store the data in the memory. As we know that, each bit in the binary language has its own weight this weight is always available in the range of power of 2.
Storage device always needs to deal with these bits to store and retrieve the data. It is a difficult and complex task to handle the long binary code. To simplify the task of manipulating the binary code, the binary code is grouped as follows.
bit = 1 bit
nibble = 4bit
Byte(B) = 8bits
Kilobyte (KB) = 1024Byte
Megabyte (MB) = 1024KB
Gigabyte (GB) = 1024MB
Terabyte (TB) = 1024GB
and so on...
                  
               It becomes a lot easier to handle the data if the binary code is grouped as per the above standards. Every storage device uses the memory sectors to store the data. If these sectors are designed in the power of 2 pattern Operating System/device driver can easily address the location of the data. Designing the memory device in power of two patterns will help the device to address the data more easily and it will ultimately boost the performance of the memory.

How the media files are created and stored in the memory.


               5 different data types can be stored in the memory, 1: Text (documents) 2: Pictures 3: Audio 4: video 5: Executable programs.
               Among these 5 data types, the simple algorithm is used to store the document/text files in the memory. Every document is a combination of strings, and every string is a combination of characters, Operating system split the document into characters, and find the ASCII equivalent value for each character, then store the equivalent binary code in the memory.

1: How Pictures or images are created and stored.


Image Source livewirenutrition

                Picture or an image is a most popular data type, peoples take a number of pictures every day. Pixels plays an important role in every image, pixels determine the picture quality and the clarity of the image.
               
                Actually, the pixel is the smallest component of the display (We can’t see the pixels with open eyes). Whenever camera clicks the picture, it sets some value to every pixel, so that the correct combination of these pixels forms an exact image which is clicked by the user. Depending on the hardware availability and user settings, the camera specifies and set how many pixels will be used to display the image clearly.

               The dimensions of the image are technically known as the image resolution. The image resolution determines the size and the clarity of the image. For example, HD images have 2048x1536 screen resolution. It means every HD image assigns different shades of color for 2048-pixel columns (width) and 1536-pixel rows (height). Every shade of color has its own ASCII value this value is represented as #FFFFFF (white). The camera generates the ASCII color code for every pixel and then converts it into the binary format. To tell the OS that this file is an image file, and this file has 2048x1536 values representing an image the image file extension is used. (jpeg, png, etc. are popular image file extensions)

 2: How audio files are created and stored:




                                To store the audio/music into the memory, almost the same technique is used which is being used to create and store the image, to create and store the audio file, firstly sound waves are converted into the equivalent digital form (binary code), this is done by ADC (Analog to Digital Converter) which is present in the microphone. Then this binary code is stored into the memory. In analog signal, infinite frequencies are available between any interval of time (consider time in milliseconds). how many numbers of frequencies are converted into the binary format determines the size and quality of the audio clip.






 3: How Video files are created and stored:


               The video is the collection of images and audio. While creating and storing the video, the binary code for each file is stored in such a way that, images and audio files can be accessed simultaneously (to play a video, video player needs to access all the images and audio files at the same time). The quality and the size of the video is determined by the image and the audio quality. FPS (Frames Per Second) determines the picture quality of the video. FPS is nothing but the number of images to be displayed on the screen within a second.

               After storing the data in the memory, file extension plays an important role to help the OS to determine the content of the file and helps to access the file.






@technology Simplifier
#tech
#hardware
#software


This post first appeared on Technology Simplifier, please read the originial post: here

Share the post

How data is stored in a memory? | How storage devices store data | how media files are created and stored

×

Subscribe to Technology Simplifier

Get updates delivered right to your inbox!

Thank you for your subscription

×