Steampunk Binary Clock

Instructions

True Binary Time divides the day into 65,536 seconds represented using 16 bits. Each binary second is approximately 1.32 regular seconds. The four most significant bits at the top-right of the face show the binary hour (0-15), the next 8 bits taking up the bottom-half of the face represent the binary minute (0-255), and the last four bits at the top-left show the binary seconds (0-15). This means that the day is divided into 16 hours, each hour is divided into 256 minutes and each minute into 16 seconds.

Binary time is displayed as a single 16 bit binary number which shows the number of elapse seconds in the day: 1011111110011000. To make reading easier it can be divided into binary hours, minutes and seconds like this: 1011:11111001:1000. This implementation of the binary clock also offers an English phrase to describe the approximate binary time: 111 Minutes To 1100, which would be spoken as "One one one minutes to one one zero zero." You can, of course, translate this into decimal as "7 Minutes to 12".

There are two notes on the binary time phrase. First, the binary numbers are shortened to the most significant set bit, this means that 0100 becomes 100 and 0001 becomes simply 1. Second, the "Minutes To" notation adds one minute to the total remaining minutes - this is because the minutes in the last half of the hour are rounded up so that the last minute in the hour will not be described as being "0 Minutes To".

On the hour the clock chimes in binary. There are actually five chimes for each hour instead of four, the first chime always represents 0, from this one can then judge the value of the following chimes. In this case a low chime represents 0 and a high chime 1. So the hour 1011 will chime low-high-low-high-high.

The quickest way to judge the time of day is to examine the four binary hour bits:

Binary Clock hour bits.

The Most Significant Bit (marked MSB) will be 0 from midnight until noon and will then be 1 from noon until midnight. The next bit divides these two periods in half so that 00 will be the first quarter of the day, 01 the second quarter, and 11 will be the last. The next two bits introduce two more divisions with the smallest being 1/16 of the day.

To make a rough translation into regular time the binary hour bits can represent numbers of regular hours to be summed. Starting with the MSB the bits represent 12hrs, 6hrs, 3hrs and 1.5hrs regular time. So the binary hour 1011 shows 12hrs + 3hrs + 1.5hrs = 16.5hrs or 16:30 in 24 hour time. The first two minute bits represents the binary half hour which is about 45 regular minutes and the binary quarter hour which is about 22.5 minutes, so 1011:11 becomes 16:30 + 45mins + 22mins 30secs = 17:37:30 regular time.

Beyond this the translation starts to get tricky. The next most significant binary minute bit represents 11.25 regular minutes, and the next is 5.625 minutes, and so on. All of these would have to be taken into account to approach something close to the regular 24hr time.

Controls

Binary Clock controls.

There are five controls for adjusting the binary time.

LOCAL
Resets the clock to the default local time (based on the time used by your operating system) and restarts the clock.
STOP/START
Halts and restarts the clock for more accurate adjustment.
MIDNIGHT
Stops the clock and unsets all of the bits to represent midnight. Clicking again will set all of the bits to show 1 second to midnight.
24hr Clock
Changes the clock's binary time display based on 24hr time. Use the arrows above and below the hours, minutes and seconds to adjust the regular time accordingly.
Bits
Adjust the binary time directly by clicking on the individual bits around the face.

The two other controls are:

SOUNDS
Mutes the ticking and chimes.
POSITION
Adjusts the rotation of the clock. There are three positions, the default position 1 being the rightmost button. Position 1 places the MSB at the top of the clock. Position 2, the middle button, places the MSB and Least Significant Bit (LSB) at the some angle from the top of the clock which also "straightens" the markings on the clock face so that the binary minute bits occupy only the lower half of the face. Position 3 places the LSB at the top.

Embedding

This is the HTML for embedding the clock:

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="478" height="478">
<param name="movie" value="flashfiles/binclock.swf">
<param name="quality" value="high">
<param name="bgcolor" value="#FFFFFF">
<param name="wmode" value="transparent">
<embed wmode="transparent" src="flashfiles/binclock.swf" quality="high" bgcolor="#ffffff" width="478" height="478" name="binclock" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>
</object>

You should upload the clock's SWF file to your server and change the paths to the file accordingly.

There are three flashvars for use when including the clock in web pages.

muteSounds
Set this to 1 to start the clock with the sounds disabled.
setPosition
There are three values for this. 1 is the default position with the MSB at the top. 2 places the MSB and LSB at equal angles from the top. 3 places the LSB at the top.
startTime
This is the 24hr time that the clock will start with. The time should be in the format HH:MM:SS. This time is treated as a user-defined time meaning that any use of the time adjustment buttons, inluding the LOCAL button, will override this time.

To use these variables they should be added to the above code as both a param value and as an attribute in the embed tag in the form settingName=value. All three settings can be included by separating them with an '&'.

<param name="FlashVars" value="muteSounds=1&setPosition=2&startTime=12:00:00">

<embed flashvars="muteSounds=1&setPosition=2&startTime=12:00:00" [...]></embed>

You may link to the file on this server if you really must, just remember the golden rule of hot-linking: if you don't control every element on your web page then you don't control your web page at all.