Wednesday, May 21, 2008

Mechanics' Floating Point revealed

The eight bits in the pattern are used as follows:

S EEE MMMM

S is the "sign bit": 1 means negative, 0 means positive.

EEE are the "exponent": in "excess four" notation, meaning that the usual decimal interpretation of these bits is four more than the actual power of two. When all 8 bits are 0 the entire bit pattern represents the number zero. 001 means an exponent of -3 (i.e. a multiplier of 1/8), 010 mean -2, and so on, up to 111 which means an exponent of 3 (i.e. a multiplier of 8).

MMMM are the "mantissa": the fractional value which is multiplied by two to the exponent value. There is assumed to be a decimal point and a "1" bit to the left of MMMM. So, the pattern 0000 represents the fraction .10000 (i.e. 1/2). Similarly, the pattern 0001 represents the fraction .10001 (i.e. 17/32), and on up to 1111, which represents the fraction .11111 (i.e. 31/32).

In the table below, the exponent bit patterns label each of the columns. There are only 7 patterns because the bit pattern 000 means that the entire number is zero. This wastes some of the bit patterns because the entire 8 bits represent zero whatever bit patterns are present in the S and MMMM bit positions.

The mantissa bit patterns label each of the rows.

Each cell of the table shows the real number represented by the overall 8 bit pattern. Not shown are the negative numbers, which use the same bit pattern except for the sign bit.


This table can also be found at http://sanbachs.net/mfp/mfp.html.

Tuesday, May 20, 2008

Mechanics' Floating Point

Several years ago (Fall 1993) I gave a presentation at Novell, as part of their informal lecture series, named "Food For Thought." Somewhere in a dusty archive there may still be a VHS video tape of the presentation, which was entitled "My Computer Can't Add." I presented part of this again during a job interview at UVSC in 2001.

The idea of a computer not being able to add may seem odd. But, a computer doesn't actually deal with numbers, but only with representations of numbers. Except for some very simple and small numbers, the representations are not completely accurate. Part of the problem is round-off errors. The rest of the problem comes from the fact that the representations are far from being a complete set, as only some of the numbers are actually represented at all.

Until recently, personal computers only represented integers between -2147483648 and 2147483647. Granted, those aren't small numbers (as in "pick a number between 1 and 100"), but they aren't big enough to handle the national debt. Newer computers are using 64 bit processors, enabling them to represent integers between -9223372036854775808 and 9223372036854775807.

However, money values and numbers used in scientific computations are generally handled by the "floating point" representation. Here one can represent approximations to real numbers in a larger range than the integer representations provide, but giving up precision. The floating point representation generally uses either 32 or 64 bits, but uses the bits differently than the way they are used when representing integers.

To make this clear, I invented "Mechanics' Floating Point" for the purpose of my presentation. This uses a floating point style representation inside of just 8 bits to represent numbers between 1 sixteenth and 8 (well, almost--the largest number representable in the scheme is actually 7 and 3 quarters). Choosing 8 bits allows one to enumerate all of the representations possible in 8 bits (there are just 256 of them (see "Powers of two")).

In a subsequent post, I will try to find a way to display the entire representation of Mechanics' Floating Point.

Thursday, April 24, 2008

Falling while walking

I've had time to get over it now, but it was quite traumatic last Friday to fall down while walking.

It was early morning and I was walking to our condo from our motor home parked in a nearby lot. On one ordinary step, I twisted my left ankle. On the next step it gave way and I fell!

A perfect three point landing: left knee, right hand, and chin.

Got some road rash in all three places and tore out the left knee of my favorite jeans. So, I got a free pair of cutoffs out of the deal.

Everything is mostly healed by now, and the ankle was undamaged by it all.

Strange though, to fall while walking.

Tuesday, March 18, 2008

Dissertation Published

So, after dozens of hours of work, my 1995 dissertation is published on the Internet.

This work honors the hundreds of hours that I spent documenting years of work on the project itself.

The document on the Internet differs from the printed version in a few ways:
  • It isn't broken into pages, but there are separate HTML documents for each chapter and each appendix.
  • The bibliography isn't formatted yet.
  • The screenshots from TOOL are colored instead of black-and-white.
Otherwise, I've been very careful to leave in original mistakes, except for a handful of typo corrections. But nothing substantive.

So, it stands as it did in 1995. In some ways it is considerably out of date. But the main topic is still pertinent today. How to facilitate programming by end-users is still an open question.

Thursday, March 13, 2008

Golden Gate Bridge

Yes, we are back in the San Francisco area, even though we had a bad experience here only two and a half months ago.

But, we only drove into San Francisco today because I missed the exit at the north end of the Golden Gate Bridge. Did a quick u-turn at the south end and drove back to the Vista Point parking area at the north end.

Then we proceeded to walk the length of the bridge from north to south (8,981 feet!), took a brief rest on a bench, ate an ice cream bar and walked all the way back. Two hours of very pleasant workout.

At the very middle of the longest span, where the suspending cable is lowest, I was able to reach up and touch it. What fun!



Otherwise, we're just hanging out, enjoying a beautiful location, surrounded by vegetation and bird song. Barbecued suppers. Good company.

Finished converting Chapter 3 of my dissertation.

Monday, March 10, 2008

Sausalito

In case you don't know where it is, Sausalito is just north of San Francisco: the first town after the Golden Gate bridge.

And that's where Sara and I are located right now. We are house-sitting, enjoying the home of a friend of a friend, who is herself whale-watching in Mexico.

We had a long but uneventful drive yesterday from Elko, Nevada, having arrived there the night before, after Andrew's birthday party. Hard to believe he will soon be 19.

I have now published Chapter 2 of my dissertation.

Saturday, March 8, 2008

Painful Times

Not being allowed to defend my dissertation was a painful time. But, there is no point in belaboring that now.

Whatever the reasons my adviser and the department had for their decisions, I am going ahead with my own decision to self-publish the dissertation on the Internet.

It is proving quite painful to convert WordPerfect documents into HTML documents. Microsoft Word helps a bit, but doesn't do a very good job of rendering the images. I'll work more on those as time permits.

In the meantime, I've finished the first cut at converting Chapter 1.