computer program
General purpose computers are machines to
execute programs. Programs make the computer into a particular
machine. Every different program makes it into a different machine.
The program code that feeds the computer is coded
binary numbers. The size of the code depends on the bit size of the
computer. There are 4 bit calculators, 8, 16, 32 and 64 bit computers.
A computer is full of boxes, (registers) of the bit size of the
computer. The task of the program is to move numbers from register to
register and do logic or arithmetic with them.
(A modern computer is so stuffed with operating system and stuff that
you cannot see the computer registers any more. Nor can you write much
program that talks to the computer. You write the program to talk to
windows.) There are however microcontrollers, small, single chip
computers that you can program in their native language.
Here is a tiny sample of code and its assembly
language. This is a PIC 16X54 microcontroller. I will select a segment
that adds two numbers.
... (lots of code here)
211 MOVF R,W
1D0 ADDWF I,0
033 MOVWF Out
... (more code here)
The left column is the actual machine code. The
other columns are the assembly language. Another program reads the
assembly language code and produces the machine code. That is all the
computer that executes this code sees.
In the old days, when the computer was new, we
coded directly to the machine. We had no assemblers. We would have
written ...211,1D0,033... just like that.
Still later we moved up to compilers. Now we could
write the essential arithmetic, Out = I + R and have a compiler
program convert that to ...211,1D0,033... directly.
Note that the native language, the machine language
of Hal algebra is equal to the compiler code of the computer.
Out = I + R is the machine code in Hal algebra. There is, of course,
an assembly language for Hal algebra also. We could say
Out = ptree(I,R) where ptree could be a long list.
Computer programs are sequential. They are performed in the order they are presented. There are control commands to change the sequence of computer programs.
Hal algebra has no sequence control because there is no sequence. All the codes of Hal algebra operate at the same time, all the time.
In Hal algebra a computer is a single sensor (fetch) and a single primitive motor (decode). Fetch works on the memory, which has been stuffed with programs and data. It makes little data streams from the code and data and sends them to decode. Decode is a primitive motor doing if-then logic. The world now runs on this stupid hardware.
[ Return home ]