Just like understanding
secret code, you have to know the key in order to understand the language of the computer.-------------------------------------------------------------------------------------
-------------------------------------------------------------
In computer language, the "letter of the alphabet" is the state of a switch, which can be ON or OFF. Groups of switches form computer "words," just as groups of letters, numbers, and the like, form our ordinary words and sentences and express information. For example, 1010 may have one meaning, and 1100 may have another. We are, of course, talking about a digital computer and how programs are modeled.
To encode information in a digital computer, you have to use ones and zeros, so you must know how they are packaged. That is, you must have the key to binary encoding. Different language structures can have different encoding rules and could interpret elements differently. To facilitate communication, though, it is most useful to have a standard. An American standard has in fact evolved and is known as ASCII. You can find a conversion table for English letters and many keyboard symbols here.
Value of Binary Switches
The value of binary switches as encoding vehicles is, they are easy to construct and their states can easily be distinguished electronically. This makes them useful for representing other things. Since a single switch has two states, it can be used to model or represent two different things. Strings of switches (words) can then be made to represent any number of things, enough, say, to build a training or study program.
-----------------------------------------------
The decimal system, as the name indicates, uses ten basic numbers, namely 0 through 9, and is therefore a ten-state system. To encode the decimals in binary, we need a group of at least four binary switches. The numbers 0, 1, 2, 3, etc., could then be converted into the binary switches using the binary numbers 0000, 0001, 0010, 0011, etc. (Since there are 16 clusters for a group of four bits, six of them would be available for other things.)
----------------------------------------------
Consider any decimal number, say 1329. This is just 1000 + 300 + 20 + 9, or 1*1000 + 3*100 + 2*10 + 9*1, which is the same as 1*103 + 3*102 + 2*101 + 9*100.
In comparison, the binary number 1011 is the sum of the binary numbers 1000 + 000 + 10 + 1, or 1*1000 + 0*100 + 1*10 + 1*1, which is the same as 1*23 + 0*22 + 1*21 + 1*20, or 1*8 + 0*4 + 1*2 + 1*1. The positions in binary, namely 8, 4, 2, 1, thus correspond to the decimal positions 1000, 100, 10, 1.
In this method of encoding, any other number in the decimal system could be represented by using groups of four switches. The decimal number 32, for example, could be shown by joining the groups for 3 and 2, namely 0011 and 0010, to get 00110010. The number 16 could be written as 00010110. Etc.
In a similar way, we can model words. First we set up a way of identifying the letters, which we can do simply by assigning combinations of bits to each of them. Words can then be expressed as binary sequences of the letter strings.
---------------------------------------------
You've probably figured out that ordinary languages are many-state systems. That is, each position in a string of characters can have many more than just the two values 1 and 0, or more than just two meanings.
In English, for instance, each position of a text can be any one of 26 letters, numbers 0 to 9, grammatical marks, a blank space, or special characters such as @, $. As I type out elements of a sentence, I could hit any one of these characters for each position.
To represent all these characters in the binary system, I need to combine enough switches to yield the necessary structures. Say there are 26 letters, 10 numbers, the blank space, and 30 special characters, for a total of 67 items. The group of switches must therefore provide at least 67 states, or 67 meanings. Since each switch has two states, we must use seven switches. The 67 characters could then be encoded as 0000000, 0000001, 0000010, 0000011, etc., to 1000111.
The trick is to find clever and useful ways to do the encoding, and this is true whether you are working with ordinary languages or computer languages.
---------------------------------------------
We can use the binary language to depict graphics, sounds, and motion pictures. For this we rely, again, on bits of information, or pixels. Starting with an analog picture, you would have to break it down into single-color elements. You do this by superimposing a grid so fine that you only have a single color in each element, a color that can be identified as a specific mix of the primary colors. The fact is that color is spatially distributed and any point of a painting can have only a single color (or shade of gray, if the painting happens to be rendered in black and white). By reducing the size of the grid element, this condition can be approximated more closely and in the limit will yield a single color or shade of gray.
In a similar way, sound and video can be converted from their analog nature to be modeled or expressed in a digital format using binary code. Video can then be dealt with as a sequence of digitized pictures. And sound can be subdivided strictly as a time-varying phenomenon.
In the opposite way, you can synthesize pictures, sound, or video by using binary information to describe each grid element in the product. It takes a lot of binary information to model the products, but pictures, sound, and video can then be digitally processed in any number of ways by modifying their data points. The problem to be solved by the synthesizer, as in all design, is to select the basic ingredients -- in this case the individual pixels -- that produce the desired results. More often than not, the process involves a lot of guesswork.
-----------------------------------------------
Separate packets of binary code can represent ordinary structures, and the representations could be manipulated much as the things themselves might. The correspondence between the real and the simulated depends on your needs and objectives.
In a simulation, for instance, it might be enough for your purposes to depict an object as a point. In this case, it would only be the point that moves around in your simulated space, but the point could carry with it a package of data defining its characteristics. A golf ball, for example, might be represented adequately in this way, though it's easy enough to use a circle. Properties of the golf ball, like position, velocity, mass, resistance in air, etc., can then be assigned to the point, or the circle.
In Visual Basic programming, for instance, you might assign properties, methods, and events to the object. This level of modeling would naturally sacrifice a large part of the object's pictorial detail, so it wouldn't give you much in the way of a display. But the approach could greatly reduce the computer memory requirements and make your computations a lot easier.
When the point representation is inadequate, you would have to develop component parts in detail. This might be the case with the human body, particularly when studying skills. For a rough approximation, you might use simple geometric figures to represent various segments of the body, as I show in Preparing the Optimization Studies. Models for the segments might then consist of a sphere (for the head) and a set of frustums (for the torso and the arms and legs).
------------------------------------------