Welcome to MG SuperCalc home page


[In case of loading problems, please read the note about reloading applets]

About MG SuperCalc

After some days of brewing, MG-SOFT is proud to present the MG SuperCalc applet. This is our first non-trivial encounter with the Java(TM) programming language, so we are especially proud of it. And we hope that at least some of you out there in the cyberspace might find it useful...

MG SuperCalc archive (which contains all necessary files for running the applet in your local environment) is available for downloading from our download page.

Information about MG SuperCalc is summarized in the following sections:


Home - News - Profile - Products - Download - Pricelist - FAQ - Partners

What makes MG SuperCalc better than other calculators

There are few features in MG SuperCalc that are not common in other calculators.

One of them is MG SuperCalc's ability to handle arbitrarily long numbers in each, hex., dec., oct. and bin. radix notation. This means that you will never get the Result is too large message which you can get from other calculators.
Just go on and summarize all your stock market profits... you can't be so rich that MG SuperCalc wouldn't be able to handle your fortunes up to the last tiny coin you own.


You won't get that message from MG SuperCalc

Another feature is high degree of parallelism. Calculators usually aren't multithreaded. MG SuperCalc involves high degree of parallel calculations. Please read the How MG SuperCalc operates internally section for details.

[MG SuperCalc] [Contents]


How to operate MG SuperCalc

As long as you handle small numbers, operating MG SuperCalc isn't much different from any other calculator. But when you start working with HUGE numbers you might also start to feel some difference. First of all, normal calculators simply won't handle HUGE numbers. MG SuperCalc will do it nicely, but the larger are numbers, the longer it takes to crunch them in the NumberCruncher class and delays can become notable. These delays can bring some specific flavors in calculator's behavior.

In case of long calculations, the user can type-ahead its input while other MG SuperCalc's activities are performed in the background. If calculator is in the edit mode (the underscore ( _ ) character is appended to the number on the display), MG SuperCalc won't ship its result to the display, even if calculation has been completed while the user is editing the input number. If you're going to use MG SuperCalc seriously, we suggest opening the Java console window since every result that is supposed to be shipped to calculators display is always shipped also to that window.

If the number on the display doesn't fit, MG SuperCalc activates horizontal scroll buttons ([<<], [<], [>] and [>>]) so that you can view it all by scrolling it left or right. Single arrow buttons scroll the contents of the display for one digit while the [<<] button displays the beginning of the number on the display and the [>>] button displays its tail.

If calculator is in the edit mode (the underscore ( _ ) character is appended to the number on the display), you can erase the tail of the number by using the [Back] button. The [CE] button erases the whole contents of the display, while the [AC] button, besides erasing the whole contents of the display, also shuts down all threads that might be performing any internal calculations and finally invokes the garbage collector.

Please note that MG SuperCalc won't stop threads performing calculations if you leave this page (on purpose!). So if you want to be sure that MG SuperCalc is not using your precious CPU cycles, please push the [AC] button on MG SuperCalc which will shutdown all active threads and release all CPU resources taken by the applet. Otherwise you can give MG SuperCalc a job to do and in the meantime you can go and do some surfing, after some time return to this page and the most probably you will find results of Calculation waiting for you.

[MG SuperCalc] [Contents]


Boosting performance

All numbers are internally represented with StringBuffer class. That means that crunching HUGE numbers may take some time. But there are at least two possible approaches to boost the performance.

The first solution would be to run MG SuperCalc on multi-processor host (in case that Sun's already fixed libraries to enable applet threads riding more CPUs simultaneously?).

The other solution is much simpler and cheaper. You can disable animation (spinning balls) by simply clicking on the animated area of MG SuperCalc. If you do so, the stand changes its color from yellow to gray. You can again enable the animation by clicking the same area once again, and the stand will change its color from gray back to yellow.

[MG SuperCalc] [Contents]


How MG SuperCalc operates internally

The core of calculator is implemented as a finite-state machine (FSM) with an input data channel for delivering user input and an output data channel for shipping results to the display. Data channels have been implemented with active queue data structures since they must perform input balancing, so the user can type-ahead its input regardless the FSMs activity.

FSM runs in a single thread (only one calculation can be performed simultaneously). Besides, FSM has been designed for performing calculations only on numerical input in binary radix.

Parallelism in MG SuperCalc has been achieved in data channels by using active objects (active queue items). When an item containing a number is enqueued, it starts recalculating the number from the given radix to required radix. Items can perform this calculations simultaneously, each in it's own thread.

While in the input queue, each active item has to convert its numerical input into binary radix accepted by the FSM and while in the output queue, each active item has to convert the FSMs binary output into whatever is the current radix mode selected by the user.

[MG SuperCalc] [Contents]


What the animation animates

When you understand the internal data flow and operations in MG SuperCalc, you may find its animation more intuitive.

The animation area of the applet consists of three towers which are used as axes for spinning balls around them. Each spinning ball indicates activity of one or more threads in the applet. Of course, short-life threads usually don't get animated.

The leftmost tower in the animation area indicates activity of the input data channel (converting user inputted numbers into binary). If one ball is spinning around that axis it means that one item in the data channel is active (performing the calculation). In case of two spinning balls around that axis, two items are active and in case of three spinning balls, three or more items are active.

The middle tower indicates activity of the FSM. In this version, at most one ball can spin around that axis since FSM runs in a single thread.

The rightmost tower indicates activity in the output data channel (preparing FSM's results for shipping them to the display). If one ball is spinning around that axis it means that one item in the data channel is active (performing the calculation). In case of two spinning balls around that axis, two items are active and in case of three spinning balls, three or more items are active.

Animation can be disabled by clicking animated area of the applet. In that case, spinning balls will disappear and the stand will change its color from yellow to gray. By clicking animated area again, the animation will be activated (if any applicable threads are active, corresponding balls will appear and the stand will change its color from gray to yellow).

[MG SuperCalc] [Contents]


Platform independence

Unfortunately we were able to test the applet only on Windows 95 platform. We'd appreciate any information about MG SuperCalc's behavior on other platforms, especially those with more than one CPU. We wonder how it boosts its performance (and corrupts its appearance - just before publishing MG SuperCalc we have noticed that Sun's JDK V1.02 uses different default font for button labels which tends to reshape the whole thing)?

[MG SuperCalc] [Contents]


Things to be done

Few things are still missing:

[MG SuperCalc] [Contents]


Possible problems

Page faults

Calculations with HUGE numbers sometimes CRASHES the Java interpreter. We believe this is JDKs runtime problem on Win 95 platform (running out of resources?). Maybe the javai.dll's developers should check this case (or maybe it's just our problem, but we've failed to see the reason:-).

Anyway, the NumberCruncher class will soon be re-implemented by using simple char[] data structures (for internal number representation) instead of currently used StringBuffer class so this malfunction will be eliminated (probably). For the time being, if you're unlucky, you can get the following report before your browser finally collapses:

  appletviewer caused an invalid page fault in
  module JAVAI.DLL at 0137:10011e05.
  Registers:
    EAX=04e383b0 CS=0137 EIP=10011e05 EFLGS=00010293
    EBX=04e383b0 SS=013f ESP=051ef458 EBP=006b8148
    ECX=c107aaf4 DS=013f ESI=01393000 FS=2f07
    EDX=bffbf9e0 ES=013f EDI=01395c80 GS=0000
  Bytes at CS:EIP:
    8b 2b f7 c5 07 00 00 00 0f 85 ab 00 00 00 3b f5 
  Stack dump:
    006b8148 00000000 10011cc0 013981c8 
    00000000 0142c990 01692ffc 04e3ff64 
    013981c8 10017dda 006b8148 013981c8 
    00000000 00000000 005863b3 00000002 

Broken appearance

Sometimes graphical appearance get broken, which is a consequence of well known bug in JDK. It seams to be fixed in JDK V1.02. But JDK V1.02 brought some differences in default fonts and layouts, so the applet might not be displayed according to our wishes. We will fix that in future releases of MG SuperCalc.


Two examples of broken appearance.

Disabling animation

When disabling animation for the first time, applet sometimes doesn't respond promptly. We don't know what is the reason for that behavior?!?

[MG SuperCalc] [Contents]


Applet reloading

MG SuperCalc applet consists of 11 classes and one gif image in total size of about 34K. Thus it takes some time (and patience!) to load it from Internet into your browser.

If the applet doesn't seem to be loaded correctly (broken appearance) and if you are using the Netscape navigator , you can try to reload MG SuperCalc by holding down the SHIFT key on you keyboard and simultaneously selecting Netscape's RELOAD or RELOAD FRAME items from the VIEW sub-menu. If it doesn't work, you can follow other applet-reloading recipes presented by John D. Mitchell in JavaWorld.

For your convenience, you can also download the MG SuperCalc archive from our download page which contains all necessary files for running MG SuperCalc in your local environment.

[MG SuperCalc] [Contents]


Post Scriptum

Did we pass the audition?

[MG SuperCalc] [Contents]


Home - News - Profile - Products - Download - Pricelist - FAQ - Partners

Latest update: 25-May-1996. © 1996 by MG-SOFT Corporation