You now do binary back to front, and some of you may be dreaming of making a binary clock. We will work through the details of two more basis, base 8 and 16. I would like you to focus on generalizing these examples onto working with any other base. I mean, I want you to think about how you use base 3, base 4, base 67, any base. So follow these examples and make your own notes, and form your own theory of how to write numbers and perform arithmetic in any other base. Base eight is also called octal from the Greek word for eight. There are eight digits and these are 0, 1, 2, 3, 4, 5, 6, and 7. But where are the place values? I mean, say the first three place values. You can answer that in the in-video quiz. The octal number 123 which I will write 123 with little eight for avoidance of doubt. This is the subscript which means that it's written in bakes eight. This number uses three place values worth one, eight, and 64. As we start with the place value one on the right and multiply by eight to get to the next place value to the left. The place values are consecutive powers of eight starting from one. The digit three is for units. The digit two is for eight, and the digit one is for 64s. We use this to write the expanded form, 1 times 64, plus 2 times 8, plus 3 times 1, which gives 64 plus 16 plus 3, and totals 83. That means that 123 in octal is written as 83 in decimal. The number 7701 in octal uses four place values worth 1, 8, 64, 512. The first four powers of eight. The leftmost seven is on the position for eight cubed so 512. The next seven on the 64s, the zero on the eights, and the one on the ones. Giving the expanded form, 7 times 8 cubed plus 7 times 8 squared, plus 0 times 8, plus 1 times 1, which equals 7 times 512, plus 7 times 64, plus 0 times 8, plus 1 times 1, which equals 3,584, plus 448, plus 0, plus 1, totaling 4,033. So we write 7,701 in octal is 4,033 in decimal. Let's get going with another base, base 16 or hexadecimal. Let's work out the place values. The place values go up by a factor of 16 every time. So we write numbers with place values running from right to left starting at one, then 16, then 256 which is 16 squared, then 4,096 which is 16 cubed. Then 65,536 which is 16 to the power of four but also 256 squared and so on. In the in-video quiz, I asked you to relate powers of two, powers of eight, and powers of 16. Later, we will see why this is important. With base 16, we need 16 digits. That's great. We can go 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, but we can't go 10, 11, 12, 13, 14, 15. Well, we can like the Babylonians did but that'll be very confusing. You know, what does 1115 mean? Does it mean 1, 1, 5 really, or 1, 11, 5, or 11, 15 or something else. To remove this ambiguity we use symbols A B C D E F to stand for the numbers 10, 11, 12, 13, 14, 15 respectively. So 1115 is BF in hexadecimal and 1, 1, 15 is 11F. Let's look at the value of these numbers. You know how it goes. We have to note down the place values. Follow me on this one. We write the place values and write the number in the expanded form. So BF equals 11 for B times 16, plus 15 for F times 1, and that gives 176 plus 15 which totals 191. As to 11F, that is 1 times 16 squared plus 1 times 16 plus 15 times one, which equals 256 plus 16 plus 15 and totals 287. Very different numbers. Let's see all of this in action with two examples. Let's write the number 179, that's a decimal number, let's write this into octal. We're going to use the division algorithm. We're going to divide by eight over and over again and taking note of the remainders, and those will be the digits of the number in octal. So on our calculator, 179 divide by 8, that is 22. A hundred and seventy nine divide by 8, that is 22 integer part. Let's work out the remainder. So we take the 22 times by the base which is eight, we got a 176 that taken away from a 179 leaves remainder three. Now we divide 22 by 8, 22 divided by 8. We got two and the remainder will be 2 times 8 which is 16, 16 to 22 is 6. Now we divide 2 by 8 which is zero remainder two. The first remainder is the rightmost digits, so the number is 263 in octal. We could instead of using the division algorithm match the powers of eight which is really essentially what we've done here, but let's look how that seems. You would write the powers of eight one, 8 times 8 64, and the next one 64 times 8, the 512, 512 is too large for a 179 so we don't need it. Now we would write a 179 as multiples of these powers and then add them all up. So how many 64's go into a 179? Well, 179 divide by 64. That is two 64s and let's see how much is left now. So 64 times two is a 128, we do a 179 takeaway that a 128. We've got one, we've got five. So we got 51 left. We need to make 51 out of eight, how many eights? Well, we got now 51 divide by 8. That's integer part 6, 6 times 8, 48. So we got 51 takeaway the 48 and we are left with three, and so three ones make the rest of the number. Of course, we get the same result as we got using the other method, and we're essentially doing divisions by eight, but in this case we're doing divisions by 64, and then by eight, and then by one. Let's now look at an example in hexadecimal. We're going to write the same number a 179 in hexadecimal. Hexadecimal is base 16, so we're going to divide by 16 over and over again. We're going to do a 179 divide by 16, and it does speed up stuff if we use the calculator. Divide by 16, and that is 11 and let's work out the remainder. We do 16 times 11 which is actually a 176 you should know that, 176. So 179 minus 176 is remainder three, and now we do 11 divided by 16 which is zero remainder 11. So the remainders have to be up to 16 but never 16. Right. So here's our digits. So if we don't remember what is A, B, and C, nine is the last numerical digit, A is 10, B is 11, C is 12 and so on. Well, this is going to be a B and this is a three. So our number, remember the first remainder is the rightmost digit. So we have B3 in hexadecimal. Let's also look at how we could do this with approximating by powers of 16. In this case, it's very very close to what we did. We start with one, 16, 16 squared is 256, and we make a 179 is on these numbers. Two hundred and fifty six is too large, we're not going to need. So the question is how many 16s fits into a 179? Well, we would do a 179 divided by 16 which we've done for the previous calculations, so it's going to be 11 16s, and then we have remainder three. So 11 16s, 16 times 11, 176 so we go remainder three, and that three is made of three ones. So like we did before this is a B, that's a three, so a 179 is B3 in hexadecimal. You have now all the tools to work in any number base. We just looked at the place values for octal and hexadecimal, and we can translate between these bases and decimal. Octal uses eight digits from zero to seven, and hexadecimal requires 16 digits. So we use all the digits 0-9 followed by letters A to F to mean the values from 10-15. Next, we will look at fractional numbers. Have a think of what the place values should be for fractional numbers written in octal and hexadecimal. To fully appreciate the upcoming videos, start extending the algorithms for operations in binary into these new basis. I asked you to think about steganography, I haven't forgotten that.