Shop OBEX P1 Docs P2 Docs Learn Events
Will the universe oscillate? A pitfall — Parallax Forums

Will the universe oscillate? A pitfall

ErNaErNa Posts: 1,752
edited 2010-06-04 20:32 in Propeller 1
There is an ongoing discussion, if the big bang is a single event or if the universe will shrink again and the whole thing starts over. So, if silicon structure keep on shrinking, there is a chance to survive the collapse after expansion of the univers finishes. smile.gif

If not, if everything comes to an end, we could enlarge the counter of the propeller to 64 bits. This allows to count to 10^19 counts. 100MHz = 10^8 cnts/s, so we can count 10^11s. One year has about 3*10^7 seconds. so we have in the range of 10^4 years to wait, until the counter overflows. Seeing this and taking into account, that clock speed will increase, it is better to have a 96 bits timer counter. That will give us another 10^9 factor,, what makes 10^13 years. As the universe exists now for about less than 10^10 years, there is a 10^3 margin, what should be sufficient.

Anyway, a 128 bit counter will give a solution even for the case, that such an oscillation is ongoing.

I thought about this, because there are to ways to have a time out loop:

Timer:=0
Duration:=1
start.thinking

repeat
  if  cnt > timer
    think_a_bit
    timer += Duration

or:
Timer:=0
Duration:=1
start.thinking

repeat
  if (cnt-timer) > 0
    think_a_bit
    timer += Duration

Now, that I had time to wait, and as the 32 bit counter overflows after 53 seconds, and this happens often enough, I prefer the second version.

Have a great day, ErNa

p.s.: Did anybody take a look, if the counter is initially not zeroed? That could be seen as a hint that there was something in the past

cmapspublic3.ihmc.us:80/servlet/SBReadResourceServlet?rid=1181572927203_421963583_5511&partName=htmltext
Hello Rest Of The World
Hello Debris
Install a propeller and blow them away wink.gif

Comments

  • MagIO2MagIO2 Posts: 2,243
    edited 2010-06-04 12:11
    My 2 cents:
    There should not be a difference in both versions except that the subtraction in case one is done implicitly, whereas in the second case the subtraction is done explicitly ... and you have an additional implicit subtraction (result of cnt-timer) - 0. If you compare 2 variables the SPIN interpreter will subtract value2 from value1 allowing to set the C and Z flag. The combination of the flags tell whether the value is smaller, bigger, equal .....

    But to be honest ... I don't get the point what this whole thing is good for?! What is think_a_bit?

    What happens when the sign of cnt switches? cnt will go up from 0-$7fff_ffff. The next increment will set the sign-bit, so the resulting number is negative. '>' can't be true from there on as the greater than operator is working with signed numbers, isn't it?

    I think that this code is not extending CNT to 64 bits, is it?

    I'd think that the best way to extend the CNT is to use counters. Counter A can be driven by a fraction of the clock-frequency. So you already extend the counter this way. If you need even more bits you can let counter A drive a pin which is then input of counter B.

    The bigger problem is reading the correct value, as this operation would not be atomic. This means it can happen that you read the first part and then an overflow occurs to the next part.
  • MagIO2MagIO2 Posts: 2,243
    edited 2010-06-04 12:38
    BTW ... it would be a cool idea to put a lot of propellers inside of a time machine. And when the propellers are shrinked to the size of ... well ... say a flea by the gravity of the "gnab gib", the time machine can send em back. Parallax then can put em on a breakout board -size of a DIP- having 1024 chips = 8192 COGs. That would be fun!

    ;o)
  • nicolad76nicolad76 Posts: 164
    edited 2010-06-04 12:44
    Mayas say that the world will end on 2012 so why bothering??? [noparse]:)[/noparse]
  • heaterheater Posts: 3,370
    edited 2010-06-04 13:42
    nicolad76: "Mayas say that the world will end on 2012 so why bothering..."

    I don't think they did. That's just where their calender stopped.

    The world will actually end on Tuesday, January 19 2038. at 03:14:07 GMT.

    www.rediff.com/money/2005/may/06linux.htm

    Perhaps the Mayas had a similar problem, just ran out of digits[noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • BradCBradC Posts: 2,601
    edited 2010-06-04 14:10
    heater said...

    The world will actually end on Tuesday, January 19 2038. at 03:14:07 GMT.

    Your world might stop but I've got a planned migration to ensure I'm 64 bit by then [noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "I mean, if I went around sayin' I was an emperor just because some moistened bint had lobbed a scimitar at me they'd put me away!"
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2010-06-04 15:13
    BradC,

    That date (at least the year) also coincides with the 1-mile wide asteroid the Earth has a date with in 2038. ...but first things first, some of 'our brightest minds' are trying to plug an oil leak in the Gulf, no time to think about a silly asteroid. Just wait until some of the solutions come pouring in for that one :-O

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 6/4/2010 3:23:48 PM GMT
  • heaterheater Posts: 3,370
    edited 2010-06-04 15:32
    Bradc: "...I've got a planned migration to ensure I'm 64 bit by then..."

    Hmmm. That must mean a 64 bit version of BST compiling for the 64 bit Propeller VII.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • kwinnkwinn Posts: 8,697
    edited 2010-06-04 16:01
    The end of the world has been predicted so many times I'm surprised that even the worlds village idiots pay any attention to such predictions.

    Now a 64 bit Propeller would be a chip to fantasize and drool over. No more cog or hub memory addressing limitations, 64 bit I/O ports ( 2 per chip please ), and enough memory (minimum 64K per cog, 1Meg for hub. Oh, and 16 cogs would be nice too.
  • ErNaErNa Posts: 1,752
    edited 2010-06-04 16:02
    Maybe we find a way to guide the asteroid to the gulf to plug the hole? Make a smart asteroid with gps and winglets. Then there is only one questions: how to evaporate the moon to create an atmosphere, so the winglets can be functional wink.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    cmapspublic3.ihmc.us:80/servlet/SBReadResourceServlet?rid=1181572927203_421963583_5511&partName=htmltext
    Hello Rest Of The World
    Hello Debris
    Install a propeller and blow them away wink.gif
  • MagIO2MagIO2 Posts: 2,243
    edited 2010-06-04 16:07
    Isn't there a expiration date printed on a label by the manufacturer of earth?
  • ErNaErNa Posts: 1,752
    edited 2010-06-04 16:17
    Ok, honestly: comparing the difference to zero handles the overflow in the correct way, like waitcnt ( time += increment). Waitcnt just waits, but I wanted to do something else in the meantime. So the loop is running infinitely, but doing think_a_bit only now and then. Comparing CNT to a value, which was incremented worked quite well, and only quite seldom the program hang for some time. But that was not "mission critical". I just didn't search this bug. Next chance, next pitfall: now it was critical and first I had no glue, what's going on. Now it's clear!

    Never use : if a > CNT, always: if (a - CNT) > 0

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    cmapspublic3.ihmc.us:80/servlet/SBReadResourceServlet?rid=1181572927203_421963583_5511&partName=htmltext
    Hello Rest Of The World
    Hello Debris
    Install a propeller and blow them away wink.gif
  • JRetSapDoogJRetSapDoog Posts: 954
    edited 2010-06-04 16:59
    Dateline 2038: World exhales sigh-of-relief as radiation-hardened Prop VII-guided rocket impactor saves planet Earth from doomsday asteroid; World leader (with the exception of Britain) rewards 5th-grader who created it with a prop-powered puppy dogbot complete with functional GI tract. No plans as yet to prevent the universe from "rolling up" like a scroll as it speeds off into oblivion near the event horizon.
  • heaterheater Posts: 3,370
    edited 2010-06-04 17:20
    kwinn: "No more cog or hub memory addressing limitations...enough memory (minimum 64K per cog, 1Meg for hub."

    You are not thinking big enough for 2038. The Prop VII would have an extra 16 bits for each of the source and dest fields in an instruction. That's 16 + 9 = 25. That's 32 Mega LONGs per COG.
    HUB RAM will of course be humungous.

    Sadly though the Prop VII will still only have 32 I/O pins as that is all you can fit on a 40 pin DIP. Or they still haven't fixed that bug in the chip placement software.



    64 I/O pins is rumoured to be available on the Prop VIII subject to the world still existing at that time.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • ErNaErNa Posts: 1,752
    edited 2010-06-04 20:32
    Infinite memory is just one byte more than needed. Infinite clock speed: the program comes to an end during your lifetime!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    cmapspublic3.ihmc.us:80/servlet/SBReadResourceServlet?rid=1181572927203_421963583_5511&partName=htmltext
    Hello Rest Of The World
    Hello Debris
    Install a propeller and blow them away wink.gif
Sign In or Register to comment.