Hey guys it’s matt welcome back to part three of logical redstone today we’re just going to be talking about representation or in other words how do we store numbers and information in redstone to be more specific representation using number systems so the two number systems we’re going to Talk about is binary and hexadecimal before i go into either of those i want to talk about our normal number system in a little bit more detail that way the translation is easier so decimal is what we use it’s called base 10 i mean i don’t really have to explain it to you If as long as you know how to count you know how this works you can only use the digits zero through nine the only thing i want to point out is that the uh place values are actually always 10 to the something right so the ones place is 10 To the zero like one equals ten to the zero the tens place is ten to the first the hundreds place is ten squared or ten to the second and the thousands place is ten cubed or ten to the three and as you get higher and higher places it just Increases every time 10 4th and 5th 10 to the 6th so yeah you get the idea the orange is the place values here and so when we have the number 123 being inputted into base 10 what you’re actually saying is take three multiply it by one get three Take two multiply it by ten get twenty take one multiply it by a hundred get a hundred and then a hundred plus twenty plus three is my number it’s 123. and you’re probably thinking yeah that’s like super obvious but the truth is binary is just as simple right because binary is Another number system instead of being base 10 binary is just base 2. so we can use a similar diagram to see exactly what’s going on in binary and this is it right here this is our base 2 box and so right at the top it tells us what digits We can use instead of being able to use 0 through 9 which is 10 different digits we can only use 0 and 1 so it’s only 2 different digits and instead of the place values being 10 to the 0 10 to the 1 10 to the 2 The place values are 2 to the zero two to the one two to the two and two to the three and it keeps going on just like the other one so what that means is instead of having a ones place tens place and hundreds place binary just has A ones place two’s place and fourth place and obviously eighths place sixteenths place and so on instead of the place values multiplying by ten every time you move to the left the place values just multiply by two so if we want to know what the number zero one One one is we follow the exact same procedure as base 10. you take the number and you multiply it by its place values and you add up the total and that’s your number so zero one one one well one times one is one one times two is two One times four is four and zero times eight is zero zero plus four plus two plus one is seven which means that zero one one one in binary represents the number seven but who cares right like base ten base two what does it matter what we use in redstone well the main Reason why binary has such a huge advantage is because redstone is already built like binary right because it has two different states it has off and on and so if you think about off being zero and on being one it makes things a lot easier let’s just get a little bit more Practice with actually converting binary decimal because if it’s the first time doing it it’s it’s a little bit weird and it takes a little bit getting used to um so one zero this is just a binary number and the one is in the two’s place And the zero is in the ones place so we have one two and zero ones in other words we just have two plus zero which equals two and so every time you see one zero in binary that literally just means two i think that’s a really good point to Focus on for a second like people always think that like oh like you can can you read binary can you do this with it like it’s not magical it’s just a number system if anyone tells you that they’re that they can like you know read binary text it’s like no You’re reading text that is coded in binary and you have to know what the code is if you actually want to read it binary itself is like i said just a number system oh my god how’s that for a tangent but anyways let’s do uh let’s see the next One so we have one two and one one two plus one is three and so one one in binary is three now we have a big one we have uh no ones no twos no fours but one eight so it’s just eight i’ll draw it out here One zero one we have one four no twos and a one so four plus one is five i’m not going to do these last two on screen but my challenge to you is figure out what they are and the last thing i want to talk about is just a property of Binary like this property actually exists in every single base if you have a if you have a regular number in base 10 and you shift it to the side so for example if you had 7 and then you shifted to the left and made it 70 well What’d you actually do you multiplied it by 10 right so in base 10 every time you shift to the left you multiply by 10 and in base 2 binary if you shift to the left you multiply by 2 and this you can prove it right here We have a 5 in the top row 1 and a 4. if you shift it to the left now we have a 2 and an 8 which is 10. so we went from 5 to 10. and based off that you also know if you shift to the Right you just divide by 2. so we have 8 plus 4 plus 2 here this is 14 and if you move it once to the right it becomes a 4 a two and a one and that’s a seven and this section might seem kind of short but i’m really just saving all the Material for later because in future videos i’m gonna be showing how to do all the cool stuff with binary right addition multiplication division like you know converting between binary and decimal and decimal binary so just wait for that the other type of number system used in redstone is base 16 so base 16 Is hexadecimal and instead of having 10 digits to use you have 16 digits to use so we actually have to introduce six new uh characters and so we have the regular zero through nine which still mean the same thing but then we have a b c d e And f and i like to kind of roughly think of these as uh a being 10 b being 11 and so forth all the way up to f being 15. so let’s look at our place values and just like before we take the base and we raise it To a power so we start with 16 to the zero 16 to the first 16 squared and 16 cubed here we have the number two f three b being inputted into our box and it’s kind of wacky to think about if it’s your first time like seeing letters in a Number i remember being kind of freaked out like what you can do that but yeah i mean like like i said these characters kind of roughly map to like f being 15 b being 11. but anyways let’s just put it into the box and see what Happens so we have 2 goes to 2 f goes to 15 3 and 11 and then we follow our rules so 11 times the ones place is 11. 3 times the 16th place is forty-eight fifteen is in the 256th place which gives that and two is in the four thousand ninety-sixth Place which gives eight thousand one hundred ninety-two you add these all up and you get twelve thousand and ninety one so two f three b in hexadecimal actually means twelve thousand and ninety one so why would you use hexadecimal in redstone i thought you literally just Said that redstone is made as a binary well it is made as a binary if you treat all odds as the same because actually we have 16 different types of states right we have signal strength so you can store hexadecimal digits as just packets of signal string And so if i want to type something in here we can type in 1 you know 2 3 and it still shows up as 123. you just have to look at it a little bit differently this is represented as a one because the first One coming out is a one this is a two because the first strength coming out is a two and this is a three and you can even input other things as well including the letters because again we have 16 different types of states so let’s go all the way down here let’s do Like f d e right 16 i’m sorry 15 13 14. so this number right here in hexadecimal is f d e and the cool thing about hexadecimal is it’s actually way more compact because instead of using redstone to only store two different values we’re using redstone to store 16 different Values in one single piece of redstone which is like amazing and comparators also have some useful features that make doing addition subtraction stuff like that really simple like for example this is a hexadecimal subtractor i mean it doesn’t work for uh negative numbers but since comparators already have a subtract mode on them Like look how simple this thing is it’s just a comparator with a comparator into its side so if you do this and this we have 13 minus 10 and it gives 3. like that’s it so that’s all i got like i said i’m saving a lot of cool Information for later videos but this is just to get used to binary and hexadecimal if you’ve never seen it before i hope it was useful i hope you learned something and i’ll see you next time Video Information
This video, titled ‘Binary & Hexadecimal | Logical Redstone #3’, was uploaded by mattbatwings on 2021-10-24 02:53:18. It has garnered 71573 views and 3521 likes. The duration of the video is 00:10:01 or 601 seconds.
!!! Check out the NEW AND IMPROVED logical redstone series here! https://youtube.com/playlist?list=PL5LiOvrbVo8keeEWRZVaHfprU4zQTCsV4 !!!
In this episode, I go over the two main forms of number representation in redstone: binary and hexadecimal, and how they relate to normal decimal numbers.
Patreon: https://www.patreon.com/mattbatwings Discord: https://discord.gg/V5KFaF63mV My socials: https://linktr.ee/mattbatwings My texture pack: https://github.com/Xyverle/MattPack
————————-
Want to get more involved in the logical redstone community? Learn Logical Redstone! https://youtube.com/playlist?list=PL5LiOvrbVo8keeEWRZVaHfprU4zQTCsV4 Open Redstone Engineers (ORE): https://openredstone.org/
0:00 Welcome to Episode 3! 0:16 Decimal Recap – Base 10 1:44 Binary – Base 2 6:09 Hexadecimal – Base 16 9:40 Subscribe!
Music: https://youtu.be/mWebB6zby6Y