Hello everyone- I made a functioning addition and subtraction calculator shaped like a TI-84+CE on our minecraft server, Cemetech-MC, and it has gotten some attention recently in chat, so I figured I might as well explain how I made it :D


Part I: The case
Unsurprisingly, this started one day with me being a little bored and looking at my calculator. I took some measurements with a pair of calipers I had and I decided it would not be too unreasonable to build one in survival with a scale of 1/16th of an inch (1.57 mm) to one block. Initially, at least, there was no intention to make it functional- about halfway through the build I had the idea to sell advertising space on the screen or something.

I went about designing it in creative mode, starting with the buttons. Unbeknownst to me, I made the center buttons one block too wide and this error persisted throughout the entirety of the build. Whoops.

The arrow buttons gave me particular trouble, I spent an hour and about ten iterations just getting them right.

After the buttons, I worked on the sandstone top. I picked this particular hue because it most closely matches my real calcs, plus it has slabs and stairs which are extremely nice for the rather curvy calculator- I did not fully appreciate how many noncircular curves are on this thing until I tried to build it. I think I did a decent job on this.

Then I worked on the black underside- I included the two rails that the cover slides into but omitted the charging port and light for some reason.

I knew I was going to build this up at ground level in survival, so I did not build the bottom at all. This turned out to be fairly convenient later when I had to dig out the floor to fit in redstone.

Here's what the case looked like. I had to expand it to fit the display in later.


I built this on Cemetech-MC and it was mildly interesting, though it wasn't long before people (myself included) started thinking about how cool it would be if it actually worked.


Part II: The calculator inside the calculator

Right at the start of the design, I knew I wanted it to be as cheap and compact as possible, to minimize build time. I went with an analog (using signal strength, which goes from 0-15, to store numbers) calculator instead of binary, as it would theoretically make my design 1/4th of the size.

I ended up making a five-wide infinitely tileable ripple carry adder/subtracter, through I only tiled it 5 times in the final design (when this project was fully completed, it was going to cost me well over a shulker box of redstone blocks in materials, and I didn't like the idea of spending even 20% more).

I knew I wanted to build something based off of a calculator design by Maizuma Games, but there was no world download. I contacted Maizuma, but he told me he couldn't find the file (it was on his old computer or something). I ended up completely redesigning it based on the explanation he gives in the video and a couple of still frames. After some optimizing, I got my end result more compact than his and also slightly faster on some inputs.

Negative numbers gave me particular trouble- I could not get this part to be as compact as Maizuma got it no matter how hard I tried. There must be some optimization I was missing- to get the whole thing to fit into my calculator cleanly I had to omit a step (causing all negative numbers to be off-by-one, though it escapes me as to which direction they are incorrect.)

You can read the explanation in Maizuma's video linked above, but to add numbers I compute 10-(10-carry-x-y) for each digit since it is rather easy to subtract analog numbers in Minecraft. For the subtraction mode, I do 9's complement arithmetic (which is related to the above off-by-one error). I failed at what should have been simple algebra here more than I care to admit, I am indebted to fghsgh for sorting me out a fair few times. :)


Part III: Memory

The calculator has two analog shift registers to store input, each using a design of my own (though the idea is trivial). I wanted to be able to clear the register without using a separate input; here's the design I ended up using (tiled three times so you can easily see how it links together).


Sending a three-ish tick pulse to the line at the top of the image (you can see the monostable I used to generate this signal for testing) causes the register to shift while sending anything significantly longer fills the whole thing with zeros.

The principle it operates on is pretty old and fairly uninteresting so I'm not going to explain it in too much detail. In each tileable unit, there are two comparators that form a loop to store the analog value, a single comparator used to carry the signal into the next unit down the register, and some circuitry on top for shifting that selectively forces different comparators to "zero-out" at different times.

After compacting this down and stretching it to five-wide so it would tile nicely with the computery bit, I crammed two of them into the logic (one goes to the top row of numbers, one goes to the bottom row of numbers).

Yellow blobs are the shift registers themselves, orange blobs are lines going from the shift registers to the computery bit, magenta/purple blobs are lines going from the shift registers to the displays. Please excuse my MS Paint skills.


Part IV: The numeric displays
This is the most "innovative" part of the whole thing- there is a distinct lack of displays that are flush with the floor (most of them get embedded into walls, so that's where the attention towards optimization has been).

At a high level, my design consists of an analog decoder (in redstone, we call it a "redcoder") that takes a signal strength from 0-9 and turns on one of ten torch towers. It also contains seven or gates (one for each segment), and a little bit of routing wizardry to convert what would be a fairly normal "in-wall" display to an "in-floor" display.

Here's the redcoder. It's not my design, I forget where I got it from, but it's fairly neat and cleanly fits into my 5-wide tileable unit.


The display logic itself is mostly just or gates like I mentioned before, usually trivial stuff like this (remember, only one of the redstone torches will be on- the normal torches are overkill, see the section for survival considerations)


However, getting seven of them to fit into my tiny blueprint posed quite a challenge. I had to use a variety of techniques to get them all to fit :)

Now, what I have here is a display like this, where it could sit flush with a wall:

What I really want is something that sits flush with the floor, like this:


This was accomplished with a bunch of tiny wires that "rotated" the signals in a way:


I actually needed to create two displays: one with the input on the same side as the display, and one with the input on the opposite side of the display. You can kinda see why in the image below; the display logic is very long, so three of them together create a contraption much longer than the screen is. I had to hide as much of the display logic outside of the screen region as I could. Note that the input of the result display (the leftmost one) is constrained by the calculating logic behind it.



Part V: Keypads

Each numeric input key consists of a bunch of pressure plates on top of the physical key in the case that activates a small mechanism inside the display that (in turn) sets two lines that go into the keypad logic.

Here's what one keypad looks like under the hood.


I went with a piston in the mechanism because you can hear it respond better than the click of the pressure plates- it also made it fairly easy to work with.

The comparator-based analog bus in the picture contains the signal strength corresponding to the number that was pressed (i.e. no signal if you pressed the 0 key, a signal strength of 1 if you press the 1 key, etc). The second line is a digital (on or off) line that is on with each keypress- getting these two lines to be timed approximately the same was an absolute nightmare for various reasons. In retrospect, if I had assigned the 0 key a signal strength of 1 (and the 1 key a signal strength of 2, etc) and decrement with a redstone dust before storing into the shift register, I wouldn't have needed the second line. But logically, this line makes sense, as the shift register takes two inputs, an analog value and a digital signal to shift.

For the other buttons, I used different solutions. The clear button is just redstone dust, no piston, and the addition and subtraction buttons control this neat little latch to set the mode.


The enter key controls which value is being inputted, the top operand or the bottom operand. It's just a lever that controls a digital line that goes into the keypad logic.


Part VI: Keypad logic

The keypad logic is mostly just a router. It takes input from the keypad itself and sends it to the correct places on the calculator.

I use this nifty little circuit all over the calculator and this is a good place to explain it:

The glass block would be a normal full block, but it's glass here for visiblity

If the lever on the right is off, the signal passed into the circuit is sent to the white block in the back. If the lever is on, the signal is sent to the black block in the back. I use this circuit all over the place: twice in the keypad logic (to control which shift register gets the values from the keypad), once in the circuit that handles negative numbers and overflow, and twice in each tileable unit (to control switching to/from subtraction).


Part VII: Non-numeric displays
There's not much here to talk about, the plus/minus indicator is really simple, and the negative indicator/overflow is just about that simple, though it has three states (overflow/1, negative/-, and off) so it's not quite as clean.




Part VIII: Notes and survival considerations
Since Cemetech-MC doesn't allow litematica for some reason, the first step was to split the build up into layers. I made sure to align the chunk offsets, as they would be used as guide points. I used litematica in my single player world for this, using a clean account on the server, of course ;)

I also made sure to include a bunch of torches in the design, though not nearly enough to prevent all spawning while building. Whoops.

Digging out the pit for the redstone only took a couple of hours, mainly because I had help in the form of players EaghanScarlette and TallPrince. Thank you both :)

Since I tried to hide all of the redstone from the elements, part of the build involved terraforming a hill over the exposed display logic at the top of the calculator. I am dreadful at terraforming, but I tried my hardest. I also had to re-route a rail line, and I chose to have it run under the case of the calculator, so you can see the redstone (or at least some of it) for a short bit. I plan to have some kind of glass walkway on the inside, maybe with signs explaining neat parts of the circuitry- there is a kind of beauty to redstone like this.

This build has a lot of mistakes and missed optimizations and such in it, but this is mostly because I designed the whole thing in only like 12 hours of playtime, spread out over four days- if I had spent more time on it, it could have been much more refined. (This post was also written in a bit of a rush, if you can't tell from my liberal use of interesting grammatical constructions.)

There are a lot of other parts of the calculator I would love to describe more in-depth but in the interest of keeping this post readable for most people in a reasonable amount of time I have skipped over some cool parts. I suggest downloading the schematic and taking a peek for yourself, or popping on our MC server and taking a look at the circuitry.

You can also check out the Imgur album for this post which contains some extra pictures I didn't use: https://imgur.com/a/xGbA3LD
When do you plan to add SourceCoder and jsTIfied compatibility?

Joking aside, this is seriously impressive to do in Survival. Kudos, I loved reading about it!
That is seriously amazing, especially given that it is in survival. Though I have not played much MC, I know how hard red stone can be. Is there a video of it working or anything like that.
Major Kudos to you!
JPJUspeed wrote:
That is seriously amazing, especially given that it is in survival.[...]Major Kudos to you!


Thank you for the kind words! It means a lot to me :)

JPJUspeed wrote:
Is there a video of it working or anything like that.

I recorded one a couple of days ago while admittedly a little distracted:
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are GMT - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement