An instruction set (also called an ISA - Instruction Set Architecture) is a language understood directly by a particular CPU. These languages are also called machine code or binary. They say how you tell the CPU to do different things, like loading data from memory into a register, or adding the values from two registers. Each instruction in an instruction set has an encoding, which is how the instruction is written as a sequence of bits.
Programs written in programming languages like C and C++ can't be run directly by the CPU. They must be translated into machine code before the CPU can run them. A compiler is a computer program that does this translation.
Machine code is just a sequence of 0s and 1s, which makes it difficult for humans to read it. To make it more readable, machine code programs are usually written in "assembly language". Assembly language uses text instead of 0s and 1s: You might write "LD A,0" to load the value 0 into register A for example. A program that translates assembly language into machine code is called an "assembler".
Here are some of the basic things a CPU can do:
Even very complicated programs can be made by combining many simple instructions like these. This is possible because each instruction takes a very short time to happen. Many CPUs today can do more than 1 billion (1,000,000,000) instructions in a single second. In general, the more a CPU can do in a given time, the faster it is. One way to measure a processor's speed is MIPS (Million Instructions Per Second). Flops (Floating-point operations per second) and CPU clock speed (usually measured in gigahertz) are also ways to measure how much work a processor can do in a certain time.
A CPU is built out of logic gates; it has no moving parts. The CPU of a computer is connected electronically to other parts of the computer, like the video card, or the BIOS. A computer program can control these peripherals by reading or writing numbers to special places in the computer's memory.
Each instruction executed by a CPU is usually done in many steps. For example, the steps to run an instruction "INC A" (increase the value stored in register A by one) on a simple CPU could be this:
Different parts of the CPU do these different things. Often it is possible to run some steps from different instructions at the same time, which makes the CPU faster. For example, we can read an instruction from memory at the same time that we decode another instruction, since those steps use different modules. This can be thought of as having many instructions "inside the pipeline" at once. In the best case, all of the modules are working on different instructions at once, but this is not always possible.
Modern CPUs often use a memory management unit (MMU). An MMU is a component that translates addresses from the CPU to (usually) different RAM addresses. When using an MMU, the addresses used in a program are (usually) not the "real" addresses where the data is stored. This is called "virtual" (the opposite of "real") memory. A few of the reasons why it is good to have an MMU are listed below:
Multi-core processors became much more common in the early 21st century. This means that they have many processors built on to the same chip so that they can run many instructions at once. Some processors may have up to sixty-four cores, like the upcoming AMD Epyc "Milan" series. Even processors for consumers have many cores, such as the 16-core AMD Ryzen 9 5950x.
Some processors have a technology known as multithreading. This is the task of running more than one "thread" of instructions in an operating system. Many modern processors use this to boost performance with heavy multi-threaded programs, such as benchmark programs.
The following companies make computer CPUs:
Running of the Bulls
The Running of the Bulls (in Spanish el encierro, meaning "the enclosing") is an activity that involves running in front of bulls on a course of a sectioned-off area of a town's streets. It is done all around Spain, but the most famous running of the bulls is in Pamplona. In most bull runs the bulls are not killed, and they live for a whole season. This is a dangerous activity but very exciting. Safety varies in some places like Xabia the area is surrounded by cages that people can slip in and out of but the bulls can not.
Red shift
Red shift is a way astronomers use to tell the distance of any object that is very far away in the Universe. The red shift is one example of the Doppler effect.
The easiest way to experience the Doppler effect is to listen to a moving train. As the train moves towards a person, the sound it makes as it comes towards them sounds like it has a higher tone, since the frequency of the sound is squeezed together a little bit. As the train speeds away, the sound gets stretched out, and sounds lower in tone. The same happens with light when an object that emits light moves very fast. An object, like a star or a galaxy that is far away and moving toward us, will look more blue than it normally does. This is called blue shift. A star or galaxy moving away from us will look more red than it would if the source were not moving in our frame of reference. This is where red shift got its name, since the colors are shifted towards the red end of the spectrum.
The reason astronomers can tell how far the light gets shifted is because chemical elements, like hydrogen and oxygen, have unique fingerprints of light that no other element has. Astronomers use spectroscopy to analyse the light from an object (galaxy or star}. Once they know that, they check to see the difference between where the spectral lines are compared to where they normally are. From that, they can tell whether it is moving toward us or away from us, and also how fast it is going. The faster it goes, the farther the spectral lines are from their normal position in the spectrum.
Spectral line
A spectral line is the way scientists can tell one element from another by looking at color.
In order to understand spectral lines, color has to be understood. In a rainbow, the colors of light go from purple to red. Several hundred years ago, the famous scientist Isaac Newton did an experiment where he showed that even white light from the Sun was made up of all the colors of the rainbow. When other scientists following him looked at this rainbow very closely, they noticed that there were dark lines breaking up the rainbow, where certain shades of colors should be. These lines were very small, but could be seen when the rainbow got stretched out very far. They investigated this further, and discovered that certain chemical elements, like the hydrogen and helium that make up the Sun, absorbed certain frequencies of light where those colors should be, like a sponge absorbs water, but does not absorb chalk.
Soon, scientists discovered that when they heated other chemical elements, like calcium and oxygen, so hot that they shined with a white light, they found similar lines, but in different places. No two chemical elements had these lines in exactly the same places along the rainbow, and they also soon discovered that could be used to be able to tell what stars were made up of in the Universe. The lines that a particular element produces are called the emission spectrum of that element.
The reason the chemical elements can do this is because of the number and places of electrons orbiting around the center of each atom of each chemical element. These electrons, when light hits them, absorb a specific wavelength, or color of light, and what color they absorb depend on their position around the atom. Since each chemical element has a certain number of electrons, each chemical element has this unique set of spectral lines.