Computer Notes- BASIC DATA STRUCTURES

The computer data is made up of certain components basically called 'bits' and 'bytes'.

Bit: A bit (sometimes abbreviated as b) is the most basic information unit used in computing and information theory. A single bit is a one or a zero, a true or a false, a 'flag' which is 'on' or 'off' or in general, the quantity of information required to distinguish two mutually exclusive states from each other.


Byte: A byte is a collection of bits variable in size but now almost always eight bits. Eight -bit bytes, also known as octets, can represent 256 values (2^8 values, 0-255).

Kilobyte: It is a unit of information or computer storage equal to 1024 bytes. It is commonly abbreviated as KB, kB, Kbyte or kbyte. The term 'kilobyte' was first loosely used for a value of 1024 bytes (2^10), because 2^10 is roughly one thousand and powers of two are convenient for use with binary digital computers.

Megabyte A megabyte is a unit of information or computer storage equal to approximately one million bytes. It is commonly abbreviated as MB. One Megabyte (MB) = 2^20 bytes = 1024 kilobytes

Gigabyte A gigabyte is a unit of information or computer storage equal to approximately one billion bytes. It is commonly abbreviated as GB in writing and gig in writing or speech. One Gigabyte (GB) = 2^30 bytes = 1024 megabytes

Terabyte A terabyte is a unit of information or computer storage equal to approximately one trillion bytes. It is commonly abbreviated as TB. One Terabyte (TB) = 2^40 bytes = 1024 gigabytes

Note (1) After terabytes, the counting doesn't stop there. It continues in following ways
 One Petabyte (PB) = 2^50 bytes = 1024 Terabytes
 One Exabyte (EB) = 2^60 bytes = 1024 Petabytes
 One Zettabyte (ZB) = 2^70 bytes = 1024 Exabytes
 One Yottabyte (YB) = 2^80 bytes = 1024 Zettabytes

Unit                Size                       Description
Bit- One binary digit -Stores either a binary 0 or 1
Byte- Eight bits- One character
Word- 16 to 64 bits- One character
Kilobyte (KB)- 1 thousand bytes- About one page of double-spaced text
Megabyte (MB)- 1 million bytes- About the size of a short book
Gigabyte (GB)- 1 billion bytes- 1000 short books
Terabyte (TB)- 1 trillion bytes- An entire library
Petabyte (PB)- 1 quadrillion bytes- Just about all the libraries in the US

Relation between Decimal, Binary, Octal and Hexadecimal 

Decimal     Binary       Octal       Hexadecimal
0                  0                  0             0
1                  1                  1             1
2                  10                2             2
3                  11                3             3
4                  100              4             4
5                  101              5             5
6                  110              6             6
7                  111              7             7
8                  1000           10            8
9                  1001            11           9
10                1010            12           A
11                1011            13           B
12                1100            14           C
13                1101            15           D
14                1110            16           E
15                 1111            17          F


The computer data is made up of certain components basically called 'bits' and 'bytes'.

Bit: A bit (sometimes abbreviated as b) is the most basic information unit used in computing and information theory. A single bit is a one or a zero, a true or a false, a 'flag' which is 'on' or 'off' or in general, the quantity of information required to distinguish two mutually exclusive states from each other.


Byte: A byte is a collection of bits variable in size but now almost always eight bits. Eight -bit bytes, also known as octets, can represent 256 values (2^8 values, 0-255).

Kilobyte: It is a unit of information or computer storage equal to 1024 bytes. It is commonly abbreviated as KB, kB, Kbyte or kbyte. The term 'kilobyte' was first loosely used for a value of 1024 bytes (2^10), because 2^10 is roughly one thousand and powers of two are convenient for use with binary digital computers.

Megabyte A megabyte is a unit of information or computer storage equal to approximately one million bytes. It is commonly abbreviated as MB. One Megabyte (MB) = 2^20 bytes = 1024 kilobytes

Gigabyte A gigabyte is a unit of information or computer storage equal to approximately one billion bytes. It is commonly abbreviated as GB in writing and gig in writing or speech. One Gigabyte (GB) = 2^30 bytes = 1024 megabytes

Terabyte A terabyte is a unit of information or computer storage equal to approximately one trillion bytes. It is commonly abbreviated as TB. One Terabyte (TB) = 2^40 bytes = 1024 gigabytes

Note (1) After terabytes, the counting doesn't stop there. It continues in following ways
 One Petabyte (PB) = 2^50 bytes = 1024 Terabytes
 One Exabyte (EB) = 2^60 bytes = 1024 Petabytes
 One Zettabyte (ZB) = 2^70 bytes = 1024 Exabytes
 One Yottabyte (YB) = 2^80 bytes = 1024 Zettabytes

Unit                Size                       Description
Bit- One binary digit -Stores either a binary 0 or 1
Byte- Eight bits- One character
Word- 16 to 64 bits- One character
Kilobyte (KB)- 1 thousand bytes- About one page of double-spaced text
Megabyte (MB)- 1 million bytes- About the size of a short book
Gigabyte (GB)- 1 billion bytes- 1000 short books
Terabyte (TB)- 1 trillion bytes- An entire library
Petabyte (PB)- 1 quadrillion bytes- Just about all the libraries in the US

Relation between Decimal, Binary, Octal and Hexadecimal 

Decimal     Binary       Octal       Hexadecimal
0                  0                  0             0
1                  1                  1             1
2                  10                2             2
3                  11                3             3
4                  100              4             4
5                  101              5             5
6                  110              6             6
7                  111              7             7
8                  1000           10            8
9                  1001            11           9
10                1010            12           A
11                1011            13           B
12                1100            14           C
13                1101            15           D
14                1110            16           E
15                 1111            17          F