Finally got around to building a redstone calculator...

First thing's first: I'm a bio major, not a computer science major. All I really know is that computers work in binary, so that's all I had to go off of when trying to design this monstrosity. I was basically starting from scratch, but I think I have a working design.

The keypad is laid out the one on the keyboard (button on bottom is zero), the red button is clear, and the green button is a +/= button.

I think it all fits within what chunks would normally be rendered, but it is mighty long.

Okay, now for the nuts-and-bolts of how this thing works...

This first stage, in lime wool, is simply getting outputs from the keypad. However, since it's a 2-digit calculator, when you type in a "6," you don't know if that "6" is just "6" or if it's actually "60," so I had to convert each number twice: once for if it's the ones-digit and once for it it's the tens-digit. The white-and-black lines below convert it to binary for the ones-digit, and the grey and dark grey lines above convert it to binary for if it's a tens-digit.

This next part (in pink) essentially just figures out which digit it is, ones or tens, before it actually stores those values in the calculator. You can see that the numbers you punch in are stored in T-flip-flops on either side.

It decides which one to put in based largely on this dropper, which has 2 non-stackable items in it. Each time you press a number button, it pushes one into the hopper, so then if you press another number button, it will know that the last number you put in is a tens-place and that this number is a ones-place. Pressing the "+/=" button is the red line, and if that's pressed, it just adds the number in as a ones digit and prepares everything for another number to be put in (it empties the hopper and resets the T-flip-flops that store the actual binary numbers). The yellow line is the clear circuit, and it also resets everything here.

Here's where the actual addition happens, and I used a binary counter to actually add everything. Sethbling posted about a tiny binary counter, and I used that to add the binary numbers together (multiple digits implies addition, so everything works out to just be slammed in here).

Although, the reset circuit for this part was very tricky. I needed to push the slime block towers down, then I needed to pull the observer down, pull it back, then push it back up.

The redstone blocks on top of those slime block towers send a signal up here, where we can finally get to the 198 AND gates I had to make. One for each possible number.

Here they are. The torches represent where a one needs to be in order for the answer to be that number.

However, those "AND" gates only work partially. I'm only testing for ones, not zeroes. So, if the answer in the calculator is 00000001, the "AND" gate for "1" turns on, but if the calculator spits out 0000011, then the "AND" gates for "3," "2," and "1" all turn on. Therefore, I need to only take the greatest number whose "AND" gate is on. that's what this circuit on top of the "AND" gates does. It locks out all the previous outputs.

The "AND" gates run into these slime block things. These encode the digits that the calculator must display on the 7-segment display. There are actually 2 layers of "AND" gates: the bottom layer for the numbers 0-99, and the top layer for the numbers 100-198. Since the ones and tens-digits line up so nicely, I can just use another slime block tower to use the exact same digits as the circuit below it. The "AND" gates actually run out into both sides, one side for the ones digit and the other for the tens/hundreds digit (there's only ever 1 hundreds digit).

Lastly, the display is run by those brightly coloured lines.

Like I said, I'm not a computer science major, and I'm sure there are better ways to do things, but this is what I was able to come up with (mostly) on my own.

Finally got around to building a redstone calculator...

First thing's first: I'm a bio major, not a computer science major. All I really know is that computers work in binary, so that's all I had to go off of when trying to design this monstrosity. I was basically starting from scratch, but I think I have a working design.

The keypad is laid out the one on the keyboard (button on bottom is zero), the red button is clear, and the green button is a +/= button.

I think it all fits within what chunks would normally be rendered, but it is mighty long.

Okay, now for the nuts-and-bolts of how this thing works...

This first stage, in lime wool, is simply getting outputs from the keypad. However, since it's a 2-digit calculator, when you type in a "6," you don't know if that "6" is just "6" or if it's actually "60," so I had to convert each number twice: once for if it's the ones-digit and once for it it's the tens-digit. The white-and-black lines below convert it to binary for the ones-digit, and the grey and dark grey lines above convert it to binary for if it's a tens-digit.

This next part (in pink) essentially just figures out which digit it is, ones or tens, before it actually stores those values in the calculator. You can see that the numbers you punch in are stored in T-flip-flops on either side.

It decides which one to put in based largely on this dropper, which has 2 non-stackable items in it. Each time you press a number button, it pushes one into the hopper, so then if you press another number button, it will know that the last number you put in is a tens-place and that this number is a ones-place. Pressing the "+/=" button is the red line, and if that's pressed, it just adds the number in as a ones digit and prepares everything for another number to be put in (it empties the hopper and resets the T-flip-flops that store the actual binary numbers). The yellow line is the clear circuit, and it also resets everything here.

Here's where the actual addition happens, and I used a binary counter to actually add everything. Sethbling posted about a tiny binary counter, and I used that to add the binary numbers together (multiple digits implies addition, so everything works out to just be slammed in here).

Although, the reset circuit for this part was very tricky. I needed to push the slime block towers down, then I needed to pull the observer down, pull it back, then push it back up.

The redstone blocks on top of those slime block towers send a signal up here, where we can finally get to the 198 AND gates I had to make. One for each possible number.

Here they are. The torches represent where a one needs to be in order for the answer to be that number.

However, those "AND" gates only work partially. I'm only testing for ones, not zeroes. So, if the answer in the calculator is 00000001, the "AND" gate for "1" turns on, but if the calculator spits out 0000011, then the "AND" gates for "3," "2," and "1" all turn on. Therefore, I need to only take the greatest number whose "AND" gate is on. that's what this circuit on top of the "AND" gates does. It locks out all the previous outputs.

The "AND" gates run into these slime block things. These encode the digits that the calculator must display on the 7-segment display. There are actually 2 layers of "AND" gates: the bottom layer for the numbers 0-99, and the top layer for the numbers 100-198. Since the ones and tens-digits line up so nicely, I can just use another slime block tower to use the exact same digits as the circuit below it. The "AND" gates actually run out into both sides, one side for the ones digit and the other for the tens/hundreds digit (there's only ever 1 hundreds digit).

Lastly, the display is run by those brightly coloured lines.

Like I said, I'm not a computer science major, and I'm sure there are better ways to do things, but this is what I was able to come up with (mostly) on my own.

"Just a redstone guy"

-The_Scientist___