BINARY_TO_DECIMAL

This single page web application allows the user to click switches which each flip a single uniquely corresponding light bulb from "OFF" to "ON" and vice versa and, also, to click a BINARY_TO_DECIMAL button which computes the binary number represented by the light bulb array configuration at the time that button is clicked. Algebraic equations which are used to convert the base-two integer value represented by the sequence of eight light bulbs to that base-two integer's base-ten equivalent value are displayed at the bottom of this web page. (Clicking the RESET button will return this web page to its initial state such that each one of the eight light bulbs is set to "OFF" and all buttons on this web page are set to visible).

The binary integer value 0 is an abstract representation of the relatively physical "OFF" (insufficiently high voltage) light bulb state.

The binary integer value 1 is an abstract representation of the relatively physical "ON" (sufficiently high voltage) light bulb state.


Each one of the eight light bulbs displayed in the table below represents a particular power of two.

(N in the table below represents a nonnegative integer value no larger than seven).

While light_bulb_N is in its "ON" state, light_bulb_N represents two multiplied by itself N times.

While light_bulb_N is in its "OFF" state, light_bulb_N represents zero.


The nonnegative decimal integer value which the sequence of eight light bulbs represents is computed by adding up the nonnegative decimal integer values which each of those eight light bulbs represents.


The largest decimal integer value which the sequence of eight light bulbs can represent is 255.

The smallest decimal integer value which the sequence of eight light bulbs can represents is 0.

The total number of unique states which the sequence of eight light bulbs can represent is 256.


The largest binary integer value which any one of the eight light bulbs can represent is 1.

The smallest binary integer value which any one of the eight light bulbs can represent is 0.

The total number of unqiue states which any one of the eight light bulbs can represent is 2.


The rightmost light bulb has an N value of 0.

The rightmost light bulb represents the "lowest order bit" in the byte which the sequence of eight light bulb represents.

lowest_order_bit(ON) = 1 * (2 ^ 0) = 1 * 1 = 1.

lowest_order_bit(OFF) = 0 * (2 ^ 0) = 0 * 1 = 0.


The leftmost light bulb has an N value of 7.

The leftmost light bulb represents the "highest order bit" in the byte which the sequence of eight light bulb represents.

highest_order_bit(ON) = 1 * (2 ^ 7) = 1 * 2 * 2 * 2 * 2 * 2 * 2 * 2 = 128.

highest_order_bit(OFF) = 0 * (2 ^ 7) = 0 * 2 * 2 * 2 * 2 * 2 * 2 * 2 = 0.

N 7 6 5 4 3 2 1 0
light_bulb_N
bit_N 0 0 0 0 0 0 0 0
switch_N
 

???