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?

Parts, Numbers and Pixels

How Computers Work: How does a computer work?

Read it with Peabody

A computer is built from parts that follow a program, and it turns a screen, a color and a song into numbers. This is a simplified picture, because a real computer has more parts. A picture on a computer screen is made of many tiny squares called pixels. A picture on a computer is stored as a long list of numbers. Computers turn real-world signals such as sound into lists of numbers too. Computers can squeeze pictures and sound into less space, which is called compression.

A bit is the smallest piece of computer storage, and it holds a 0 or a 1. Binary is a number system that uses only two digits, 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. Bits are used to store text, numbers, images and video. A file system organizes the bytes in storage into files and folders, and each file refers to a block of bytes.

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 instructions 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. The parts of a computer are connected by a set of wires called the bus. A GPU is like a CPU but specialized for images, and computer games use it heavily.

The CPU runs a program by repeating a cycle: fetch an instruction, then execute it. A machine code instruction is extremely simple, such as adding two numbers or testing whether a number is zero. Programming languages work by translation to machine code, and no single machine code instruction prints. A compiler can translate a program's source code into machine code ahead of time. Modern CPU chips have several cores, each a semi-independent CPU, but four cores are not four times as fast as one.

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. A computer copies a program from storage into RAM before it runs. RAM can fetch any byte in a few nanoseconds, and a nanosecond is one billionth of a second. A hard drive can be far slower than RAM: one college course says at least a million times slower. A hard drive stores a computer's bits as magnetic patterns on a spinning disk, and files that are saved on a computer's drive are still there when the power goes off.

Pixels sit on a grid. The origin (0, 0) is the upper left corner, x grows to the right and y grows going down. An image 800 pixels wide and 600 pixels high has 480,000 pixels, which is 0.48 megapixels. In the RGB scheme, each of red, green and blue light is a number from 0 (off) to 255 (brightest). Mixing lights to make colors on a screen works differently from mixing paints. Everything that is seen on a computer screen, even text, is an image that the device has been programmed to display.

Words to know

  • pixels: tiny squares
  • megapixels: million pixels
  • compression: squeezing data
  • compiler: code translator

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?