As a developer with a computer science degree, I of course knew about two's compliment; but I never stopped to wonder *why* the conversion algorithm of "invert + 1" works. When you showed the algebraic connection to modular arithmetic, my mind was blown. Thank you for the education! 🙂
I never thought about it, but as soon as he said people would wonder, I automatically assumed that N bits go up to a value of 2^N-1. Inverting means +1.
I don't even like minecraft. I'm a computer scientist and these videos are a really entertaining way of relearning what I already know in a new environment. Great work!
I always liked this way of seeing two's complement because it's the one that makes the more sense to me. Since a single bit's value is exactly the sum of all previous bits + 1, making it negative forces the final value to fall in negative space (-1 being the smallest absolute value). This also automatically invert the order in which the absolute value increments/decrements which then creates the emergence of all the other advantages listed in the video :)
CS student here; great videos. It was by sheer chance I happened to watch one of these before my first class on low level computing, and now I always hear my professor talking about the things you do here. Really well done.
I've been putting off learning redstone since i was a kid, this series is the only time it's ever made sense lmao. I got a better understanding of binary from this series than any of my classes in college.
It's kinda weird to me that you learned two's complement using modular arithmetic before learning the negating most significant bit trick. I learned it other way around and, honestly, your way is probably better, because knowing math behind why it works is better than just blindly use the trick.
Learnt about Two’s complement in GCSE, they never explained why it worked or anything, love this video for that, I finally understand where it comes from! Thank you!
This series is incredible! Recently decided I wanted to learn redstone in its entirely, and although this focuses more on redstone logic instead of the whackier items like pistons, skulk, and observers. I really feel like this is foundational knowledge that I'll be able to take advantage of in future projects and learnings. Absolutely amazing work, my man, thank you.
It's hard for me to process this, but it's good. Love that you show how it works on practice so it was A LOT easier to understand. Hope to see more of this.
I'm trying to create subtractor circuits in a logic gates IDE from 2 bits to 4 bits. You really are helping me out! Since this IDE does not support constant input (0, 1), I have to try and simplify as best as I can 😅. Thank you for helping me out, I really appreciate it.
I would really love it if you would do one video for multiplication and one for division. I know that you already covered those two but it would perfectly fit into your new series of tutorials. I really love this series! I am a CS student and I have been following redstone stuff for ages now, so I do find it easy to follow the technical stuff but I am not good with compact designs hence I appreciate this channel so much! Maybe I should try build a redstone computer again when I got time. Thank you and keep going with your amazing work! :D
a good way to think about two's complement is to consider the last bit to represent the negative of what it does for the regular binary. For example, with four bits 1011 would be -8 + 2 + 1 which is -5, and inverting and adding 1 gives 0101 which is 4 + 1 = 5. Edit: Oh, it's already in the video
Ive been waiting for this one. Ive been trying to make a calculator on bedrock then noticed your binary episode, knew youd cover subtraction eventually
👏👏👏 Я сделал механизм который может как складывать так и вычитать два отрицательных числа. Чтобы тебе сделать такой нужно: 1)к механизму сложения добавить еще один; 2)добавить инверсию к входу сигнала с двух сторон (у тебя в видео с одной стороны); 3)соединить инверсии с сумматором с помощью логического элемента "или"; 4)соединить инверсии логическим элементом "и"; 5)соединить этот логический элемент с вторым сумматором ко второй платформе. Если что-то не понятно спроси меня об этом.
I remember first learning this in a computer architecture class. The things you can do with 2's complement... it's awesome. Also, abusing that overflow to do a comparison is nice - literally just need to check one bit (though equality still requires more). Also props for not calling -7 + -7 = 2 an underflow. Still overflow 👍
when making the toggleable adder/subtractor an easier way to do it is just have the toggle lever run power into the side of all the redstone torches making them toggle the inversion.
There is sign bit and bits for the number, and if both of sign bits are 1, which represent nagative, dont invert the numbers and normaly add and nagate the output.
When I was connecting the subtracter to my adder to would always not want to make the first two ones to a zero it took me around 30 minutes to figure out that I had the comparator was not in subtract mode for the first light. It was so annoying lol
8:55 Also, if you are more focused on the results than the math behind it, you can think of the +1 as avoiding having -0 and thus having to increment twice to get past 0 (-1 -> -0 -> +0 -> +1). It's not an actual proof, but I think it can be helpful to remember. (Edit: this also causes problems in 1's complement)
Additionally, it's worth pointing out some terminology here for values to make things clearer: in 13 \equiv 1 (mod 12), 1 is called the residue. The residue is the value that is the result of computing the remainder of a congruence, in this case the congruence 13 \equiv 1 (mod 12), per Wolfram MathWorld (amazing "encyclopedia"; go check it out!). Also don't worry about what \equiv here is. It's the name for the congruence symbol in LaTeX which lets you render mathematical notation so that it's neat and readable the same way we can text with a keyboard.
A good way to invert it is have a switch that you can turn on and off to do 1(invert) 0(normal) and connect it to an xor gate and if I have the switch on 1 and the input as 1 it will output 0 and if I input zero as the input then it will become 1 Here’s the truth table Input | Output 0 0| 0 1 0| 1 0 1| 1 1 1| 0 As you can see this is the exact truth table of an xor gate
Im a very novice redstoner and love following your awesome videos! I was wondering, at 2:07, couldn't you overcome the issue if you put the sign value (1 for negative and 0 for positive) at the end
I was powering thru untili hit this video.... This is the third day i' m stuck on this video. This was just a hard concept to comprehend, for now i know enough to move on i feel.
9:43 it's cool to think also that in 4 bits the leftest bit is equivalent to -8 instead of 8 so 1011 = 1 * (-8) + 0 * 4 + 1 * 2 + 1 * 1 = -5 ok lol you talk about this later in the video
i learned alot, but i have a question because i'm from spain and don't understand english so well. What X means? (in the explanation part). And another thing that i wanted to ask is, how do you aply the formula for detecting the overflow?
its interesting that when doing the example -7-7 in binary the anwser is +2 which added to the opposite of the real anwser is 16 this also works with numbers i think 1010=-6 1000=-8 =0010=2 in decimal -6-8 would be -14 so it always adds up to 16 which is cool i guess or maybe im just an idiot i paused to write this and idk if he talks about it after its just an intresting thought
Now I understand why you always put a SEC (set carry) instruction before a SBC (subtract w/ carry) instruction. Doesn't have anything to do with redstone but it's educational nonetheless.
Hi! Do you have a degree in computer engineering or in computer science? Because by looking at your insane builds it looks like that you have a lot of knowledge about computers
Umm I made this circuit called half subtractive and what it does is subtract two one-bit numbers It is rlly similar to a half adder but I added a not gate to plug B in