Page 38 - Introduction to Programming with Java: A Problem Solving Approach
P. 38
4 Chapter 1 Introduction to Computers and Programming
What is GHz you ask? GHz stands for gigahertz. Giga means billion and hertz is a unit of measure that deals with the number of times that something occurs per second. A 2.5 GHZ CPU uses a clock that ticks 2.5 billion times per second. That’s fast, but a 3.8 gigahertz CPU is even faster—it uses a clock that ticks 3.8 billion times per second. A CPU’s clock speed provides a rough measure for how fast the CPU gets things done. Clock ticks are the initiators for computer tasks. With more clock ticks per second, there are more opportunities for getting tasks done.
Main Memory
When a computer executes instructions, it often needs to save intermediate results. For example, in calcu- lating the average speed for 100 speed measurements, the CPU needs to calculate the sum of all the speed values prior to dividing by the number of measurements. The CPU calculates the sum by creating a storage area for it. For each speed value, the CPU adds the value to the sum storage area. Think of memory as a col- lection of storage boxes. The sum is stored in one of memory’s storage boxes.
There are two categories of memory—main memory and auxiliary memory. The CPU works more closely with main memory. Think of main memory as a storage room next to the boss’s office. The boss is the CPU, and he/she stores things in the storage room’s storage boxes whenever the need arises. Think of auxiliary memory as a warehouse that’s across the street from the boss’s building. The boss uses the ware- house to store things, but doesn’t go there all that often. We’ll consider auxiliary memory details in the next subsection. For now, we’ll focus on main memory details.
The CPU relies on main memory a lot. It’s constantly storing data in main memory and reading data
from main memory. With this constant interaction, it’s important that the CPU and main memory are able
to communicate quickly. To ensure quick communication, the CPU and main memory are physically close
Apago PDF Enhancer
together. They are both constructed on chips, and they both plug into the computer’s main circuit board, the motherboard. See Figure 1.2 for a picture of a motherboard, a CPU chip, and main memory chips.
Motherboard
CPU chip
Figure 1.2 Motherboard, CPU chip, and main memory chips
main memory card with 8 memory chips