Saturday, February 05, 2005

Web page and Flloating Point Updates

MOD 88 Web Page

I have a scheme worked out for controlling access to the MOD 88 web page. A single user will be able to log into the system and issue commands to control the boards via the controller page. That user will also receive frequent (1 second) updates of the board's image. I'll add an automatic logout after an idle period, to avoid having other users locked out.

Additionally, multiple users will be able to view the board's image, with a slower update rate (30-60 seconds) on an observer page. Current login status will be presented on that page, so users can switch from observing the system to controlling it once it's available.

This isn't intended as a perfect solution that can never be compromised – the assumption is that users will “play nice” and not deliberately try to work around the access control. Doing so would only result in a frustrating session, as multiple users interfere with each other by sending commands to a single set of boards.


Floating Point Bug Fix

Found a bug in the floating point subtract circuit. Sign calculation, when the exponents differ by more than 1, should be determined by the sign of the number with the larger exponent – period. It's been surprising to discover the relative difficulty of floating point operations: multiplication is in some sense easiest – add the exponents, multiply the mantissas. With everything normalized, you may need one final right shift. Division is similar, with only a possible left shift at the end.

Addition is more complex, since the exponents need to match before adding the mantissas. Thus, you may need to repeatedly right shift the mantissa of one number before adding.

But subtraction is hardest of all. Not only is there is possible need for multiple right shifts to make the exponents the same, but if the mantissas are close, the resulting difference may need multiple left shifts to re-normalize it. This added the greatest degree of complication to any of the floating point circuits, and it's in this circuitry where the sign error occurs. I have a fix, and will implement it this weekend.