Binary Code | Memory | CPU | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
|
0 | Turn the Light Off |
1 | Turn the Light On |
The normal programming process goes as follows:
The process is iterative as each program is written and tested.
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
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
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