The computer performs all processing by "calculating," "comparing" and "copying" the data read from storage and written into RAM (see storage vs. memory
Calculate - Compute Amounts and Keep Track
A computer can add, subtract, multiply and divide numbers to compute money amounts as well as geometric measurements of all variety. The computer's calculating capability enables it to keep track of its own internal iterations for all the tasks it performs.
Compare - Match One Set With Another
The computer can look at two sets of data and determine whether they are equal or which set is higher or lower in value. Comparing is performed for searching, analyzing and evaluating data for countless purposes.
Copy - From One Place to Another
The computer can rearrange data for organizing and reporting by copying data from one area in memory to another. In fact, in France and Spain, a computer is actually called an "organizer." See computer
It All Begins With Software
Compare to Find Things
No data processing can occur without first writing the program into RAM. This example is very conceptual, because real instructions are contiguous and in binary format, and there are thousands of them in a program. However, the checkerboard highlights RAM's "byte addressability," which allows each instruction to be extracted independently (this becomes clearer in the following examples). See byte addressable
This example counts all California records in the database by comparing every record in RAM. The bytes that hold the state are compared with "CA," and if equal, a "1" is added to the bytes that are designated a counter. Each record is written into the same bytes of RAM (memory buffer) and compared until the last record has been examined.
Copy to Display and Print
Compare and Copy to Sort
Data are stored as contiguous fields in a database but are rendered for humans by copying the characters into the desired order for display or printing. Dashes are not stored with the data. They are copied into the required locations for printing by the program (see picture
). Note that this is a pre-year-2000 example, which caused the world to spend a fortune correcting the previous shortsightedness (see Y2K problem
Copy and Calculate to Edit
Resequencing data is accomplished by comparing each item with the others and copying it into the appropriate order. There is also significant calculating going on to keep track of what goes where. Data records are generally indexed, and instead of sorting the actual records, the much smaller indexes are sorted (see index
Part of word processing's magic is copying. In this example, in order to insert the "O", the remaining characters are copied one byte to the right to make room. This illustration is very conceptual, and the actual process is a lot more complex, requiring calculating a lot of beginning and ending locations.