Central processing unit

A Pentium CPU inside a computer

A central processing unit (CPU) is an important part of every computer.[1] The CPU sends signals to control the other parts of the computer, almost like how a brain controls a body.[2]

The CPU is an electronic machine that works on a list of computer things to do, called instructions. It reads the list of instructions and runs (executes) each one in order. A list of instructions that a CPU can run is a computer program.

The clock rate, or speed of a CPU's internal parts, is measured in hertz (Hz). Modern processors often run so fast that gigahertz (GHz) is used instead. One GHz is 1,000,000,000 cycles per second.

Most CPUs used in desktop (home) computers are microprocessors made by either Intel or Advanced Micro Devices (usually shortened to AMD). Some other companies that make CPUs are ARM, and IBM. Most of their CPUs are used in embedded systems for more specialized things, like in mobile phones, cars, video game consoles, or in the military.[3]

Types of CPUs

In the 20th century engineers invented many different computer architectures. Nowadays most desktop computers use either 32-bit CPUs or 64-bit CPUs. The instructions in a 32-bit CPU are good at handling data that is 32 bits in size (most instructions "think" in 32 bits in a 32-bit CPU). Likewise, a 64-bit CPU is good at handling data that is 64 bits in size (and often good at handling 32-bit data too). The size of data that a CPU handles best is often called the word size of the CPU. Many old CPUs from the 70s, 80s and early 90s (and many modern embedded systems) have an 8-bit or 16-bit word size. When CPUs were invented in the middle 20th century they had many different word sizes. Some had different word sizes for instructions and data. The less popular word sizes later stopped being used.

Most CPUs are microprocessors. This means that the CPU is just a single chip. Some chips with microprocessors inside them also contain other components, and are complete single-chip "computers". This is called a microcontroller.

Registers

When the CPU runs a computer program, it needs somewhere to store the data that the instructions operate on (the data that they read and write). This storage is called a register. A CPU usually has many registers. Registers must be very fast to access (to read and write). Therefore, they are part of the CPU chip itself.

Memory

Storing all data in registers would make most CPUs too complicated (and very expensive). Therefore, registers usually only store the data that the CPU is working on "right now". The rest of the data used by the program is stored in RAM (Random Access Memory). Except in microcontrollers, RAM is usually stored outside the CPU in separate chips.

When the CPU wants to read or write data in RAM, it outputs an address to that data. Each byte in RAM has a memory address. The size of addresses is often the same as the word size: A 32-bit CPU uses 32-bit addresses, etc. However, smaller CPUs, like 8-bit CPUs, often use addresses that are larger than the word size. Otherwise the maximum program length would be too short.

Because the size of addresses is limited, the maximum amount of memory is also limited. 32-bit processors can usually only handle up to 4 GB of RAM. This is the number of different bytes that can be selected using a 32-bit address (each bit can have two values—0 and 1—and 232 bytes is 4 GB). A 64-bit processor might be able to handle up to 16 EB of RAM (16 exabytes, around 16 billion GB, or 16 billion billion bytes). The operating system may limit it to using smaller amounts.

The information that is stored in RAM is usually volatile. This means that it will disappear if the computer is turned off.

Memory management units (MMUs) and virtual memory

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 here:

  • An MMU can "hide" the memory of other programs from a program. This is done by not translating any addresses to the "hidden" addresses while the program is running. This is good because it means that programs can't read and modify the memory of other programs, which improves security and stability. (Programs can't "spy" on each other, or "step on each other's toes".)
  • Many MMUs can make some parts of memory non-writeable, non-readable, or non-executable (meaning code stored in that part of memory can't be run). This can be good for stability reasons and security reasons, as well as for other reasons.
  • MMUs allow different programs to have different "views" of memory. This is handy in many different situations. For example, it will always be possible to have the "main" code of a program at the same (virtual) address without colliding with other programs. It is also handy when there are many different pieces of code (from libraries) that are shared between programs.
  • MMUs allow code from libraries to appear at different addresses every time a program is run. This is good because not knowing where things are in memory often makes it harder for hackers to make programs do bad things. This is called address space randomization.
  • Advanced programs and operating systems can use tricks with MMUs to avoid having to copy data between different places in memory.

Cache

On modern computers, RAM is much slower than registers, so accessing RAM slows down programs. To speed up memory accesses, a faster type of memory called a cache is often put between the RAM and the main parts of the CPU. The cache is usually a part of the CPU chip itself, and is much more expensive per byte than RAM. The cache stores the same data as RAM, but is usually much smaller. Therefore, all the data used by the program might not fit in the cache. The cache tries to store data that is likely to be used a lot. Examples include recently used data and data close in memory to recently used data.

Often it makes sense to have a "cache for the cache", just as it makes sense to have a cache for RAM. In multi-level caching, there are many caches, called the L1 cache, the L2 cache, and so on. The L1 cache is the fastest (and most expensive per byte) cache and is "closest" to the CPU. The L2 cache is one step away and is slower than the L1 cache, etc. The L1 cache can often be viewed as a cache for the L2 cache, etc.

Buses

Computer buses are the wires used by the CPU to communicate with RAM and other components in the computer. Almost all CPUs have at least a data bus - used to read and write data - and an address bus - used to output addresses. Other buses inside the CPU carry data to different parts of the CPU.

Instruction sets

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.

Functionality

Here are some of the basic things a CPU can do:

  • Read data from memory and write data to memory.
  • Add one number to another number.
  • Test to see if one number is bigger than another number.
  • Move a number from one place to another (for example, from one register to another, or between a register and memory).
  • Jump to another place in the instruction list, but only if some test is true (for example, only if one number is bigger than another).

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.

Instruction pipelines

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:

  • Read the instruction from memory,
  • decode the instruction (figure out what the instruction does), and
  • add one to register A.

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.

Multiple cores

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.[4] Even processors for consumers have many cores, such as the 16-core AMD Ryzen 9 5950x.

Multithreading

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.

Manufacturers

The following companies make computer CPUs:

Further information

References

  1. Stanford University. "The Modern History of Computing". The Stanford Encyclopedia of Philosophy.[1]
  2. Kuck, David 1978. Computers and Computations, vol 1. John Wiley, p. 12. ISBN 978-0471027164
  3. Patterson, David A; Hennessy, John L. & Larus, James R. 1999. Computer organization and design: the hardware/software interface. 2nd ed. San Francisco: Kaufmann, p751. ISBN 978-1558604285
  4. "AMD Partners Unveil Their Plans for Integrating New AMD Epyc CPUs in Servers, Services". HPCwire. 2021-03-18. Retrieved 2021-05-19.

Other websites

Read other articles:

Federal highway in Germany B 433Bundesstraße 433Route informationLength14.3 km (8.9 mi)LocationCountryGermanyStatesHamburg, Schleswig-Holstein Highway system Roads in Germany Autobahns List Federal List State E-roads The Bundesstraße 433 is a Bundesstraße (federal road) in Hamburg. Path The B 433 at Hamburg Airport The road begins in Hamburg-Eppendorf at the intersection with the B 5 and continues via the Tarpenbekstraße, Rosenbrook, Alsterkrugchaussee (in Hamburg-Groß Bor...

 

American college football season 1919 college football seasonCentre after its defeat of West VirginiaNumber of bowls1Champion(s)HarvardIllinoisTexas A&M ← 1918 · football seasons · 1920 → The 1919 college football season had no clear-cut champion, with the Official NCAA Division I Football Records Book listing Centre, Harvard, Illinois, Notre Dame, and Texas A&M as having been deemed national champions by major selectors[1] Only Harvard, Illin...

 

Genus of beetles Hydrobiomorpha Hydrobiomorpha casta Scientific classification Domain: Eukaryota Kingdom: Animalia Phylum: Arthropoda Class: Insecta Order: Coleoptera Family: Hydrophilidae Tribe: Hydrophilini Genus: HydrobiomorphaBlackburn, 1888 Synonyms[1] Neohydrophilus Orchymont, 1911 Hydrobiomorpha is a genus of water scavenger beetles in the family Hydrophilidae. There are 56 extant described species in Hydrobiomorpha, along with several fossil species.[1][2][...

Defensive strategy in basketball Basketball playbook2–3 zone initial alignment2–3 zone DefenseType:Half court zone defenseName UsageTechnical name:2–3 zone DefenseCommon name:2–3 zoneOther common names:2–1–2 zonePlay Development CreditDesigned 1st by:Coach Cam HendersonYear play 1st used:1914Play 1st used by:Bristol high schoolCountry:United States The 2–3 zone defense is a defensive strategy used in basketball as an alternative to man-to-man defense. It is referred to as the 2�...

 

Harold W. PercivalBorn(1868-04-15)April 15, 1868Bridgetown, Barbados, British West IndiesDiedMarch 6, 1953(1953-03-06) (aged 84)New York City, U.S.OccupationAuthorLanguageEnglishNationalityAmericanNotable worksThinking and Destiny, Man and Woman and Child, Masonry and Its Symbols, Democracy Is Self-Government Harold Waldwin Percival (April 15, 1868 – March 6, 1953) was a philosopher and writer, best known for Thinking and Destiny, in print since 1946.[1] Between 1904 and 1917 ...

 

Азиатский барсук Научная классификация Домен:ЭукариотыЦарство:ЖивотныеПодцарство:ЭуметазоиБез ранга:Двусторонне-симметричныеБез ранга:ВторичноротыеТип:ХордовыеПодтип:ПозвоночныеИнфратип:ЧелюстноротыеНадкласс:ЧетвероногиеКлада:АмниотыКлада:СинапсидыКласс:Мле�...

EFHC1 المعرفات الأسماء المستعارة EFHC1, EJM1, dJ304B14.2, EF-hand domain containing 1, POC9, RIB72 معرفات خارجية الوراثة المندلية البشرية عبر الإنترنت 608815 MGI: MGI:1919127 HomoloGene: 10003 GeneCards: 114327 علم الوجود الجيني الوظيفة الجزيئية • ربط أيون الكالسيوم• protein C-terminus binding• ‏GO:0001948، ‏GO:0016582 ربط بروتيني• alpha-tubulin binding ا...

 

هذه المقالة عن المجموعة العرقية الأتراك وليس عن من يحملون جنسية الجمهورية التركية أتراكTürkler (بالتركية) التعداد الكليالتعداد 70~83 مليون نسمةمناطق الوجود المميزةالبلد  القائمة ... تركياألمانياسورياالعراقبلغارياالولايات المتحدةفرنساالمملكة المتحدةهولنداالنمساأسترالي�...

 

此条目序言章节没有充分总结全文内容要点。 (2019年3月21日)请考虑扩充序言,清晰概述条目所有重點。请在条目的讨论页讨论此问题。 哈萨克斯坦總統哈薩克總統旗現任Қасым-Жомарт Кемелұлы Тоқаев卡瑟姆若马尔特·托卡耶夫自2019年3月20日在任任期7年首任努尔苏丹·纳扎尔巴耶夫设立1990年4月24日(哈薩克蘇維埃社會主義共和國總統) 哈萨克斯坦 哈萨克斯坦政府...

التهاب العظم والغضروف معلومات عامة الاختصاص طب الروماتزم  من أنواع داء عظمي غضروفي،  والتهاب،  والتهاب الغضروف  تعديل مصدري - تعديل   التهاب العظم والغضروف[1] هو أحد الأنواع المؤلمة للداء العظمي الغضروفي Osteochondrosis حيث يحدث التهاب في كل من العظم والغضروف لمف�...

 

1998 novel by Paul Leonard and Nick Walters This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages) This article does not cite any sources. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: Dry Pilgrimage – news · newspapers · books · scholar · JSTOR (May 2019) (Learn ho...

 

Ada usul agar Pelarut dalam reaksi kimia digabungkan ke artikel ini. (Diskusikan) Botol pelarut berisi etanol dan aseton. Pelarut adalah suatu zat yang melarutkan zat terlarut (cairan, padat atau gas yang berbeda secara kimiawi), menghasilkan suatu larutan. Pelarut biasanya berupa cairan tetapi juga bisa menjadi padat, gas, atau fluida superkritis. Kuantitas zat terlarut yang dapat larut dalam volume pelarut tertentu bervariasi terhadap suhu. Pelarut paling umum digunakan dalam kehidupan seha...

Laws and regulations that relate to insurance Insurance law is the practice of law surrounding insurance, including insurance policies and claims. It can be broadly broken into three categories - regulation of the business of insurance; regulation of the content of insurance policies, especially with regard to consumer policies; and regulation of claim handling wise. History Main article: History of insurance The earliest form of insurance is probably marine insurance, although forms of mutua...

 

Politics of China Leadership Leadership generations Succession of power Hu–Wen Administration (2002–2012) Xi–Li Administration (2012–2017) Xi Administration (since 2017) 4th Leadership Core: Xi Jinping 20th Party Politburo: Xi Jinping 14th State Council: Li Qiang Current state leaders Current provincial leaders National leaders Orders of precedence Paramount leader: Xi Jinping First lady: Peng Liyuan Communist Party leader: Xi Jinping State representative: Xi Jinping Head of ...

 

1987 UK local government election 1987 Basildon District Council election[1][2] ← 1986 7 May 1987 1988 → 14 of the 42 seats to Basildon District Council22 seats needed for a majority   First party Second party Third party   Party Labour Conservative Alliance Seats before 22 13 7 Seats won 6 4 4 Seats after 20 11 11 Seat change 2 2 4 Popular vote 17,983 20,221 17,188 Percentage 32.5% 36.5% 31.0% Map showing the results of...

Russian curler Artem ShmakovCurlerBorn (1990-03-06) March 6, 1990 (age 34)Chelyabinsk, RussiaTeamCurling clubAdamant CC, Saint PetersburgSkipArtem ShmakovThirdIvan KazachkovSecondAlexander PolushvaykoLeadDaniil ZazulskikhCurling career Member Association RussiaWorld Championshipappearances2 (2016, 2018)European Championshipappearances1 (2017)Other appearancesEuropean Junior Challenge: 1 (2011) Medal record Curling Russian Men's Championship 2013 Dmitrov 2014 Sochi 2015 Sochi 2012 Dm...

 

Peruvian footballer (born 1949) Hugo Sotil Sotil with FC BarcelonaPersonal informationFull name Hugo Alejandro Sotil YerénDate of birth (1949-05-18) 18 May 1949 (age 75)Place of birth Ica, PeruHeight 1.69 m (5 ft 7 in)Position(s) StrikerYouth career Club Gaillard Deportivo MunicipalSenior career*Years Team Apps (Gls)1968–1973 Deportivo Municipal 121 (57)1973–1977 Barcelona 65 (21)1977–1978 Alianza Lima 54 (30)1979–1980 Independiente Medellín 32 (8)1981–1982 Dep...

 

This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: South Baldface – news · newspapers · books · scholar · JSTOR (January 2010) (Learn how and when to remove this message) South Baldface South Baldface is a 3,547-foot (1,081 m) mountain in the town of Chatham, New Hampshire in the eastern White Mountains. I...

Polish politician (born 1955) Wojciech Piotr Szaramamember of Sejm 2005-2007In office25 September 2005 – ? Personal detailsBorn16 December 1955 (1955-12-16) (age 68)NationalityPolishPolitical partyLaw and Justice Wojciech Piotr Szarama (born 16 December 1955 in Bytom) is a Polish politician. He was elected to Sejm on 25 September 2005, getting 9280 votes in 29 Gliwice district as a candidate from the Law and Justice list. He was also a member of Sejm 2001-2005, 2005-2007,...

 

1935 filmWater BabiesTitle card from Disney short Water Babies (1935)Directed byWilfred JacksonProductioncompanyWalt Disney ProductionsDistributed byUnited ArtistsRelease date May 11, 1935 (1935-05-11) Water Babies is a Silly Symphonies cartoon released on May 11, 1935, by United Artists.[1] The cartoon was directed by Wilfred Jackson. It features 2-inch-tall nude babies playing games in and out of the water. The babies are all completely identical other than the color ...