Introduction: Redstone Addition Calculator in Minectaft
Hi! I'm TheQubit and this is a tutorial on my redstone addition calculator in Minecraft. Cool, right? It uses some sweet redstone engineering and logic.If you like this project please vote for me in the Minectaft challenge. I'd really appreciate that. Well, let's get into it then...
Step 1: Basics of Binary
First of all this calculator works with binary addition, so first of all we need to make sure you understand it. Binary is a code made up of zeroes and ones.With this calculator we are going to work with 4 digits when encoding the inputs as it is a 4 bit calculator. The reason we use binary in the first place is because at is a language the adders understand (more on that later). A one means that the redstone is on and a zero means it's off.The first digit in binary stands for one, the second for two, the third for four and it doubles every time.Since it's a one digit calculator the highest number you can input will be a nine, for wich the code is 1001 in other words on off off on. This is because the fourth digit is 8, the fist one is 1 so 1 plus 8 is equal to 9.Here are the codes for each(one digit) number:
1= 1000 5=1010
3= 1100 6= 0110
2=0100 7= 1110
4= 0010 8= 0001
Step 2: Making the Encoder.
Now let's look at where we start . First you need to design and make a keyboard with a button for each number (0-9). Next connect each to a redstone line, invert them (see picture 1) and get all the lines next to each other with a one block space between them. You have now started making the encoder, which turns the input numbers to binary. (Make sure you have at least 9 blocks in length where they are all next to each other on the same level. Now run 4 redstone lines in the opposite direction over these lines , also with spaces between them.(There should be a 2 block space between the bottom ad top lines. You can think of the top 4 lines as the 4 digits of binary(remember that on is a one and off is a zero)Now, according to the codes in the fist step, place one block with a redstone torch on it below the top lines. Now, whenever you input a number, the torches will turn the top redstone lines on in the order of the code e.g. when you input a five, the top lines should be activated in the order 1010 or on, off, on, off.(Also see picture.)If the code has more than one ones then place a repeater just in front of the block with the torch, so that the signal can go trough to the rest of the torches.
Step 3: Adders
Now let's look at the adders. These are the components that do the calculations. First run split all the binary lines in two( one side is fore before the sum token and one for after)and insert transistors(see image 2 and 3) into the now splitted lines. Connect all of the transistors that go to the same side of their splitted side together and the same for the other side. Remember that if your redstone signal gets too weak you can boost it with a repeater. When you're done with this you can make a memory switch (see image 1) for every single one of the lines and invert them. Now do exactly the same transistor thing after the memory switches as before.Place blocks, redstone torches and redstone as shown in images 3, 4 and 5. Create multiple of these and connect them together as shown.(note that the 7th image is the other side of the 9th one.) Also note that the bottom of the "x" are the inputs and every one has two. This is why we split the lines, so there is one for each input.If you still do not know exactly how the adders are supposed to be, the are plenty of online tutorials(search for "minecraft redstone adders") note that the "x" things are the adders themselves.
*Here is a detailed explanation of the transistors: replace one piece of redstone in the main line with a repeater and remove the piece of redstone in front of it. Directly under the block of which you just removed the redstone, place a piston facing upwards. You will see that only when the piston raises the block will the signal be put through.
You will note that each adder carries out to the next one if it receives double its value. You wil have to use the last one's carry out as one of it's outputs as the answer can now be bigger than 9. You will now also count it as a binary digit so you should have 5 digits.
Step 4: Decoding Your Total (your Answer)
So now your adders had calculated the answer, but it is still in the firm of a binary code. But that is not a problem, because now I'm gonna tell you how to decode it. You just need a decoder (well...obviously). It is very similar to the encoder, only you raise a block every second block and between every second one you place a repeater. (Or just between every single one) but instead of placing a redstone torch on each raised block, you only do so if this line should be on (1) for the number you are decoding with that row. (Note that you will end up with 19 output lines since the biggest sum's answer will be 18. (Which is 9+9) so you will decode answers from 0 to 18.
But what about the rest of the raised blocks? Well, all you have to do is inverting it twice by placing a redstone torch on the side of that 4ais3d block, placing a block directly above that torch and then placing a torch on the side of that one (opposite side of the other torch. If you don't seem to understand see images 3 and 4 )
Image 2 is when it's on by default and 3 and 4 are when it's off by default.
Image 1 is an example of how two numbers would look next to each other.(But of course you will not stop at two, but go all the way to 18.
Here are the rest of the codes for the other numbers.
Step 5: Final Processing
Hopefully you placed your decoded lines in a specific order, because now is the time to translate that answer into a physical number. First you need to create a display or screen. This should be 11 blocks high and 13 blocks wide. This can be made with a block of your choice. Note that I used a more complex screen in my calculator.
Anyways, the next step is to place pistons at the back(facing towards the diplay) in the shape of a real calculator's digits with three pistons in a row per "stripe" If this is done correctly it should appear to be an eight at the back. Now connect each line's pistons together separately and run a wire for each of the lines alongside each other. Do the same on the second digit. If you did this right, then each redstone wire coming from the display should individually control a line on it. So if you activate all of the wires it should push out blocks in the shape of an eight. Run them further alongside each other and then connect the decoded outputs in the previous step in the following way:
Run them over the display inputs in the opposite direction, just above the redstone. Now place redstone torches on the sides according to how the number looks. In other words you place torches above all the wires of a single digit to get an eight(which is just an example)this would obviously be at the line where we decoded 8. Do the same for each number but just with the wires that activate the required lines on the display to form that specific number (physically on the display).
Step 6: Last Touches to Make It Interactive
Now everything is done except the function buttons. This calculator will require 3 function buttons(one for plus, one for =, and one to reset or clear the calculator. So of course the first thing to do is to add 3 more buttons to your keyboard and do the following for each one:
For the plus button, run a wire directly from the button to a memory switch. Then connect the one set of transistors to the one side of the switch and the other set to the other side. (These "sets" are the pistons you grouped together)
For the "=" , you also connect it directly to a memory switch. Then connect the same side of the switch to both sets of pistons, but make sure to use repeaters to prevent the redstone charges from going back into the rest of the circuit.
Now you're all set! You should be able to add any two numbers from 0 to 9 and get the right answer pushed out on the display. Thanks!