It looks like you're new here. If you want to get involved, click one of these buttons!

- 24.7K All Categories
- 14.8K In Game
- 5K General
- 1.2K Applicants Post Here
- 1.5K Collaborations
- 2.3K Commerce
- 409 Guilds
- 1.6K Gripes and Grins
- 700 Come and Visit...
- 2.1K Bugs
- 10.4K Out Of Game
- 1.9K Questions
- 124 Official Deepworld Announcements
- 750 Events
- 846 Fan Creations and Screenshots
- 2.4K Feedback and Game Ideas
- 4.3K Off-Topic
- 13 Lunar Lockdown
- 4 Official Lunar Lockdown Announcements
- 11 General

Our new Space Biome update has been released! Please leave us a nice review in the App Store if you have the time, thank you!

Dr_Derp
tejasMember Posts: **778**

If you do not understand what is going on, have a read at this discussion first!

http://forums.deepworldgame.com/discussion/26550/how-2-logic-gates-properly#latest

Now then, as promised, a tutorial for a 4-Bit Ripple Carry Adder. This is a bit advanced, but if you understood the discussion above, then you should probably be good to go.

Note, this is by far not even close to being a good and optimized creation, I spaced everything out in order to make it easier to draw in the connectivity lines. You can most definitely make it more compact and faster as well.

A look back to the previous discussion, if you remember the full adder circuit, you will note it has 3 inputs. A, B, and a carry input. The circuit has two outputs, one being a true output and the other being a carry output. The way a ripple carry adder works is you have multiple full adders and connect the carry output to the next carry input. With this in mind, you can go a lot higher than 4-Bit by simply chaining more full adders, but expect a slower output as you go higher in bit count.

Before starting the design, it is important to note that because the first full adder does not and will not ever get a signal from its carry input, you can remove it altogether and use a half adder, which is much more compact, do note that you can only do this for the FIRST adder, and only the first.

Using the designs, but a bit spaced out, I created this structure for the circuit, this is where the logic is going to be placed.

As you can see, I reflected the adder in order to save the racer travel time.

Go somewhere, and set up a control panel, like this.

There is a good reason we have 5 signs for an output. A 4 bit number can be as high as 15, so adding two 4 bit numbers could result in a value as high as 30, and a 4 bit number cannot hold a value above 15. That's why we use 5 signs, for 5 bits of potential output.

Now lets hook up the first adder to its switches and its sign. Make sure to type a "1" in the output touchplate.

This first adder is pretty straight forward.

Now, lets connect all of the carry outputs to the next carry inputs.

Next, connect the second adder to its switches.

And the third adder.

And finally the fourth adder.

Lets now connect the first XOR gate in the three full adders.

And the second XOR gate, which is actually the true output gate.

Now to finish up the gates, here is the two AND gates, we have already connected the OR gates' outputs so don't worry about that.

This is the most important part, you WILL need a reset switch as some trapdoors are triggered by levers and touchplates, as such, they will be difficult to properly reset, the easiest solution is just to have a large timed lever at one second connected to all trapdoors. Additionally, you can use this large timed lever to reset the output signs to say 0.

And I believe that is it, well, except for the spawner, and that has a pretty obvious spot. (it goes at the start of the first adder)

I apologize for some of the darker screenshots, but you should still be able to see what goes where.

If you haven't figured it out, the output is also in binary, but I will leave it to you to find out how to translate binary to decimal.

http://forums.deepworldgame.com/discussion/26550/how-2-logic-gates-properly#latest

Now then, as promised, a tutorial for a 4-Bit Ripple Carry Adder. This is a bit advanced, but if you understood the discussion above, then you should probably be good to go.

Note, this is by far not even close to being a good and optimized creation, I spaced everything out in order to make it easier to draw in the connectivity lines. You can most definitely make it more compact and faster as well.

A look back to the previous discussion, if you remember the full adder circuit, you will note it has 3 inputs. A, B, and a carry input. The circuit has two outputs, one being a true output and the other being a carry output. The way a ripple carry adder works is you have multiple full adders and connect the carry output to the next carry input. With this in mind, you can go a lot higher than 4-Bit by simply chaining more full adders, but expect a slower output as you go higher in bit count.

Before starting the design, it is important to note that because the first full adder does not and will not ever get a signal from its carry input, you can remove it altogether and use a half adder, which is much more compact, do note that you can only do this for the FIRST adder, and only the first.

Using the designs, but a bit spaced out, I created this structure for the circuit, this is where the logic is going to be placed.

As you can see, I reflected the adder in order to save the racer travel time.

Go somewhere, and set up a control panel, like this.

There is a good reason we have 5 signs for an output. A 4 bit number can be as high as 15, so adding two 4 bit numbers could result in a value as high as 30, and a 4 bit number cannot hold a value above 15. That's why we use 5 signs, for 5 bits of potential output.

Now lets hook up the first adder to its switches and its sign. Make sure to type a "1" in the output touchplate.

This first adder is pretty straight forward.

Now, lets connect all of the carry outputs to the next carry inputs.

Next, connect the second adder to its switches.

And the third adder.

And finally the fourth adder.

Lets now connect the first XOR gate in the three full adders.

And the second XOR gate, which is actually the true output gate.

Now to finish up the gates, here is the two AND gates, we have already connected the OR gates' outputs so don't worry about that.

This is the most important part, you WILL need a reset switch as some trapdoors are triggered by levers and touchplates, as such, they will be difficult to properly reset, the easiest solution is just to have a large timed lever at one second connected to all trapdoors. Additionally, you can use this large timed lever to reset the output signs to say 0.

And I believe that is it, well, except for the spawner, and that has a pretty obvious spot. (it goes at the start of the first adder)

I apologize for some of the darker screenshots, but you should still be able to see what goes where.

If you haven't figured it out, the output is also in binary, but I will leave it to you to find out how to translate binary to decimal.

structure.png

1307 x 773 - 949K

controls.png

1457 x 828 - 797K

first adder.png

1535 x 598 - 679K

carry out to next in.png

1419 x 903 - 1M

second adder.png

1476 x 537 - 727K

third adder.png

1458 x 908 - 984K

fourth adder.png

1524 x 895 - 882K

first xor gate.png

1398 x 798 - 949K

second xor gate.png

1394 x 998 - 1M

and gates.png

1354 x 736 - 916K

reset switch.png

1496 x 1013 - 1M

3

## Comments

375Proud of you!

3,6832,2184,711This is awesome