Forums - Open Redstone Engineers
cpu build competition 2.0 - Printable Version

+- Forums - Open Redstone Engineers (https://forum.openredstone.org)
+-- Forum: ORE General (https://forum.openredstone.org/forum-39.html)
+--- Forum: Build Discussion (https://forum.openredstone.org/forum-50.html)
+--- Thread: cpu build competition 2.0 (/thread-9484.html)

Pages: 1 2


cpu build competition 2.0 - jonay2000 - 02-27-2016

https://forum.openredstone.org/showthread.php?tid=5793&pid=47969#pid47969)
i saw this tread and thought: why dont we do it again, but make it a bit harder? it needs to be 8bits. the fastest cpu to do a sqrt-program or a square-program win, the program can be searched for on the internet. also you can build it on any moment you like, as long as it hasnt got prebuilt components. it does not have to be turing complete, a sqrtmachine is accepted too

ill partition a part of my plot to store all cpus at so they can be looked at by everyone, and a winner can be chosen.


1 last note: size does not matter, as long as it fits on a plot Tongue


RE: cpu build competition 2.0 - jonay2000 - 02-27-2016

sofar swiftkills and me are the ones who started


RE: cpu build competition 2.0 - ddthj - 02-27-2016

Judging by the fact that I was the only person to enter in the much easier first competition, I doubt this will go anywhere.


RE: cpu build competition 2.0 - LordDecapo - 02-27-2016

(02-27-2016, 07:34 PM)ddthj Wrote: Judging by the fact that I was the only person to enter in the much easier first competition, I doubt this will go anywhere.

#Callout
I'd join but i have like 1000000 projects going like i always do, plus i need a hair cut


RE: cpu build competition 2.0 - zSwifty - 02-28-2016

I quit, I cannot build a squaring/sqrting machine ;-; so I just finished BCPU3/BasiCPU3. Capo said he liked it Big Grin


RE: cpu build competition 2.0 - Iceglade - 02-28-2016

If you have addition and bit shifts, then software multiplication should be pretty much doable, right? (giving squaring in the process). Weirdly I don't actually think I ever saw software multiplication done though.


RE: cpu build competition 2.0 - VoltzLive - 02-28-2016

Billcharl, squaring/squrt isn't a hard thing. That's like an afternoon with some dedication.


RE: cpu build competition 2.0 - jonay2000 - 03-01-2016

(02-27-2016, 10:26 AM)jonay2000 Wrote: i finished my sqrt machine, it isnt software based, and does sqrt in about 8 secs if the approximation starts on 1 allways



RE: cpu build competition 2.0 - Magic :^) - 03-01-2016

(02-27-2016, 07:39 PM)LordDecapo Wrote: plus i need a hair cut

I've been needing a haircut for about 4 months now xD


RE: cpu build competition 2.0 - CrazyGuy108 - 03-02-2016

For the lazy, I found a decent sqrt algorithm online.

This one's in C++:
Code:
unsigned short isqrt(unsigned long a)
{
   unsigned long rem = 0, root = 0;

   for (int i = 0; i < 16; ++i)
   {
       root <<= 1;
       rem = ((rem << 2) + (a >> 30));
       a <<= 2;
       ++root;
       if (root <= rem)
       {
           rem -= root;
           ++root;
       }
       else
       {
       --root;
       }
   }
   return (unsigned short) root >> 1;
}

And this one, written in C:



Code:
uint32  // OR uint16 OR uint8  
isqrt32 (uint32 n) // OR isqrt16 ( uint16 n ) OR  isqrt8 ( uint8 n ) - respectively
                   // OR overloaded as isqrt (uint?? n) in C++
{  
   uint32 // OR register uint16 OR register uint8 - respectively  
       root, remainder, place;  
 
   root = 0;  
   remainder = n;  
   place = 0x40000000; // OR place = 0x4000; OR place = 0x40; - respectively  
 
   while (place > remainder)  
       place = place >> 2;  
   while (place)  
   {  
       if (remainder >= root + place)  
       {  
           remainder = remainder - root - place;  
           root = root + (place << 1);  
       }  
      root = root >> 1;  
      place = place >> 2;  
  }  
  return root;  
}
There could be faster ones I'm not aware of though.