What is a bit?
Tags: computerscience, beginners, architecture, programming
Published: 2021-09-27 16:47:00

All over Computer science, whomever you talk with, they keep saying about data.

+ To store Data.
+ Compute Data.
+ Send/Request Data over Network.
+ Predictions on Data.
+ Represent Data.

The fundamental unit of this data is called a bit(__B__ inary dig __IT__ ). 

The State of Bit is always binary which means it can represent two values 0 or 1, true or false, charge presence or charge absence.

Observe the gif once and start assuming there will be some kind of boxes in a computer that stores each bit.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/258b8pa9scj0mzuzlvl9.gif)

***

## __📢 Let's ask Ourself few interesting questions__

1. I have understood there will be some kind of box that stores the current charge but what is this made of?
2. Why that box use Binary System instead of others like decimal or Hexa?
3. What are the different memory units?

## __1. What is this Bit made of ?__

A Bit is an electric circuit with transistors and capacitors arranged in a specific way. 

#### _Transistors are switches, but a special kind of Transistors called MOSFETS are used in volatile memories (SSD, HDD) and MOSFETS combined capacitors are used in RAM._ 

We will discuss the above concepts in detail across this series, Which will give you a clear picture of the inner workings of the Integrated circuit and memory architectures.

> __Topics to learn__
> + Memory cell architecture
> + Volatile and Non-Volatile Memories.
> + NAND flash vs NOR Flash
> + Gates

## __2. Why Binary ?__

### Introduction to Number systems 🧮

We, Humans, are very much fond of the decimal system and important question is we never know how we used to it. Instead of long history, just think we used to it because of Egyptian and [indus-valley](https://medium.com/@rahulyadavca/indian-mathematics-mathematics-in-indus-valley-civilization-harappa-civilization-4d1ef95cb674) civilizations. 
 
In the decimal (base-10) numbering system, the digits are the elements of the set {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}.

Eg: 1024.8 - {4 is one's digit, 2 is at __ten's__ digit,0 is in hundreds digit and, 1 is at thousands digit,8 is at __tenths__ digit}

In the binary number system, the digits are the elements of the set {0, 1}. This system is used by computers because the two digits can represent the logic low and high states. The term "binary digit" is compressed to " bit " in computer parlance. 

Eg: 1,0,11,00,10,01

![Computer Scientists](https://dev-to-uploads.s3.amazonaws.com/i/1kz0mkksise2q8dj1iqu.jpg)

There was a time when computer scientists have to choose a number system and opt for a binary system because of vast study on those systems by above great personalities(__[George Bool](https://www.youtube.com/watch?v=Hljir_TyTEw) and [Leibniz](https://www.youtube.com/watch?v=6eWkAOiPk6g)__) and also due to the limitations in electronics at that point of time.  

## __3. Different memory units.__

Now we can use the above acquired knowledge to build bytes, MegaBytes, GigaBytes and so on.

| Storage        | Unit       | Possible No of states         |
| -------------- |:----------:|:-----------------------------:|
| 1 memory unit  | 1 bit      |<span>2<sup>1</sup>            |
| 4b             | 1 Nibble   |<span>2<sup>4</sup>            |
| 8b             | 1 Byte     |<span>2<sup>8</sup>            |
| 1024B          | 1 KiloByte |<span>2<sup>8192</sup>          |
| 1024KB         | 1 MegaByte |<span>2<sup>8388608</sup>         |
| 1024MB         | 1 GigaByte |<span>2<sup>8589934592</sup>        |
| 1024GB         | 1 TeraByte |<span>2<sup>8796093022208</sup>       |
| 1024TB         | 1 PetaByte |<span>2<sup>9007199254740992</sup>            |
| 1024PB         | 1 ExaByte  |<span>2<sup>9223372036854776000</sup>      |
| 1024EB         | 1 ZettaByte|<span>2<sup>9.44473296573929e+21</sup> |
| 1024ZB         | 1 YottaByte|<span>2<sup>9.671406556917033e+24</sup>  |
| 1024YB         | 1 BrontoByte|<span>2<sup>Huge number</sup>            |
| 1024BB         | 1 GeopByte |<span>2<sup>Even Huge number</sup>            |


> __Note:__ 
> There is a difference in representing bit(__b__) and Byte(__B__)
> whenever your network provider says your download speed is 80Mbps.
> _it doesn't mean 80 MegaBytes per second, it means 80 Megabits per second that counts to 10 MBps._ 
> That's how they fool Hard earning people.🤐


## References
* [What exactly is one digital bit ?](https://medium.com/coderscorner/what-exactly-is-in-a-1-bit-of-digital-memory-d5395f9001a6)
* [Memory cell](https://en.wikipedia.org/wiki/Memory_cell_(computing))