Monday, 30 March 2020

Ch 2: Bits & Bytes

Bits & Bytes - Explained:

Any data in computer is stored in memory, which is a physical device. The memory is capable of storing small or large information and stores it temporarily or permanently. For eg., Random Access Memory (RAM), is a volatile memory that stores information for short duration, 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 a type of volatile memory. RAM loses its contents when the computer is switched off or rebooted. Non-volatile memory is a memory that keep its contents saved even when the computer is switched off. EPROM (Erasable Programmable ROM) is an example of non-volatile memory.

All the data and information stored in volatile or non-volatile memory in the computer is measured in terms of bits and bytes. A bit is the smallest unit to measure data stored in memory i.e. a bit is the smallest unit of storage. A byte is made up of 8 bits.

A bit can store either 0 or 1. This implies that the computer understands only 0 or 1 digits. Computers use bit (binary digit) to represent information in digital form. For eg. refer the below table for better understanding:
In above eg., in 1 bit either 0 or 1 can be stored. In 2 bits 00, 01, 10 or 11 are the possible values that can be stored and so on.

A Byte is a combination of 8 bits and hence there are 28-1 (255) possible patterns or values that can be stored in a byte.
Each of this bit can store either 0 or 1. If 0th bit has 1 then 20 = 1, if 0th has 0 & 1st bit has 1 then 21 = 2. Similarly if any 1 bit has value 1 then the value of that byte is 2 raise to bit position. For eg., if 5th bit has 1 then value stored in that byte is 25 = 32. 
So, each bit value can be represented as 
20 = 1, 21 = 2, 22 = 4, 23 = 8, 24 = 16, 25 = 32, 26 = 64 and 27 = 128

A byte can store maximum value of 255 and this can be achieved by adding value of each bit i.e. 1+2+4+8+16+32+64+128 = 255.

So a decimal number is stored in binary number by converting decimal number in the combination of 0's and 1's i.e. binary number.

Now its very important to understand that each character (alphabet, number or any symbol) occupies minimum 1 byte of storage. And every character is represented by a unique ASCII code. For instance, A-Z has ASCII code 65-90 respectively, a-z has ASCII code 97-122 respectively and 0-9 has ASCII code 48-57 respectively. 

This implies to store character 'A' in memory, its ASCII code 65 is converted to its equivalent binary number and then binary number is stored in memory.

Different units of memory are Byte, KiloByte (KB), MegaByte (MB), GigaByte (GB), TeraByte (TB), PetaByte (PB), ExaByte (EB), ZettaByte (ZB), YottaByte (YB).













No comments:

Post a Comment