Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 2 [3]

Author Topic: Numberabbey: 8-bit ripple-carry adder  (Read 19772 times)

crazycarlt

  • Bay Watcher
    • View Profile
Re: Numberabbey: 8-bit ripple-carry adder
« Reply #30 on: February 06, 2009, 05:53:25 pm »

I think I have a solution. I racked my brain all day trying to design a 1-bit full adder. It's a 3D design and may need a bit of spacing to accomodate the pumps at the end that set a single pressure plate, but theoretically it should work.

So... What are you using to produce those wonderful diagrams? I ought to use the same thing...
Logged

Kanddak

  • Bay Watcher
    • View Profile
Re: Numberabbey: 8-bit ripple-carry adder
« Reply #31 on: February 06, 2009, 07:02:18 pm »

I think I have a solution. I racked my brain all day trying to design a 1-bit full adder. It's a 3D design and may need a bit of spacing to accomodate the pumps at the end that set a single pressure plate, but theoretically it should work.
In mostly mechanical logic? Looking forward to seeing it.

Quote
So... What are you using to produce those wonderful diagrams? I ought to use the same thing...
AppleWorks 6, actually. It's an abominable program but the only thing I have.

Here's my demonstration of the 7-segment display design:
http://mkv25.net/dfma/map-4573
http://mkv25.net/dfma/movie-1092

It runs into some issues that seem to be caused by the switching delays.
Using hatches instead of bridges would probably fix a lot.
This design also might be a good candidate for being implemented in mechanical logic instead, since there are some moments where the variable distances between the water inlet and the various segment-control plates show.

There are some other things that could be done to optimize the assembly process, like reorganizing some of the logic to move the two blue bridges that are in between pairs of floodgates, or to align groups of 1x1 drawbridges and turn them into wide drawbridges that each affect multiple paths through the logic sections.
Logged
Hydrodynamics Education - read this before being confused about fluid behaviors

The wiki is notoriously inaccurate on subjects at the cutting edge, frequently reflecting passing memes, folklore, or the word on the street instead of true dwarven science.

winner

  • Bay Watcher
    • View Profile
Re: Numberabbey: 8-bit ripple-carry adder
« Reply #32 on: February 06, 2009, 07:43:46 pm »

I knew someone would beat me to it
Logged
The great game of Warlocks!

LegoLord

  • Bay Watcher
  • Can you see it now?
    • View Profile
Re: Numberabbey: 8-bit ripple-carry adder
« Reply #33 on: February 06, 2009, 08:38:08 pm »

I see where this is going.  Oh sure, it starts off as a simple adder.  Then you get an idea on how to make it subtract.  Then comes multiplication and division.  Next, you figure out how to use it for other things.  The next thing you know, there'll be a rat nest in there, and whenever you take it out, the whole thing stops working, and then Death will give it a teddy bear for Christmas, and it will whine whenever you take it away.  On top of all that, parts will start showing up that you don't remember adding.  Finally, it will start needing dried frog pills after you try to use it to cure the broker's insanity.
Logged
"Oh look there is a dragon my clothes might burn let me take them off and only wear steel plate."
And this is how tinned food was invented.
Alternately: The Brick Testament. It's a really fun look at what the bible would look like if interpreted literally. With Legos.
Just so I remember

Flaede

  • Bay Watcher
  • Beware the Moon Creatures.
    • View Profile
Re: Numberabbey: 8-bit ripple-carry adder
« Reply #34 on: February 07, 2009, 01:27:29 am »

Actually, this is starting to make me think of the giant Machine from the 1st book of the deathgate cycle, that "mandated" things be done, and no one knew any longer what it was supposed to be doing, let alone why it was asking their bedroom be demolished for a new gear room.
Logged
Toady typically doesn't do things by half measures.  As evidenced by turning "make hauling work better" into "implement mine carts with physics".
There are many issues with this statement.
[/quote]

Martin

  • Bay Watcher
    • View Profile
Re: Numberabbey: 8-bit ripple-carry adder
« Reply #35 on: February 07, 2009, 01:50:37 am »

That's awesome. Still need the bridges over magma, though. And who will figure out how to connect these things to automatically add up how many gobbos have been killed at the fort?

Flaede

  • Bay Watcher
  • Beware the Moon Creatures.
    • View Profile
Re: Numberabbey: 8-bit ripple-carry adder
« Reply #36 on: February 07, 2009, 02:26:38 am »

you'd need some whacked out  borg-logic to figure out how many goblins died. Maybe you could sort of cheat and use a single dwarf-trigger switch at a garbage dump entrance they haul the bodies to, dividing the number by 2?
Logged
Toady typically doesn't do things by half measures.  As evidenced by turning "make hauling work better" into "implement mine carts with physics".
There are many issues with this statement.
[/quote]

Martin

  • Bay Watcher
    • View Profile
Re: Numberabbey: 8-bit ripple-carry adder
« Reply #37 on: February 07, 2009, 03:34:19 am »

you'd need some whacked out  borg-logic to figure out how many goblins died. Maybe you could sort of cheat and use a single dwarf-trigger switch at a garbage dump entrance they haul the bodies to, dividing the number by 2?

Hmm. I'm not sure how you kill gobbos, but if they can be hauled in one piece, I consider that an abject failure.

Flaede

  • Bay Watcher
  • Beware the Moon Creatures.
    • View Profile
Re: Numberabbey: 8-bit ripple-carry adder
« Reply #38 on: February 07, 2009, 04:13:48 am »

THat gave be pause at first, but then I remembered that only one of those piece should get hauled to a "body only" refuse pile. the rest will all be counted in one of the other random categories.
Logged
Toady typically doesn't do things by half measures.  As evidenced by turning "make hauling work better" into "implement mine carts with physics".
There are many issues with this statement.
[/quote]

Martin

  • Bay Watcher
    • View Profile
Re: Numberabbey: 8-bit ripple-carry adder
« Reply #39 on: February 07, 2009, 04:21:06 am »

Oh, good point. I never set mine up that way. So, once hauled, it can't ever get rehauled, so there can't be a bone or skull stockpile nor can there be bone carving activity and fey moods could be a problem. All that is gotten around with forbidding, but then it no longer is automatic.

My goal here is at the top of the cliff behind my settlement, having giant magma glowing digital display reading:

"Now serving goblin #316"

That increments automatically with each kill.

Flaede

  • Bay Watcher
  • Beware the Moon Creatures.
    • View Profile
Re: Numberabbey: 8-bit ripple-carry adder
« Reply #40 on: February 07, 2009, 04:32:14 am »

Well, the other option I can think of is to have a dumping hole, and only dump goblin bodies down it, and making sure all goblin bodies get dumped down it.. One per goblin. Never assigning anything else to get dumped, ever.  ...seems too much of a pain for me, but that way you can have a "pickup" point at the bottom for after they rot.

The first way, you can get bones and skulls, but only if they got chopped off before the goblin died. (like the arm, or the head, or the leg getting chopped off).

EDIT: And this is all way off topic, which is bad, because the original topic is so darn awesome I want it to keep going, continuing to inform me about dwarfputing by awesome annotated examples. It's like oldschool "Popular (Dwarven) Mechanics"!

"...and that's how with the right mechanisms, and a few logs, you too could build your very own Dwarfputer Calculator Kit. Next issue we'll showcase some unique time-linked automation systems our readers have sent in."
« Last Edit: February 07, 2009, 04:37:57 am by Flaede »
Logged
Toady typically doesn't do things by half measures.  As evidenced by turning "make hauling work better" into "implement mine carts with physics".
There are many issues with this statement.
[/quote]

DJ

  • Bay Watcher
    • View Profile
Re: Numberabbey: 8-bit ripple-carry adder
« Reply #41 on: February 07, 2009, 07:57:19 am »

You could build a second entrance to the goblin bodies chamber. This entrance would lead to a bones chamber. Put a hauler in the bones chamber, lock the exits on both chambers and unlock the passage between them. When the bones get hauled, lock the passage and unlock the exits.
Logged
Urist, President has immigrated to your fortress!
Urist, President mandates the Dwarven Bill of Rights.

Cue magma.
Ah, the Magma Carta...

Kidiri

  • Bay Watcher
    • View Profile
Re: Numberabbey: 8-bit ripple-carry adder
« Reply #42 on: February 07, 2009, 05:06:28 pm »

What I'm hoping to see here (in time, obviously) is a calculator, even if it only can do additions. But at least with decimal input and output. The way I see it, the evolution of this device will be as such:

First, there will be binary input and addition, and hex output. This isn't so far away and Kanddak is most likely already busy figuring this out. (Not that there is much to figure out, all you need to do is hook up the adder to the bridges and hey presto, it's done.)

Secondly, the same as above, but with decimal output. This will require a bit more thinking. In order to do this, you'll need to first know how many digits your adder will have. Then you can figure out how everything has to be set up and you're done.

Thirdly, and this will be most likely very difficult, is to have decimal input. With numbers with an equal amount of digits as the number of displays, this is easy. But as soon as you start working with digits that have less, you have to find a way to easily input said numbers. To 'move them aside' like in a real calculator, so that when you put in a 2 and then a 9, it shows up as 29. This can be solved by putting zeros in front of each number, until it has reached it's appropriate length, but elegant is different. Ideally (and hopefully eventually) it'll work as a real calculator. It could work with an enter function so the calculator knows when to go to the next number, so 29 would be put in as 2 [enter] 9. This does solve the problem of the decimal-to-7seg (partly) as every digit will have its own input-device. In order to do this, you have to link the [enter]-lever/pressure plate (pressure plat would be handier, I think because it'll be easier to count than with a lever) up to a counter that counts every time it's pulled and counts until the maximum amount of numbers is reached.

Fourthly, a way to have all input and output on one display. This can be solved in the same way as the previous step: link the plus-lever up to two floodgates, one straight up and the second one via a NOT-gate. Alternatively, do it in the same way as above in order to add multiple numbers at once (and enable multiplications in some way?). Link it all up to one display and revel in your Dwarven engineering masterpiece. Have a [clear]-lever at hand to do multiple additions in a row and astound everyone when you start DF when you want to calculate something instead of the standard Windows calculator.

Fifthly, but this is for a very far future, multiplications, subtractions and division.

Sixthly, if anyone is mad enough to try it, exponentiation and roots.

Seventhly, a fully working Dwarfputer.

Eightly, eternal fame in the DF-world as the inventor of the Dwarfputer.

Ninthly, DF playing in DF. I wonder if that would be copyright infringement... And what kind of NASA-supercomputer you'd need for it to work.
Logged
Veni, Vidi, Pompeii.
Soylent Green is kittens!
Sometimes, when my Dorfs are exceptionally stupid again, I wonder what exactly the [INTELLIGENT]-tag does.

Kanddak

  • Bay Watcher
    • View Profile
Re: Numberabbey: 8-bit ripple-carry adder
« Reply #43 on: February 07, 2009, 08:53:54 pm »

I think the easiest way to count goblins would be to use a hostiles-only plate to count them before they died.

My current DF agenda, subject to free time:
1. Build a 4-bit counter and connect it to the 7-seg in Displaycontrols. Flaede, I'd be curious to know if you tested that design yet and, if so, what happened.
2. Finish Numberabbey by going to sixteen bits with four seven-segment displays.
3. Work on wishlist items.

My wish list of things I'd like to see, and might make if no one beats me to them:
1. Adder-subtracter. Won't be hard, you just have to put some extra logic in front of your full adders for a cost of 2 floodgates, 2 bridges and a pressure plate per bit. It'll take me 10 minutes to make a diagram, I'll probably do it some time soon.
2. Multiplier. This too will mostly be an application of the existing adder design.
3. Binary-to-BCD converter that can be plugged in between the adder (or adder-subtracter or multiplier) and 7-segs to get decimal output. The 7-segs could be simplified a bit to get rid of some logic only used to display A-F.
4. A simple memory system like a calculator's.
5. Life cell. If a group of these floods/drains a bunch of ponds for display, it could be a pretty satisfying way to drown goblins. We don't have maps big enough to make these, but space constraints aside, it'd be completely within reach to make DF play Life playing Life, much more easily than making DF play DF.

Things I really don't have quite enough OCD to do but which certainly must eventually be done by someone:
- Build a 16-bit adder with twelve 7-segment displays... using only masterwork components, color-coded in platinum, gold, and rose gold, with the control room lined with masterwork statues, built around a large fountain, floored with a lovely mural, and surrounded by the crazy fractal bedroom plan housing its operators. Now that I've shown off the nuts and bolts part, someone needs to go ahead and implement it in one of those insanely wealthy, intricate, beautiful sorts of forts.
- ...color-coded in iron, nickel, and bauxite, and compute with magma.
- ...ten z-levels above the ground with the structure made of glass blocks, or soap.
- ...on an ocean floor, by pouring magma to drop obsidian.
Logged
Hydrodynamics Education - read this before being confused about fluid behaviors

The wiki is notoriously inaccurate on subjects at the cutting edge, frequently reflecting passing memes, folklore, or the word on the street instead of true dwarven science.

crazycarlt

  • Bay Watcher
    • View Profile
Re: Numberabbey: 8-bit ripple-carry adder
« Reply #44 on: February 07, 2009, 09:07:01 pm »

Well, addition is very similar to subtraction. Existing adders might be modified to do both, based upon an opcode switch that opens or closes some gates, or changes the output accordingly.

Multiplication is similar to addition, it's just repeated addition. Division is the same way, especially if you throw away remainders.

Exponents and roots, while I don't know exactly how they might be performed, would be only marginally more complex than a multiplier/divider. At least, I think so.

But 'fully working' dwarfputer... what do you mean? that's a huge jump. Charles Babbage built a computational engine in the early 19th century (1800s) that could do these things, however it wasn't until the ENIAC and its cousins and progeny that a computer could not only take an input, instruction, and produce an output, but also route the data from component to component, perform a complex, multi-part computation and even follow branching logic trees based upon the results.

This, I imagine, woudl be a fully-working dwarfputer. A limited set of operation codes, program and data memory, four or six data registers and a fully-functional ALU capable of addition, subtraction, multiplication and division, in addition to AND, OR, XOR, and other operations based upon a Controller's instruction and a program's opcodes.

So while many of the parts seem to be coming together, we're some distance away, to be sure. It would take one hell of a lot of free time, and a bit of brilliance to construct a programmable, decision-making dwarfputer at this time, and I would like to say that we may not expect too much from such a virtual machine, though I for one would enjoy having a calculator in a dwarven monastery, for doling out the recruitments and totaling up the goblin massacres.
Logged
Pages: 1 2 [3]