1. AND gates are a lie! Minecraft only allows for OR gates (just connecting wires) and NOT gates (a torch on a powered block). Yes you can make an AND gate, but it is really three NOT gates and 1 OR gate. Both signals are inverted, then combined, then that is inverted again. This means if you ever build a standard AND gate you have almost always failed. In terms of most efficient design.
2. Build in 3d. Wiring in minecraft is BULKY, building up (or down) can save a lot of space over laying everything out flat. Also, almost every torch can be 'tapped' by putting a block over it, and a wire on top of that. This can be cleverly used if you know when a torch is carrying the same signal you need for some other gate.
II: My Full Adder
Note: I am not going to teach how an adder works.
First step, were going to need a design. I tried to make an efficient 3-input XOR gate, it is very hard, so I ended up using this design which worked out great.
Second step, need an XOR gate, and we want it to be small. This is the best one I think. You can see one input on the back right into that torch on top of the block, the other input goes into the mirror torch.
Now this is where things get clever. Looking at the full-adder, you may notice the same inputs go through an XOR and a AND gate. This happens twice. What we can do is combine these gates, so that putting in A and B gives you the XOR of A and B, as well as the AND of A and B.
If the above picture is confusing you, remember what an AND gate really is. The XOR gate first inverts both signals, so what I did was tap into the inverted signals above it. Then all I had to do was run the wires together, and invert it once more.
If your issue is the picture, note the last inversion for the AND gate on top is mostly hidden behind the block, but you can see the top of the torch as well as the wire with reversed power.
Okay, so we have this 'double-gate' block. All you have to do is build it one more time to get you second XOR and your second AND gate. Look at the full-adder schematic. Let's pretend your first XOR/AND block handles A and B. That output must be XORed and ANDed with your carry input. Again, the same two inputs into the same two gates!
That is it! I am would be very impressed if someone made a smaller full-adder. Adding these in series makes a ripple adder, you could also add the elements to allow it to subtract. Below you can see the two bit adder I put together along with a poorly designed output screen I used to test. Clever engineering can use the interesting quirks of implementing logic gates in minecraft, and keep these circuits from needing to be entire maps.
I knew a little bit of a challenge would get someone to post a smaller design :smile.gif: Howling monkeys is crazy, I will have to build it myself to have any hope of understanding it.
It's not as efficient (at least, my first successful attempt at it isn't) in terms of materials, speed, or overall volume, but you can make a 2-wide full adder using repeaters. I spent a couple days working on it as my first redstone project of any significance, and currently have a working 2x10x9 full adder. Not sure how painful it would be to hook up more than one in a chain, since I just finished the prototype, and there are almost certainly some improvements that could be made in terms of space/material efficiency, but it is definitely possible. I'll see if I can make a decent schematic, if anyone's interested (probably a side view to cut down on the # of slices necessary).
The half-adder implementation I used is actually fairly elegant (2x5x4, significantly smaller than the 2-wide XOR in the compendium thread) , it's just the wiring between the two that's messy and space-consuming. Basically it's two half adders stacked on top of each other with vertical coils of wire on either end to carry P and Cout.
Edit - did a little more work on it, got it down to 2x10x8 (and it looks a little prettier from the side view :-) ), removed one torch worth of delay, set up a second copy in series without much trouble.
Also: pictures!
I add 2 + 3 + 0 (AA + BB + Cin), and get 5:
Side view:
Further editing - I found 4 repeaters that could be replaced by wires, bringing the component count down to 16 wires, 7 torches, and 10 repeaters (converted to redstone that's 53, about twice what Banjobeni's 4x6x4 (27) or 3x8x5 (31) versions require). I also chained together two more adders, bringing it up to 4 bits (although my laptop is starting to complain a bit about all the work I'm making it do) .
- Found 2 more repeaters that could be replaced by wires, down to 18/7/8 (49). Also worked out the timing; each half-adder has a 3-torch delay, plus there's an additional 1-torch delay on the S output. So for an n-bit adder, it takes 3n+4 torch delays to get the full result.
I do realize that this is a 2 year old thread, but I found some useful information here and I just wanted to share what I did. Based off of what you did (that compressed XOR mainly), I was able to compress it further. What you have in about 10x13 I was able to compress it down to about 7x9. I OR'ed the AND outputs above the ground and that ended up being the key to a clean and compressed full adder.
I managed to create something even smaller a year or so ago using the same XOR gate. It's been my primary adder ever since.
Here is an album I created showing the single adder as well as two adders combined together. Red wool represent the inputs, yellow wool represents the carry in, blue wool represents the sum, and the green wool represents the carry out. I could also upload a scematic of the adders if it would help anyone.
1. AND gates are a lie! Minecraft only allows for OR gates (just connecting wires) and NOT gates (a torch on a powered block). Yes you can make an AND gate, but it is really three NOT gates and 1 OR gate. Both signals are inverted, then combined, then that is inverted again. This means if you ever build a standard AND gate you have almost always failed. In terms of most efficient design.
2. Build in 3d. Wiring in minecraft is BULKY, building up (or down) can save a lot of space over laying everything out flat. Also, almost every torch can be 'tapped' by putting a block over it, and a wire on top of that. This can be cleverly used if you know when a torch is carrying the same signal you need for some other gate.
II: My Full Adder
Note: I am not going to teach how an adder works.
First step, were going to need a design. I tried to make an efficient 3-input XOR gate, it is very hard, so I ended up using this design which worked out great.
Second step, need an XOR gate, and we want it to be small. This is the best one I think. You can see one input on the back right into that torch on top of the block, the other input goes into the mirror torch.
Now this is where things get clever. Looking at the full-adder, you may notice the same inputs go through an XOR and a AND gate. This happens twice. What we can do is combine these gates, so that putting in A and B gives you the XOR of A and B, as well as the AND of A and B.
Okay, so we have this 'double-gate' block. All you have to do is build it one more time to get you second XOR and your second AND gate. Look at the full-adder schematic. Let's pretend your first XOR/AND block handles A and B. That output must be XORed and ANDed with your carry input. Again, the same two inputs into the same two gates!
That is it! I am would be very impressed if someone made a smaller full-adder. Adding these in series makes a ripple adder, you could also add the elements to allow it to subtract. Below you can see the two bit adder I put together along with a poorly designed output screen I used to test. Clever engineering can use the interesting quirks of implementing logic gates in minecraft, and keep these circuits from needing to be entire maps.
Its 11x7x2
Stacks vertically (so not side by side), with every other layer inverted along the axis that has the inputs/output
Smallest i've seen (although not as short as mine) is this one (5x6x3) by howlingmonkey:
But srsly a interesting read.
The half-adder implementation I used is actually fairly elegant (2x5x4, significantly smaller than the 2-wide XOR in the compendium thread) , it's just the wiring between the two that's messy and space-consuming. Basically it's two half adders stacked on top of each other with vertical coils of wire on either end to carry P and Cout.
Edit - did a little more work on it, got it down to 2x10x8 (and it looks a little prettier from the side view :-) ), removed one torch worth of delay, set up a second copy in series without much trouble.
Also: pictures!
I add 2 + 3 + 0 (AA + BB + Cin), and get 5:
Side view:
Further editing - I found 4 repeaters that could be replaced by wires, bringing the component count down to 16 wires, 7 torches, and 10 repeaters (converted to redstone that's 53, about twice what Banjobeni's 4x6x4 (27) or 3x8x5 (31) versions require). I also chained together two more adders, bringing it up to 4 bits (although my laptop is starting to complain a bit about all the work I'm making it do) .
- Found 2 more repeaters that could be replaced by wires, down to 18/7/8 (49). Also worked out the timing; each half-adder has a 3-torch delay, plus there's an additional 1-torch delay on the S output. So for an n-bit adder, it takes 3n+4 torch delays to get the full result.
Although, this IS somewhat useful.
My fan fiction of the game: http://www.minecraftforum.net/topic/1957118-programmer-my-first-fan-fiction/#entry24096758
Here is an album I created showing the single adder as well as two adders combined together. Red wool represent the inputs, yellow wool represents the carry in, blue wool represents the sum, and the green wool represents the carry out. I could also upload a scematic of the adders if it would help anyone.