Game Development Reference
In-Depth Information
2.2 Computers and Programs
2.2.1 Processor and Memory
Computers consist of many different components, and discussing what each of these
components does and how the components interact could fill up this entire topic.
Generally speaking one could say that a computer consists of a processor and mem-
ory . This is true for all modern computers, including game consoles and mobile
devices. Memory comes in different varieties, mainly differing in the speed of data
transfer and data access. Some memory can be read and written as many times as
you want, some memory can only be read, other memory can only be written to.
The main processor in the computer is called the CPU (central processing unit),
but many computers and consoles have more than one processor. The most com-
mon other processor you find on a computer is a GPU (graphics processing unit).
Even the CPU itself nowadays is no longer a single processor, but often consists of
a number of cores.
Programs in real life— A 'program' is not something that is only written
to be executed by a computer. In daily life, many programs are written and
executed, if you are willing to broaden your definition of 'memory' and 'pro-
cessor'. A nice example of a program is a recipe for making an apple pie. The
values in the 'memory' in this case are the apples, flour, butter, cinnamon,
and all the other ingredients. The cook (or: the 'processor') then executes
all the instructions in the recipe which changes the values in the 'memory'.
After that, we have another type of 'processor': the person who eats the pie
and digests it. Other examples of daily life programs are directions for get-
ting to a place, logistics strategies for supplying supermarkets, administrative
procedures, and so on. All these things are long sequences of instructions
that—when executed—have a certain effect.
Input and output equipment, such as a mouse, gamepad, keyboard, monitor,
printer, and so on, seems to fall outside of the 'processor' and 'memory' categories
at first glance. However, abstractly speaking, they are actually memory. A gamepad
is 'read-only' memory and a printer is 'write-only' memory.
The processor on the other hand, is a very different beast. The main task of the
processor is to execute instructions . The effect of executing these instructions is
that the memory is changed. Especially with our very broad definition of 'memory',
every instruction a processor executes changes the memory in some way. Normally,
we do not want the computer to execute only one instruction. Generally, we have
a very long list of instructions to be executed. “Move this part of the memory over
there, clear this part of the memory, draw this sprite on the screen, check if the player
is pressing a key on the gamepad, and make some coffee while you're at it.” We call
such a long list of instructions that is executed by the computer a program .
Search WWH ::




Custom Search