[00:00] properly understood by software developers is binary numbers. Now I think most people know that computers work on ones and zeros. The CPU in a computer is switches. It isn't just the execution of your code that uses binary, it is the [00:18] Everything is just ones and zeros in a computer. Before we look at how binary represented with the digits 0 to 9. So that's 10 characters in total that we [00:32] use to represent every number from 0 to infinity. You probably remember in school, 0 to 9, your tens, which is 10 to 90, hundreds is 100 to 900 and thousands [00:46] which is thousands to nine thousand, and so on and so forth. The key thing here is then need to move on to the next column. This is what we call the base 10 number system and in fact each column is a power of 10. So units is 10 to the [01:02] power of 0, tens is 10 to the power 1, hundreds is 10 to the power of 2 therefore store in these 4 columns is 9,999. So we have 9 in the units column, [01:15] 9 in the tens column, 9 in the hundreds column and 9 in the one everyone uses because we all have ten fingers. There are however other base number systems that we use. Now imagine instead of ten characters to [01:30] 0 and 1, then that's what we call the binary system. If we go back to our 4 columns in the base 10 number system, each column was a power of ten. In [01:42] power of 2. So the first column on the right is 2 to the power of 0 which is 1, second column is 2 to the power 1 which is 2, third column is 2 to the power 2, which is four and the fourth column is 2 to the power of 3, [01:57] maximum number we could store. So we have 1 + 2 + 4 + 8 which would be 15. If you include having all zeros as well, that would be 16 [02:11] numbers that we can store in this 4 column binary system. Binary numbers can also be used to represent characters in the basic ASCII character set. The first 7 digits of the binary number are used to represent 128 different [02:23] characters. 'A' for example is this, and 'B' is this. An eighth digit is then added to allow for special characters, giving us a total of 256 different characters. It's bases as well. Emails are usually encoded in base64. So unlike binary that uses [02:41] 0 and 1, base64 will use the characters capital A to Z, lowercase A to Z, as well as 0 to 9, '+', '/', and '='. Programmers also use base32 quite a lot as well. The great thing about base32, is it only uses [02:56] capital letters and numbers. So it's great for things like file names and in URLs where we can't use special characters. And of course we can't forget base16 which uses numbers 0 to 9 and letters A to F. And of course base16 is also known as [03:09] hexadecimal, which is most commonly used for colors in CSS. Colors in hexadecimal are for red, second for green and the third for blue. If we look at these two [03:21] characters in a number column in a base16 number system. Tshen the column on the right is going to be 16 to the power of 0 and the column on the left is going to be 16 to the power 1. As we know hexadecimal goes from 0 to F, with F [03:33] being 15. So the highest number we can put in this two column system would be FF. So we have 15 times 16 to the power of 0 which is 15, and then 15 times 16 to [03:46] the power 1 which is 240. Which gives us a total of 255 as the maximum number we 256 different numbers that could be represented by a two character [03:59] hexadecimal number. If we look at this in terms of colors, then FF with the rest zeros would be red. #00FF00 would be green and #0000FF would be blue. Given that we know we can have 256 different values and we've got three [04:14] different sets. That would be 256, times 256, times 256 different combinations. Which gives us the 16.7 million different colors that you can represent with a hexadecimal color range. Now if we come back to our binary numbers, we know [04:28] different sizes that we have on a computer. Each binary number can have two values either zero or one. Now that in a computer is called a bit. So, you might have heard of bits before. There are in fact 8 bits to a byte and then [04:43] there's a thousand bytes to a kilobyte and a thousand kilobytes to a megabyte. Now if you bring this back to programming, a byte is also a data type used in most languages. Now we know that a byte is 8 bits so this is in fact [04:55] an 8 digit binary number. Again, if we treat these as number columns we're going to have 8 columns with the leftmost column representing 2 to the that the maximum value that we get is 255. Of course, in programming we don't [05:10] just use positive numbers all the time we also use negative numbers as well. Now have signed bytes. A signed byte can store negative numbers as well but it can only store numbers in the range of -128 to +127. The reason [05:25] we only have seven bits left to represent the rest of the numbers. In an signed byte, we use the leftmost bit to represent a negative number. So if it's one, it's a negative number, if it's zero it's a positive number. Now signed bytes [05:40] much about that. Essentially, numbers 0 to 127, are represented in the same way we have been doing but for negative numbers it starts from -128 and starts counting up from there. So if you have one on the leftmost bit then that would [05:55] be -128 and then we count up from there until we have all ones which represent -1. There are still 256 different numbers we can represent with the 8 digit binary number but these numbers are going to be from -128 [06:08] to -1, 0 and then 1 to 127. This is just 8 digits but of course the more with it. So an INT typically takes up 32 bits which means it's a 32 digit binary [06:22] number. If it's a signed INT we can store just over 2 billion but if it's an understanding the data type sizes in programming they're also used in bitwise operations. Now in a previous video I talked about how AND and OR in an IF [06:37] use a single ampersand (&) or a single pipe (|) however, this is actually doing a bitwise operation. If you want to learn a bit more about bitwise operators and and hit the notification bell so you don't miss it. Thank you for watching and [06:53] I hope you enjoyed this video.