Computers ðŸ’» use binary

**Binary**is a number system that is base 2.- Typically these values are either 0 (off) or 1 (on)

**Bit**stands for**Binary digit**and is the smallest unit of data computers deal with.

*Quantum computers* deals in *quantum bits* or *qubits*.

Read about Bits on Wikipedia and GCSE Bitsize

A group of 8 **Bits**

Remember there are 8 **Bits** in a **Byte**!

That's right, **255!? ðŸ˜•**

**Tip:**

In C# we can find the value easily:

`Byte.MaxValue`

A byte can be represented in a table.

From right to left, each binary value has a position.

If all values are set to 1 or true.

128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
---|---|---|---|---|---|---|---|

1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |

128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255!

- Remember Binary is base 2?
- Positions in a byte come from the
**2 to the power of ...**

- Positions in a byte come from the

128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
---|---|---|---|---|---|---|---|

2^{7} |
2^{6} |
2^{5} |
2^{4} |
2^{3} |
2^{2} |
2^{1} |
2^{0} |

Fill in the decimal and Binary values on the cards you are given.

- Computers can store colours in 8-bits.
- 8-bits for each primary colour, this is called
**RGB**.

- 8-bits for each primary colour, this is called

Here is a nifty RGB colour calculator on W3Schools.com.

Take some time to explore RGB colours

A byte is not the biggest, the size of data units goes on...

Name | Equals | Bytes |
---|---|---|

Bit | 1 bit | 1/8 |

Nibble | 4 bits | 1/2 |

Byte | 8 bits | 1 |

Kilobyte | 1,024 bytes | 1,024 |

Megabyte | 1,024 kilobytes | 1,048,576 |

Gigabyte | 1,024 megabytes | 1,073,741,824 |

Terrabyte | 1,024 gigabytes | 1,099,511,627,776 |

Petabyte | 1,024 terrabytes | 1,125,899,906,842,624 |

Exabyte | 1,024 petabytes | 1,152,921,504,606,846,976 |

Zettabyte | 1,024 exabytes | 1,180,591,620,717,411,303,424 |

Yottabyte | 1,024 zettabytes | 1,208,925,819,614,629,174,706,176 |

Remember binary is base 2, computers are base 2.

2^{10} = 1024.

But it is okay for you to say 1000 in the exam. ðŸ˜Œ

8 | 4 | 2 | 1 | |
---|---|---|---|---|

0 | 0 | 1 | 1 | |

+ | 1 | 0 | 0 | 0 |

1 | 0 | 1 | 1 |

What is this? **3 + 8 = 11**

8 | 4 | 2 | 1 | |
---|---|---|---|---|

0 | 1 | 1 | 0 | |

+ | 0_{1} |
1_{1} |
1 | 1 |

1 | 1 | 0 | 1 |

What is this? **6 + 7 = 13**

128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 | |
---|---|---|---|---|---|---|---|---|

1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | |

+ | 0_{1} |
0_{1} |
0_{1} |
0_{1} |
0_{1} |
0_{1} |
0_{1} |
1 |

1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |

- What is this?
**255 + 1 = 0??!! ðŸ¤¯**- Remember the maximum of 8-bits is 255.

*Of course most PCs are 64-bit (2 ^{64}), maximum is 18 quintillion (18,446,744,073,709,551,615)*

Windows has a nifty calculator that we can use to do binary maths.

What have we learnt?

**Binary**is a 1 or a 0, Off or On- A
**Bit**is a**Binary digit**, the smallest unit of data.

- A
- A
**Byte**is**8 bits** - There are many
**Data Units**.**Kilobyte**= 1,024 bytes.**Megabyte**= 1,024 kilobytes.- And many more...

Upcoming

0:00 AM

00:00:00

00:00:00