Facts

Grown-ups

Facts the Peabody Encyclopedia for kids

What grade are you in?

Real facts about everything, written for your grade.

What grade are you in?

Squeezing, Errors and Limits

How Computers Work: How does a computer work?

Read it with Peabody

This book follows how data is squeezed and kept safe, how early machines led to chips, and a limit on chip growth. It is a simplified picture, because a real computer has more parts. A computer is built from a few main parts, including a CPU and memory. A program is a list of instructions for a computer, and the processor in a computer follows the ones that a programmer writes. A computer's processor has two parts: the arithmetic-logic unit, a simple calculator, and the control unit that follows the program's instructions. The CPU of a computer can also add two numbers, and the parts of a computer are connected by a set of wires called the bus. The computer does not do anything automatically: some program code always tells it how. Modern CPU chips have several cores, each a semi-independent CPU, but four cores are not four times as fast as one. A GPU is like a CPU but specialized for images, and computer games use it heavily.

A bit is the smallest piece of computer storage, and it holds either a 0 or a 1. Binary is a number system that uses only two digits, which are 0 and 1. A byte is a group of 8 bits, and one byte can store one letter or other character, such as A or x. Each extra bit doubles the number of different patterns that bits can make, and a byte, which is 8 bits, can make 256 different patterns. Inside a computer, things such as pictures are stored with only 0s and 1s. A picture on a computer screen is made of many tiny squares called pixels, and in the RGB scheme, each of red, green and blue light is a number from 0 (off) to 255 (brightest). Everything that is seen on a computer screen, even text, is an image that the device has been programmed to display.

A machine code instruction is extremely simple, such as adding two numbers or testing whether a number is zero. Only machine code can actually run on the CPU, so source code written in a programming language must be translated first, and a compiler can translate a program's source code into machine code ahead of time. A source file lets you change a program, but the compiled machine code file lets you only run it. A CPU's machine code is hardwired into its design, and each family of CPUs has its own machine code. Loops and if-statements run because some of them jump back to an earlier point or skip the next instruction. In the fetch/execute cycle, the processor fetches an instruction from memory, decodes it to learn what to do, executes it, and repeats. Instructions can be stored as numbers too, an idea that led von Neumann and his collaborators to a general purpose, reprogrammable computer.

RAM is fast memory that holds the programs and files a computer is using right now, and it loses what it holds when the power is turned off. When a computer first powers up, the hardware runs a tiny boot loader program that lets an operating system start. The operating system is a supervisory program that starts first when the computer boots up. To launch a program, the operating system gives it an area of RAM, loads its first machine code there, and tells the CPU to start running it. The operating system gives each program its own area of memory, so that each program only reaches its own resources. One CPU can seem to run many programs at once by running a few instructions from each in turn, called round robin. A reboot wipes all the data from RAM and starts the operating system fresh, which can clear a fault in RAM.

Computers turn real-world signals such as sound into lists of numbers. Computers can then squeeze pictures and sound into less space, which is called compression. Lossless compression keeps all of the original detail, while lossy compression discards some detail. MP3 audio compression reduces the space needed by about 10 times and is lossy, discarding bits listeners tend not to notice. A raw 457 by 360 image has 164,520 pixels, and each pixel needs 3 bytes, one each for red, green and blue. A 800 by 600 pixel image takes about 1.4 MB in RAM, but its compressed file on disk is much smaller.

Errors can creep in when data is stored or sent. Data on hard disks, DVDs and flash memory can change because of a tiny fault, and error detection adds extra information to catch it. A bit can be held mechanically by wheel or lever positions, or electronically by voltage or current. In a chip, a bit is usually held in a memory cell, a circuit set to a high voltage for 1 or a low voltage for 0. A tiny fault in such a cell can change the bit it holds, which is why the extra information helps.

Charles Babbage designed several mechanical calculators in the 1800s, and a computer called the Analytical Engine. All digital computers rely on binary ones and zeros and on rules of logic set out by the English mathematician George Boole in the 1850s. Boole argued that just three operations, AND, OR and NOT, can perform all logic functions, but his logic had no practical use for decades until Claude Shannon applied it to telephone switch design in the 1930s. Relays are mechanical switches that are opened or closed with electromagnets. A vacuum tube is an electronic valve that lets a small signal control a larger one, and tubes could also be used as switches. ENIAC was built between 1943 and 1945, and it was the first large-scale computer to run at electronic speed with no slowing mechanical parts.

In 1947, John Bardeen and Walter Brattain built the first semiconductor amplifier. It was named the transistor. The first transistor was a sliver of germanium with two closely spaced gold contacts, and they were held in place by a plastic wedge. A small change in the current through one contact caused a larger change in the current at the other contact, so it amplified signals. It amplified its input signal up to 100 times. The 1956 Nobel Prize in Physics went to Shockley, Bardeen and Brattain for their research on semiconductors and for their discovery of the transistor effect. A transistor is a solid state switch with no moving parts, and it is turned on and off by an electric signal. A semiconductor is a material between a conductor and an insulator, and most semiconductor components are made of silicon. Transistors replaced vacuum tubes in computers.

Jack Kilby built the first integrated circuit in 1958 by etching transistor, capacitor and resistor elements on one germanium slice. By 1960, most transistors were silicon, which could work at temperatures up to 150 degrees Celsius. Integrated circuits made transistors, wires and other parts on one chip, using a process similar to printing, and microscopic transistors are etched onto a fingernail-sized piece of silicon to make a chip. Computer technology took off with the integrated circuit around 1960, and it took off again with the microprocessor in the 1970s, when a chip could hold a complete micro computer. A 12-core microprocessor chip shown at the Computer History Museum holds 1.8 billion transistors. Moore's law was a prediction, not a law of nature, that the number of components on a chip would double every eighteen months. Stanford's course says Moore's law will probably not go on forever, and that chip capacity doubles while speed does not.

Words to know

  • lossless: keeps all detail
  • lossy: discards some detail
  • compiled: machine code file
  • reboot: wipes all RAM

Read next

Sources

For grown-ups: Peabody has no ads, not one, and nothing to sell your child. The Kids Pick, an independent kids' directory, rates its games 90/100. See what other free kids' sites load Β· Grown-ups, sign in Β· Already have a profile?