Decimal Multiplicative Adder - Printable Version +- Forums - Open Redstone Engineers ( https://forum.openredstone.org)+-- Forum: ORE General ( https://forum.openredstone.org/forum-39.html)+--- Forum: Projects & Inventions ( https://forum.openredstone.org/forum-19.html)+---- Forum: In Progress ( https://forum.openredstone.org/forum-20.html)+---- Thread: Decimal Multiplicative Adder ( /thread-5539.html) |

Decimal Multiplicative Adder - Apocryphan - 01-11-2015
This can add a 2 tick signal with only 6 ticks between each addition, it would've been faster if it weren't for the rapid 5 addition slipping from it's proper carry into a 5,0 pattern. It stacks and chains easily to increase the digits you can multiply. I have a hex version also, but i'm not at home and don't have the new layout memorized like i did this one, the hex version is a little slower (2 ticks i think) but it can easily replace the decimal cell in this to multiply in hexadecimal. The hex version will be nicer for converting to and from binary for those looking to add a multiplication function to their calculator. Multiplier Clock Hopper represents the Input Value, This is just a memory cell that will start subtracting 1 every 6 ticks after you input a value, and it will pulse every time the signal strength falls. I have an alternate version that pulses on the rising signal strength too, so that i can multiply by 16, although it's not necessary since that is more than any hex digit can hold. The Decimal Adder cell Blue wire is the carry wire, the logic in this is such. Right Blue: if x >= PLA then, Cancel white wire, subtract PLA from x and add. Left Blue: if x >= PLA then Reset cell to 10(0 inverted), add one to the carry Ram, the carry ram can hold a full carry of 9 which won't ever happen because you can't fit 10 in a single digit. In hex the full carry happens when multiplied by 16. If the input doesn't overtake the PLA then it is just straight up subtracted on the white wire and all is dandy. each digit is shifted appropriately, and then I combine the 2 values per digit using the same comparator logic for the carry. RE: Decimal Multiplicative Adder - Apocryphan - 01-11-2015
I plan to make a Hex to decimal converter with this, won't be too hard if i use set values for each digit to reflect the value of each hex digit and have the multiplier equal the value of the digit, i'd just be multiplying each digit and then adding them. edit: nvm just realized how tall that would have to be, the second digit would be as tall as the 2 multipliers and every digit after would need 2 multipliers as well, i may just work on a rollover carry for the carry ram and just setup a clock to input the current multiplier with the first value, followed by 16 x 2nd value, 256 x 3rd value, 4096 x 4th value, my only concern is surpassing the full carry when inputting, so it will take some playing around to make sure it has the capacity for it, or else i can maybe make it rollback and clear the carry before the next hex digit. Just wondering, but which way would you try for? Keep on adding rollover carries until it can keep adding multiplications without worry, or work on a roll back carry and clear after each digit to reset the carry ram. Another Display of it RE: Decimal Multiplicative Adder - Phase - 01-11-2015
that's better than my multiplier... but wait.... do you see it?.... you have a loop... ew.... RE: Decimal Multiplicative Adder - Apocryphan - 01-11-2015
loop? are you refering to the memory cells? or possibly the carry since it has 3 spots it can trigger? and thanks for the compliment. RE: Decimal Multiplicative Adder - Magic :^) - 01-11-2015
lol i think its reference to how the multiplier is combinational. Cool multiplier btw ^u^ RE: Decimal Multiplicative Adder - Apocryphan - 01-12-2015
Thank you the base can be adjusted using the hoppers, I haven't tested it but I'm sure this will go down as low as binary and up to base 15, hexadecimal needed some extra logic wires but i will add that to this post when i get home on an hour, might wait to post until tomorrow after i can wire up the carries so it's ready for copypasta! RE: Decimal Multiplicative Adder - Apocryphan - 01-12-2015
1 interesting detail i failed to mention is that this can easily be changed to add/multiply in any counting base except hex (requires more logic to get an imaginary number 16 but ive got another design for hex) simply by changing the value in 2 of the hoppers for each adder digit. Base 2 (binary) up to base 15. And here is a Pic of the hex multiplier, not as sleek and compact, and it is actually around 18 ticks per add, so it's almost half the speed too but it can accurately multiply in hexadecimal RE: Decimal Multiplicative Adder - Apocryphan - 01-15-2015
Got it down to a 4 tick gap without the carry slipping. Also made a subtractive by not inverting the output and disabling the output at 10 for 0 RE: Decimal Multiplicative Adder - Apocryphan - 01-18-2015
Cut it down to an add every 4 ticks, 2 on 2 off signal. Made an album with more details and extras. http://imgur.com/a/DJe7o If i can evenly split a solid signal i can double the input speed by using 2 of them, each taking half the input and combining them after calculated. which would drop it from 36 ticks to 18 ticks for when multiplying by 9. RE: Decimal Multiplicative Adder - Apocryphan - 01-19-2015
I can evenly split a solid signal into 4 different wires by adding a parallel signal with the wire number, it keeps the value even, going to work on adding the other 12 wires or just splitting the 2 wires and adjusting the wire # decoder for them. RE: Decimal Multiplicative Adder - Legofreak - 01-20-2015
I think you are addicted to comparators as much as I am... It's been a long time since I made my sequential hex adder but it wasn't nearly this fast... I think mine was a 2 tick pulse every 8 ticks. overclocking caused carry issues. I never bothered synchronizing it cuz it kinda hurt my brain at the time. Recently, I've been trying to imagine combinational multiplication but it all seems enormous in my head. RE: Decimal Multiplicative Adder - Apocryphan - 01-20-2015
If you only knew how far I went to find you... no one comparators to you and I when it comes to compares. I don't think i would've came here if i hadn't heard of you from greatgamer on reddit, i mean i knew of this place a long time ago but I was more survival redstone than redstone computing back then. oh, and when i first joined my imgur account only showed a limited amount i guess, so i upgraded and now all 55 albums show. http://apocryphan.imgur.com RE: Decimal Multiplicative Adder - Apocryphan - 01-21-2015
Well... I finally got my hexadecimal version compacted and sped up, i THINK i got it down to a 2 tick input every 4 ticks like my base 2 to 15 version, i had it adding 2, starting at 1 so it would always carry a 1 and count up in odd numbers, and it didn't seem to slip, not sure how i was able to do it with the extra logic needed, to get a base 16 signal strength for comparison i had to disconnect the carry if the value is 0, since 16 is too big for a single digit, and i had to add 1 to the pla to make it proper. The being said, it felt like i was going in circles for hours, spinning all the wire to try and fit it without any extra pieces or crossed wires. I gotta go to work soon but if anyone would like schematics, just let me know and i will make them after work. the orignal was 9 x 7 x 6 and the new one is 8 x 6 x 6, i guess it only looks way smaller because it has no carry ram, not sure how it stacks yet either. Edit: crap, just noticed i forgot to put a solid block instead of the first lamp, so the lights are off by 1... meaning it's even and it was slipping, so it can add every 6 ticks, i knew something was off, not sure if anything can be cut down from there. edit 2: k, well it isn't slipping but when adding evens, it doesn't jump from 14 to 0 before going past it up to 15, but it will maintain even/odd over the carry so this could still be a 4 tick throughput hopefully. RE: Decimal Multiplicative Adder - LordDecapo - 01-22-2015
(01-12-2015, 04:45 AM)Apocryphan Wrote: Thank you the base can be adjusted using the hoppers, I haven't tested it but I'm sure this will go down as low as binary and up to base 15, hexadecimal needed some extra logic wires but i will add that to this post when i get home on an hour, might wait to post until tomorrow after i can wire up the carries so it's ready for copypasta! Redstone and hex, is base 16 Also I do lIke this thing, great job All those comparators, remind me of the 16 digit Hex CLE that Aft and I made. I think (with inverters on B input for subtraction) is like a 15 tick total adder for equivillent to 64 binary bits. haven't touched in in a long while tho.. as I'm more of a binary person rather then hex XD RE: Decimal Multiplicative Adder - Apocryphan - 01-22-2015
Yea i know redstone is base 16 but a value of 15 will only make it base 15 so i had to disconnect the carry at 0 so adding 15 wouldn't carry and adjust the inverse +1 to get the proper carry, otherwise the pla for a value of 1 would show 14 even though its 15. And i saw what you and aft made, very impressive cle. RE: Decimal Multiplicative Adder - Apocryphan - 01-22-2015
To clarify further, i just needed a signal strength value of 16 to find the look ahead which is why extra logic was required, this isn't an issue when using hex binary because you make 16 with a 5th bit. RE: Decimal Multiplicative Adder - Apocryphan - 01-23-2015
Aaaand i just i realized that I can't use the same carry add wire to combine the Hex Multiplier that i used for the other because it needs that same pseudo SS16 logic for inverting to get the pla. shouldnt be hard but it means a few more ticks to the end, at worse an extra 4 ticks to output but doesn't affect the Calculation speed for the digits. RE: Decimal Multiplicative Adder - Legofreak - 01-23-2015
I'm not sure how you have it set up but you shouldn't need a theoretical ss16 for carrying on a base 16 multiplier. Lets say you have a current value of 14(E) and you add 7. You check if 14(E) + (7-1)=15(F). If true, subtract the inverse of the current value (~14=1) from (7-1), set that as the current value of that digit(6-1=5) and carry 1 to the next. Otherwise, add 7 to current value. X0 = output digit memory value Y = repeated input value ~X = compliment B = base number if (X0 + (Y - 1)>=B) X0 = (Y - 1) - ~X0, X1 = X1 + 1; else X0 = X0 + Y; I'm pretty sure that's how I made mine... RE: Decimal Multiplicative Adder - Apocryphan - 01-23-2015
I see what you did there, instead of adjusting the look ahead +1 you just did -1 to the input. RE: Decimal Multiplicative Adder - Apocryphan - 01-25-2015
Made a hex to binary converter out of the carry adder, not the fastest, more for shits n giggles, 8 ticks aint bad though, but outputs aren't synced, outputs highest to lowest. And i altered the input -1 and it will properly carry except for a carry 0, It's still synced since i just split the input wires, I've watched it and the reset happens at the same time the carry is input like it should, but for some reason the 1 tick balance catches the PLA and adjusts it to 1 instead of 0, every time no matter if its 15 + 1 or 8 + 8, and delaying the reset would probably affect the rest =/ I have the one with the adjusted pla for now, it was worth a shot though. RE: Decimal Multiplicative Adder - Apocryphan - 01-25-2015
Made a 2 tick hex to binary converter to redeem that slow one, but now i can decode fast enough to burn out torches, any solutions? RE: Decimal Multiplicative Adder - Legofreak - 01-25-2015
then dont use torches... RE: Decimal Multiplicative Adder - Apocryphan - 01-25-2015
but i wanna use the rest of this, since it's 2 tick synced, i can even send a solid 6 hex serial bus into it and it will keep up, it won't burnout unless you do 7 2 tick pulses iirc, so it essentially converts 1 wire hex to parallel binary. RE: Decimal Multiplicative Adder - Legofreak - 01-25-2015
So does the front one in my picture. It's a 2 tick synced torchless hex to binary. technically 4 ticks if you count the input comparator and output repeaters. but the logic is just 2 ticks. It can run at maximum speed indefinitely without burning out. it has long dust lines and as the power goes along it enables and disables comparators that are OR'd together for each output. RE: Decimal Multiplicative Adder - Apocryphan - 01-25-2015
well damn, the print makes it so simple... but i'm still gonna use this until the torches become an issue, the only way to burn 1 out is to alternate that signal 7 times, since each number has their own torches. I just tested it with a 19 hex signal and it was pretty nice to see it in action. RE: Decimal Multiplicative Adder - Legofreak - 01-25-2015
I have to say though, it looks like a handy design for random torch decoders. You could use it for various ROMS RE: Decimal Multiplicative Adder - Apocryphan - 01-25-2015
Indeed, or even a music player, although that would use alot of alternating signals. Might go torchless for that. RE: Decimal Multiplicative Adder - Apocryphan - 01-25-2015
borrowed an alternate to torches or pistons from my hard drive, so here is a solid state version so i don't need yours =P except yours looks a little shorter maybe, I'll probably make one off those plans too sometime You can carry the signals over and under and use this as an input/output selector Or make this into a 16 byte rom card with 2 hex outputs per input I will probably replace my hopper/dropper versions of this selector on my Hard drive, it'd reduce 2-3 ticks and i wouldn't have to lengthen the signal a tick in that decoder And in case you haven't realized what i'm all about. Hex, Signal Manipulation, Compact, Comparator, seamless stackables and tilables are what i go for in almost every build, and solid state and torchless are a goal too from time to time. My only regret is that it doesn't need any more comparators.. yet. RE: Decimal Multiplicative Adder - Apocryphan - 01-31-2015
sorry i got off track, had to add a few more things to my to do list... but i want to make this complete as far as this function and start working on add-on functions. So. WARNING: this build may contain analog signals and signal manipulation. you may see a comparator. Haven't labeled the wires yet, i got a single version of this working so i decided to proceed with making a 10 digit version, this will split a solid analog signal between 2 adders, adjusting the length of the solid signal to match the multiplier x 2 ticks. so any number x9 will be an 18 tick pulse of that value and will be split. after i get the pieces together some adjustments may be necessary but i have some room to adjust, this isn't even the smallest way to do this, i just haven't been able to play with comparators for a week. iii.... think i'll be adding some more comparators and labeling the wires before my next post. RE: Decimal Multiplicative Adder - Apocryphan - 01-31-2015
after posting, I noticed i guessed the spacing wrong, so it was too compact, after a bit of stretching and flexing it fits the decimal adder. now using 6 digits for each tracer (light blue) wire, making this a 12 digit input max. Dark green are the pulsers to input. light green is the multiplier value, acting as a hold to limit the length of the input. Sometimes things fit better than i could've planned, with 4 of them cascaded like this, the max multiplication is 12 digits x 4 digits. RE: Decimal Multiplicative Adder - Legofreak - 01-31-2015
I like the spline-y look of the Repeater lines. looks like ribbon cables when you have to cram them in a space that they dont want to fit in Edit: Recently I've been trying out sequential hex multiplication. So far I've assembled the circuitry to cross multiply two 4-digit hex numbers. Now I just need to figure out how to add the outputs together to get the final result. inputs. each digit goes to 4 of the 16 single digit multipliers something around 48,000 blocks All I need to do is figure a way to add the outputs together. the digits' denominations are sorted by color. red=least, magenta=greatest 8 digits max FFFF*FFFF=FFFE0001 I might need to make a thread for this... RE: Decimal Multiplicative Adder - Apocryphan - 02-01-2015
Damn, that looks nice, all you need is to add the remaining digits? I'm kind of stuck on how i should do the input, whether to have shifting memory cells on the back as a queue or to have a seperate queue to bus it in based on the function. just got 1 of the inputs timed so now i need to alter the rest and finish adding the reset wires, and then I'm where your at now, adding all the digits to make the output. quartz slabs lead to the reset inputs on the calcs Current stats: 1480 repeaters 5474 comparators (with 96 more to add) 6658 dust 65 torches 613 hoppers RE: Decimal Multiplicative Adder - LordDecapo - 02-04-2015
Call me dumb. But what do u do to find out how much of each item you have.. did u just WE a copy then do replace for each item and look at how many blocks it says it changed? RE: Decimal Multiplicative Adder - Chibill - 02-04-2015
Make it a schematic and use mcedit???? RE: Decimal Multiplicative Adder - Apocryphan - 02-04-2015
Open it in WE and select it all, on the toolbar where you find copy and cut you will also see analyze, this will tell you how many of each, some things it will give multiples, just add them, comparator and hoppers are also listed under entities and show the full count. RE: Decimal Multiplicative Adder - Legofreak - 02-04-2015
I just select it all in MC and use //count RE: Decimal Multiplicative Adder - LordDecapo - 02-04-2015
Omg... there is a //count command... Omg I must try this on IizR12 xD RE: Decimal Multiplicative Adder - Apocryphan - 02-09-2015
okay, well i'm slightly dissapointed no one pointed out my 1st input multiplier was way smaller. This oversized signal adjuster was more to show one of the simpler and larger ways to manipulate signal, but this is a slower way since i need to wait a few ticks for the values to flow into it, in reality it can be done with programmed loops. this way is faster because instead of lining up all the 2 tick inputs and splitting it, I simply use a self subtracting clock and have it subtract 2 each cycle and have 1 input trigger if the clock is 2 or more and have the other input if it is 1 or more. So when i multiply by 9 the input that triggers on 2 will input 4 times and the other will trigger 5. This method is faster also because the input starts once the multiplier is pulsed in so no other triggers are needed. Orange input is for the digit value and green input is for the multiplier clock. the other pics the colors are switched, sorry about that if it caused any confusion. This is more my style, doing the same function with fewer pieces. This same clock can be used to select specific Roms for unloading using more signal manipulation, I have a few setup already to unload 4 chosen rom #'s, I can subtract 4 per cycle to use an input of 15 to select rom's 15,11,7 and 3 in that order, i use a look ahead decoder to trigger the 0 so it will look for the number before 0 in your set, in this case it would be 4 since an input 12 would select 12,8,4 and 0, and have a 4 trigger the 0 right after. RE: Decimal Multiplicative Adder - Apocryphan - 02-09-2015
I hooked up the new multiplier input, both inputs can be pushed in at the same time and the reset is encoded for a soft reset when input with a 1, this will reset just the orange input memory, or a hard reset when input with a 2, this will clear orange memory and the adder and carry memory clearing the calculator. And instead of using 4 dual calculators for a 4 digit multiplier i'm going to use 1 dual calculator for every 2 digit multiplier otherwise the carry ram is only ever half-used. so if i stack 2 of these and have the top calculate the 1st and 3rd multiplier and the bottom does 2nd and 4th, and they work independently so they are not waiting for the other half, the only time it should take 20 ticks is if the multiplier has 9's in both the 1st and 3rd or in both the 2nd and 4th, otherwise a multiplier like 1991 will only take 10 ticks because once it multiplies the 1 it will go onto the 9 right away. these tick estimates are not including travel time, just input and calculation time. RE: Decimal Multiplicative Adder - Chibill - 02-09-2015
Is this a multiplier or an add? RE: Decimal Multiplicative Adder - Apocryphan - 02-09-2015
both, if you multiply by 1 it adds, but if you have a multiplier of 9 it will add that number 9 times, 5 times to the top adder using 5 2-tick pulses and 4 times to the bottom adder using 4 2-tick pulses, each input has 2 ticks between them so it looks like this. But if you wanted to just add with it you can, each digit can carry a full 10 over so it can handle the largest possible multiplication, I think i've actually thought of a way to make an analog divider using something similair to how i split the multiplier evenly. I still need to add a layer for subtraction to make it do 3 of the 4 operations. so far it's just add and multiply. RE: Decimal Multiplicative Adder - Apocryphan - 02-09-2015
Numbers were off since i forgot to include the 2 tick pauses, 18 ticks total input for 9 multiplier, although i could condense it and split it again reducing it to a 12 tick but wouldn't be cost effective IMO. But i may make a small one just for the fuck of it when im burnt out on the other projects, but i better finish my word first or else lorddecapo may crack the whip again. |