Simple 1-Bit Binary Light Computer

                    

Binary Code   Memory   CPU
  
0000
  
P0
Q0
 


Simple 1-Bit Binary Light Instruction Set

0 Turn the Light Off
1 Turn the Light On


-- Description --

This simple computer uses a single bit instruction. A single bit can only take on two possible values. It's either on or off. We normally write these values as 1 (for on) and 0 (for off). This computer uses these instructions to turn a light (a red "LED" in this case) either on or off. In other words, a "program" for this simple computer is just a series of 1's and 0's which tell it when to turn the light on or off. All programs for this computer are written as a series of 1's and 0's in the "Binary Code" block. The program can be loaded into Memory with the "Load Program" button, and it can be run with the "Run/Stop" button. The CPU shows the program counter ("P") and the state of the output light ("Q"). This computer can hold up to 256 instructions. The controls are explained here:

The normal programming process goes as follows:

  1. Write or modify the binary program in the "Binary Code" block
  2. Load the "Binary Code" program into "Memory" with the "Load Program" button
  3. Run the program with the "Run/Stop" button or step through it with the "Step" button.

The process is iterative as each program is written and tested.


-- Sample Programs --


Simple Blinking Light:

This very simple program turns the light on and off over and over again. This program works well at almost any speed (instructions per second).

10


Strobe Light:

This program simulates a strobe light that turns on the light once every 10 instructions. This program works well at either 4, 8, or 16 instructions per second.

0000010000


Morse Code for SOS (... --- ...):

The Morse Code for "S" is "..." (dot dot dot).
The Morse code for "O" is "---" (dash dash dash).
So "SOS" is "...---..." (dot dot dot dash dash dash dot dot dot).
There's a pause between letters of 3 "dots" and a longer pause between each word ("SOS" in this case) of 5 or 7 dots.
Note that this program runs well at a speed of 8 instructions per second.

1 0 1 0 1
0 0 0
1 1 1 0 1 1 1 0 1 1 1
0 0 0
1 0 1 0 1
0 0 0 0 0 0 0

For reference, the International Morse Code from Wikipedia states:

1. A dash is equal to three dots.
2. The space between parts of the same letter is equal to one dot.
3. The space between two letters is equal to three dots.
4. The space between two words is equal to seven dots.

A is dot dash
B is dash dot dot dot
C is dash dot dash dot
D is dash dot dot
E is dot
F is dot dot dash dot
G is dash dash dot
H is dot dot dot dot
I is dot dot
J is dot dash dash dash
K is dash dot dash
L is dot dash dot dot
M is dash dash
N is dash dot
O is dash dash dash
P is dot dash dash dot
Q is dash dash dot dash
R is dot dash dot
S is dot dot dot
T is dash
U is dot dot dash
V is dot dot dot dash
W is dot dash dash
X is dash dot dot dash
Y is dash dot dash dash
Z is dash dash dot dot

1 is dot dash dash dash dash
2 is dot dot dash dash dash
3 is dot dot dot dash dash
4 is dot dot dot dot dash
5 is dot dot dot dot dot
6 is dash dot dot dot dot
7 is dash dash dot dot dot
8 is dash dash dash dot dot
9 is dash dash dash dash dot
0 is dash dash dash dash dash