• 0

    posted a message on I need help with a Redstone timer

    I might be misunderstanding what you need, but perhaps a hopper clock modified to fire once could do what you want.


    It's the same as a regular hopper timer, just replace one of the sticky pistons with a regular piston. Then, after the cycle completes, the redstone block will be left on the retracted sticky piston, which should be activated. Then you can trigger the clock to cycle once when you update the sticky piston.


    If it works, I should have a screenshot of it built.

    Posted in: Redstone Discussion and Mechanisms
  • 0

    posted a message on 8-Bit Computer (Turing Complete)

    Ah, that's interesting, I never expected there'd be dedicated servers only for redstone...

    I'm not actually a computer science major and I really don't know what I'm doing, so I doubt I'd be any contribution. I'm actually more interested in devices like automatic farms and virtual pets (silly stuff like that). I just figured I'd give building a computer a try. Thanks for the invitation, though; those things mean quite a lot.


    (Sorry for replying 4 days late; it appears as though I've stopped receiving notifications)

    Posted in: Redstone Creations
  • 1

    posted a message on 8-Bit Computer (Turing Complete)

    Before I begin, I want to make something clear: I am not a computer-science major. I'm not even a physics/math major. I'm a biology major (at least that's the plan right now), so I apologize if I use some terms incorrectly. I also realize that this has been done before, but I still think it's cool and thought I should share it.


    First, a bit of introduction:

    I recently found Ben Eater's YouTube channel, and I watched his series on building an 8-bit computer entirely on breadboards. In his videos, he explained how every part of the computer works really well, and started to think, "I could build that with redstone." My computer isn't really mine; it's me translating his breadboard computer to Minecraft, so I should really give most of the credit to Ben Eater.


    As I tried building this thing, I found that there are certain advantages to building a computer in Minecraft, most notably the fact that redstone is perfect. It is always on or off. I don't have to deal with voltages, capacitance, inductance, etc. I don't even really know what inductance is, and I've never seen a capacitor in my life, and with redstone, I don't need to. I don't need to mess with the real-world issues of real-world physics and electronics. I do, however, have to deal with size. On a breadboard, you can cram quite a few wires right next to each other, but in Minecraft, you have to have a 1-block gap between every separate line of redstone. There's also the issue of signal strength. On a breadboard, you can run a wire from one end of the computer to the other without any issues. Signals travel across the entire device in an instant. With redstone, I can only go 15 blocks before I have to introduce a delay of 0.1 seconds, which means this computer is very, very slow.


    Here's a snapshot of the whole computer:

    The Whole Computer

    The computer is made up of the bus (brown wool in the center), the memory unit (the big, tall, magenta mess in the back towards the right), the CPU (the multicoloured mess closest to the camera on the right side), the program counter and clock (close to the camera on the left), the ALU (which is obscured from this point of view), and various registers all throughout the machine.


    Let's start with the bus:

    The Bus

    The bus is essentially just 8 lines of brown wool with redstone. The top layer is for outputs going onto the bus, and the bottom layer is for inputs coming off of the bus (I did this so that I didn't have to mess around with making a bunch of 2-way repeaters). Every device interfaces with the bus like the light blue wool shows here (or similar). The white line is supposed to be for the clock.


    Before I go any further, I should probably mention this:

    D-Latch

    This is the design I used for a 1-wide and semi-tileable D-Latch (or flip-flop, I forget what it's actually called). The clock comes in the white line up top, the light blue wool is for data input, and the blue wool is for outputs. There is an item in the dropper, and it only latches when the clock pulses.


    The memory unit is quite big, but it can store up to 16 different 8-bit values.

    Memory Unit

    Each value is stored in a different set of D-latches (the dark grey). The clock is the white line running up, the purple lines are the outputs, the lime lines are the inputs, and the light grey lines are the address pointing to the specific set of D-latches. The orange line is a control signal (more on that later) governing when the memory unit will give an output. The slime blocks are just there to get the outputs from the top of the machine down to the bottom.

    The address is stored in an address register, which connects directly up to the light grey lines pictured above:

    Address Register


    Next I suppose I should show the system clock and program counter.

    System Clock

    The system clock really isn't that complex. It's just a hopper clock with a halt line (yellow).

    Program Counter

    The counter is pretty weird since it needed to also be able to accept an input. The blue lines close to the camera are the counter's output lines.


    The computer also has several registers:

    A and B Registers

    The A (right) and B (left) registers are meant to simply store numbers and do arithmetic operations on them. Only the A register can output a value onto the bus.


    Output Register

    The output register stores an 8-bit value and displays it on some lamps.


    Flags Register

    The flags register stores the carry bit (is on if an arithmetic operation goes over the 8 available bits) and the zero bit (is on if an arithmetic operation results in a zero). This is necessary for the computer to be Turing Complete (I think).


    Instruction Register

    The instruction register is meant to handle instructions. Only half of it can output onto the bus, and the other half goes into the CPU, which I'll talk about next.


    CPU Front

    The CPU is essentially just a bunch of AND gates. The pink lines are outputs from the instruction register, and each different colour underneath those lines are separate commands you could theoretically give to the computer. The two shorter black lines up front are the fetch cycle, which gets the instructions from memory. The two purple lines near the bottom of the image come from the flags register. They are used in the conditional jump commands and make the computer Turing complete (I think).

    The commands work by activating certain control lines:

    Control Lines

    All of the control lines are here. There's a control line for just about everything: turning on inputs for any register, halting the clock, turning on outputs for the registers, and incrementing the program counter.

    Some instructions have multiple steps, and I kept track of the step using Sethbling's binary counter (see below the next picture), and it just updates every clock pulse.

    Step Counter


    The computer also has an ALU (Arithmetic Logic Unit) that can both add and subtract two numbers.

    ALU

    It's just a bunch of chained adders. The last one outputs into the carry bit, which is one of the flags in the flags register. The ALU takes inputs from the A and B registers, and adds them (unless the subtract signal is on, in which case it subtracts them).


    I think that's all the "hardware," so here's how I program the computer:

    Programming 1

    First I switch it into programming mode using the lever closer to the bottom of the image. I can then set the address I want to program using the other 4 levers.

    I then need to fly around the machine,

    Programming 2

    to here so I can input the exact value I want into that location in memory. I can then fly back to the previous picture and press the button to commit that change. Programs start at memory location 0000 and count up (with the program counter).


    I think that's it, so thanks for making to the end of my long (and probably arduous) post. I'll try to answer any questions people have in the replies for this post. Once again, this is really just my building Ben Eater's breadboard computer in Minecraft, so I can't really take too much credit, but I still think this is pretty neat.

    Posted in: Redstone Creations
  • 0

    posted a message on 2-Digit Addition Calculator

    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.


    Front View

    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.

    Side View

    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...

    Part 1

    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.

    Part 2

    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.

    Part 3

    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.

    Part 4

    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).

    Part 5

    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.

    Part 6

    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.

    Part 7

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

    Part 8

    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.

    Part 9

    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).

    Part 10

    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.

    Posted in: Redstone Creations
  • 3

    posted a message on Non-Stackable Item Filtration System

    I think I found a way to (sort of) filter non-stackable items, narrowing them down a bit.

    Whole Machine

    This thing has many branching paths, but let's see where they go:

    Beginning

    The input starts up here, in this double-chest, where it goes down into this yellow bit:

    Potion Filter

    The hopper is pointed at the brewing stand, and if the non-stackable item in question is a potion, it will go into there and get taken out into the chest, which is output #1: Potions. Unfortunately, I couldn't find a way to filter out the different kinds of potions without destroying them, but if you think of one, let me know.

    If the item is not a potion, it will go down into a hopper below, which is locked for a short time to ensure potions have a chance to go into the brewing stand, where it moves on to the next step:

    Dispenser Filter

    Here, we can separate out certain items. Flint and Steel, Shears, Water Buckets (including the ones with fish in them), and Lava Buckets all stay in the dispenser. Other items are shot out. Shulker boxes get placed, but are broken and carried on by the piston.

    Under the Dispenser

    Here you can more clearly see that items that are shot out go to the left, while anything still in the dispenser will go the right. Fish in the buckets unfortunately don't get picked up again by the dispenser, so the fish will eventually die and go the right as well.

    Minecart Filter

    The next step (for items that are shot out of the dispenser and went to the left in the previous image) involves filtering out both minecarts and shulker boxes. Shulker boxes can't get placed on the rail and simply get stuck in the dispenser, and are taken out from below. Minecarts get placed onto the rails and get broken by a cactus. Minecarts with a chest or furnace are broken down completely, and a non-stackable item filter will separate out the minecarts specifically. Other items are just shot out. Here you can also see that I just use a regular non-stackable item filter to get rid of the fish that would be left behind by the fish-in-a-bucket items.

    Boat Filter

    This next step will separate out boats. The boats get placed in the water and are then pushed over and broken by the cactus, but other items are just shot out into the hopper.

    Armour Filter 1

    The next set of items I can filter away are armour items (including turtle shell helmets and elytra), since they can get placed onto an armour stand by a dispenser. The item is shot out, and, if it's armour, it gets placed onto the armour stand, which is then pushed off to a chamber below. If it's not armour, the item is picked up by a hopper underneath the trapdoor.

    Armour Stand Chamber

    The armour stand drops into this chamber, where it triggers a tripwire, which retracts that downwards-facing piston. That allows the skeleton to see an iron golem, which prompts it to shoot. The arrow breaks the armour stand, and if one arrow does escape, the water ensures it will never reach the golem and kill it. The armour stand and whatever armour it may or may not be wearing is dropped and put into the hoppers.

    Armour Stand Retrieval

    The armour stand is filtered out via a non-stackable item filter and put back up top into a dispenser where it can be used to filter out more items. The armour is non-stackable and winds up in an output hopper (the chest).

    Misc. Items

    Everything else, including tools, weapons, books and quills, cakes, soups, milk buckets, banner patterns, and enchanted books all wind up here. I tried to use pandas to filter out cakes, but they were way too unreliable. If you can think of any way to narrow those kinds of items down, let me know, but until something comes up, this is just the "misc." output...

    This part again

    However, going all the way back here, items that stay in this first dispenser (water buckets, lava buckets, flint and steel, and shears) are all going to the right (the dispenser fires multiple times so water/lava buckets are picked back up).

    Lava Filter

    They first go into the dispenser on the left. Lava buckets just get shot out since you can't place lava into a trapdoor. They are picked up by a hopper and put into this chest. Flint and steel/shears both stay in the dispenser and are taken out from below it. Water buckets waterlog the trapdoor and leave just a bucket in the dispenser.

    The regular bucket is separated out via a non-stackable item filter and put into the dispenser on the left, where it takes the water out and goes into the chest down below it.

    Flint and Steel/Shears Filter

    Flint and steel/shears both go down here instead, where the flint and steel lights the netherrack on fire, causing a block update, which triggers an observer and allows it to flow down below, but shears don't cause any such block update and just wind up going off to the side.


    So, in short, I was able to separate out potions, shulker boxes, minecarts, boats, lava buckets, water buckets, armour, flint and steels, and shears. If you can think of a way to filter out more, please let me know so this machine can be improved upon.

    Posted in: Redstone Creations
  • 1

    posted a message on Capture-the-Point System with Optional King-of-the-Hill

    Here's a device I made specifically for a minigames-type world. It's a highly configurable capture-the-point system with an option for a king-of-the-hill mode.

    Front View

    Standing on a pressure plate will change the beacon to that colour. If king-of-the-hill is enabled, more lamps will turn on of the side you're on for as long as the point is in your team's control.

    Circuitry

    The mechanism is pretty simple: standing on a pressure plate activates an observer clock that puts items out of one dropper and into the other. If enough items are in one dropper versus the other, a glass block is put over the beacon and hopper clocks are unlocked. These hopper clocks are for king-of-the-hill, and if you don't want that, they're entirely optional.


    I think it's pretty useful. It's small, and you can configure how quickly the point captures by how many and what type of items you put in the droppers (If you want it to go super quick, you can use non-stackable items, if you want it to go super slow, use only items that stack to 64, etc.).

    Posted in: Redstone Creations
  • 0

    posted a message on Piston Face Emulator

    Yes, just like the last one. You can hook it up to whatever you want, but I just have it cycling through various faces with a feed-tape.

    Posted in: Redstone Creations
  • 0

    posted a message on Piston Face Emulator

    I finally figured out how to make my face emulator that I posted not too long ago with pistons:

    Front View

    Like the last one, each block of the bottom two rows are individually toggleable, you can toggle the eyebrows, and their's a "nose" block in the centre just above the mouth area.

    circuitry

    Here you can see the circuitry. Every colour (except for the brown, which is for the piston feed-tape) just goes into a different block.

    The hardest block to wire up, of course, was the central block on the second-from-the-bottom row, marked here:

    The Most Difficult Block

    This is because there is no way to avoid BUD-powering. You can't power the piston directly or else you BUD-power the piston below it, and you can't go above that piston or else you directly power the "nose" up above it.

    However, I then remembered that zero-tick pulses don't trigger BUD powering, so I had to use that to power the block safely.

    Posted in: Redstone Creations
  • 0

    posted a message on Minecart Bank

    I think Sethbling did a concept like this before, but here's my attempt:

    Interface

    Much like my Shulker box bank, you open accounts with copies of a written book that way only you can access your account. You put your "keycard" book into the dropper and press the button. The minecart shows up on the rail to the left and you need to wait for it to go back, which is indicated by the lamp on the side.

    Circuitry

    Those yellow circuits are item sorters for the "keycards," the hopper lines simply transport items, the lime things are just structures to hold the minecarts, the magenta is the minecart line to the player, the grey is the minecart line back to its holding position, the light blue is to detect if the minecart is has left its holding position, the orange releases the minecart, the green if for the lamp indicator, and the blue is to seal off a holding position if it already has a minecart in it.


    Here's a detailed look at one module:

    One Module

    This design could be compacted a bit more, but I think the proof-of-concept is pretty cool.

    Posted in: Redstone Creations
  • 0

    posted a message on Searchable Storage System

    For those of you who have too many items, now you can search up what you want.


    Front View

    Side View

    You put in your search query into the two hoppers in the floor, then press one of the purple buttons to get a certain amount of items. The purple circuits run into the hopper timers (light grey) which run into the pulse multiplier (red) then into the droppers. In the meantime, the search query will place down an orange block so that the dropper can be powered. Hopper chains bring the items to the output chest. The light blue and yellow circuits are item filters, and the excess item gets put back into the search item chest.

    Posted in: Redstone Creations
  • 0

    posted a message on Programmable 3x3 pixel display

    They work now, and it looks really good.

    Posted in: Redstone Creations
  • 0

    posted a message on Colour Combo Lock

    I'm here to submit a design for a colour combo lock. It can be (relatively) easily expanded, and each slot has 16 possible entries, and since right now it has 5 slots, it has 16^5 combinations.

    Front View

    Side View

    It uses a redcoder to get individual outputs from each of the buttons which are all placed right next to each other, and there are actually 2 piston feed-tapes to ensure a secrete combination.

    Posted in: Redstone Creations
  • 0

    posted a message on 1-Wide Tileable Etho-Door

    I'm sure someone has done this better already, but I just love watching this open and close.

    Front View

    All you need to do is run power into both sides. All the pistons are sticky except for the ones under the concrete powder.


    Here it is in action: https://i.imgur.com/9rNSAhR.mp4


    I know it isn't particularly impressive, but sometimes you need to make something just because you like it.

    Posted in: Redstone Creations
  • 1

    posted a message on Slot Machine

    I've added several layers of randomness, so I'm not sure what the odds of winning actually are. I just know they're low.

    Front View

    There are 3 slots, and each one will change if you press the button to spin. If it's spinning, the light is on.

    Side View

    Each slot has 4 possible options: blank (glass), gold, iron, or diamond. If all 3 match, you win the respective jackpot. The slots are obviously piston feed-tapes. Each piston feed tape moves randomly, and there is a 1/9 chance that your spin will end at any given moment.

    Top View

    The brains of the machine are actually these smaller piston feed-tapes up top, which all 3 have cauldrons inside them so that 1/3 full correlates to an iron block, 2/3 full correlates to gold blocks, and the full cauldron correlates to the diamond block. If all 3 match, which I detect using orange redcoders and the grey, white, and black AND gates, you get an output, which is the brown circuit.


    This machine could definitely look nicer. The brown circuit can go to whatever you want (mine looks ugly since I made it go back to front), and the purple circuit (which controls the lamp) will just go wherever you want the lamp to go.

    Posted in: Redstone Creations
  • 0

    posted a message on 9-Digit Combo Lock

    It depends on how long you make the combination. I made mine 4 digits, which is 9^4 combinations.

    Posted in: Redstone Creations
  • To post a comment, please .