Mao Zedong and Processor design: Difference between pages

(Difference between pages)
Content deleted Content added
Tse-tung changed to Zedong
 
 
Line 1:
To a large extent, the [[design]] of a '''CPU''', or [[central processing unit]], is the design of its [[control unit]]. The modern (ie, 1965 to 1985) way to design control logic is to write a [[microprogram]].
{| align=right
| [[Image:Mao.JPG|right|frame|Mao Zedong]]
|-
|
{| align=center style="border:1px solid"
!style="background:#ccf;" colspan=3|[[Chinese name|Names]]
|-
| || [[Chinese name|Given name]] || [[Chinese style name|Style name]]
|-
|[[Traditional Chinese|Trad.]] || 毛澤東 || 潤芝¹
|-
|[[Simplified Chinese|Simp.]] || 毛泽东 || 润芝
|-
|[[Pinyin]] || Máo Zédōng || Rùnzhī
|-
|[[Wade-Giles|WG]] || Mao Tse-tung || Jun-chih
|-
|[[International Phonetic Alphabet|IPA]] || {{IPA|/mau̯ː˧˥ tsɤ˧˥.tʊŋ˥/}} || {{IPA|/ʐuənː˥˩ tʂI˥/}}
|-
| || {{Audio|Mao_Zedong_zhuxi.ogg|Listen}}
|-
| colspan=3 style="border-top:1px solid" | Surname: ''Mao''
|-
| colspan=3 style="border-top:1px solid" | <small>&sup1;Originally &#35424;&#33437; (&#21647;&#33437;)</small>
|}
|}
'''Mao Zedong''' ([[December 26]], [[1893]] &ndash; [[September 9]], [[1976]]; '''Mao Tse-Tung''' in [[Wade-Giles]]) was the chairman of the [[Politburo]] of the [[Communist Party of China]] from [[1943]] and the chairman of the Central Committee of the Communist Party of China from [[1945]] until his death. Under his leadership, the CCP (Chinese Communist Party) became the ruling party of [[mainland China]] as the result of its victory in the [[Chinese Civil War]]. On October 1, 1949, Mao declared the formation of the [[People's Republic of China]] at [[Tiananmen Square]].
 
CPU design was originally an [[ad-hoc]] process. Just getting a CPU to work was a substantial governmental and technical event.
While in power, he started a series of experiments aimed at speeding up China's economic development known as the [[Great Leap Forward]]. He forged but then later [[Sino-Soviet split|split]] the alliance with the [[Soviet Union]] and launched the [[Cultural Revolution]].
 
Key design innovations include [[CPU cache|cache]], [[virtual memory]], [[instruction pipelining]], [[superscalar]], [[CISC]], [[RISC]], [[virtual machine]], [[emulators]], [[microprogram]], and [[Stack (computing)|Stack]].
Mao is widely credited for creating a mostly unified China free of foreign domination for the first time since the [[Opium Wars]]. However, critics point out that Mao's inappropriate economic policies in conjunction with the [[Three Years of Natural Disasters]] caused the famine of [[1959]]&ndash;[[1961]], which lead to the deaths of millions of Chinese. Mao has also been criticized for his contribution to the split with the USSR, his establishment of a one-party dictatorship, and initiating the internal turmoil during the Cultural Revolution.
 
== History of general purpose CPUs ==
Mao Zedong is still sometimes referred to as '''Chairman Mao''' (&#27611;&#20027;&#24109;). At the height of his [[personality cult]], Mao was commonly known in China as the "Four Greats": "Great Teacher, Great Leader, Great Supreme Commander, Great Helmsman".
 
=== 1950s: early designs ===
==Early life==
The eldest son of four children of a moderately prosperous peasant farmer, Mao Zedong was born in the village of [[Shaoshan]] in [[Xiangtan]] county (&#28248;&#28525;&#32291;), [[Hunan]] province. His ancestors had migrated from [[Jiangxi]] province during the [[Ming Dynasty]] and had pursued farming for generations.
 
Each of the computer designs of the early 1950s was a unique design; there were no upward-compatible machines or computer architectures with multiple, differing implementations. Programs written for one machine would not run on another kind, even other kinds from the same company. This was not a major drawback at the time because there was not a large body of software developed to run on computers, so starting programming from scratch was not seen as a large barrier.
[[Image:Mao.gif|right|120px|thumb|Mao as a young man.]]
 
The design freedom of the time was very important, for designers were very constrained by the cost of electronics, yet just beginning to explore how a computer could best be organized. Some of the basic features introduced during this period included [[index registers]] (on the [[Ferranti Mark I]]), a return-address saving instruction ([[UNIVAC I]]), immediate operands ([[IBM 704]]), and the detection of invalid operations ([[IBM 650]]).
During the [[1911 Revolution]] he served in the Hunan provincial army. In the [[1910s]], Mao returned to school, where he became an advocate of physical fitness and collective action.
 
By the end of the [[1950]]s commercial builders had developed factory-constructed, truck-deliverable computers. The most widely installed computer was the [[IBM 650]], which used [[drum memory]] onto which programs were loaded using either [[punched tape|paper tape]] or [[punch card]]s. Some very high-end machines also included [[core memory]] which provided higher speeds. [[Hard disk]]s were also starting to become popular.
After graduation from [[Hunan Normal School]] in [[1918]], Mao traveled with his high-school teacher and future father-in-law, Professor [[Yang Changji]] (&#26472;&#26124;&#27982;), to [[Beijing]] during the [[May Fourth Movement]], when Yang lectured at [[Peking University]]. From Yang's recommendations, he worked under [[Li Dazhao]], the head of the university library and attended speeches by [[Chen Duxiu]]. While working for the Peking University library as an assistant librarian, Mao acquired a taste for books, something he was to retain in later years. Also in Beijing, he married his first wife, [[Yang Kaihui]], a Peking University student and Yang Changji&#8217;s daughter. (When Mao was 14, his father had arranged a marriage for him with a fellow villager, Luo Shi [&#32645;&#27663;], but Mao never recognized this marriage.) (See [[#Family|section 7 Family]])
 
Computers are automatic [[Abacus|abaci]]. The type of number system affects the way they work. In the early [[1950s]] most computers were built for specific numerical processing tasks, and many machines used decimal numbers as their basic number system &ndash; that is, the mathematical functions of the machines worked in base-10 instead of base-2 as is common today. These were not merely [[binary coded decimal]]. The machines actually had ten vacuum tubes per digit in each [[Processor register|register]]. Some early [[Soviet Union|Soviet]] computer designers implemented systems based on ternary logic; that is, a bit could have three states: +1, 0, or -1, corresponding to positive, no, or negative voltage.
Instead of going abroad which was the path of many of his radical compatriots, Mao spent the early 1920s traveling in China, and finally returned to Hunan, where he took the lead in promoting collective action and labor rights.
 
An early project for the [[U.S. Air Force]], [[BINAC]] attempted to make a lightweight, simple computer by using binary arithmetic. It deeply impressed the industry.
At age 27, Mao attended the First Congress of the Communist Party of China in [[Shanghai]] in July 1921. Two years later he was elected to the Central Committee of the party at the Third Congress.
 
As late as 1970, major computer languages such as "[[C_language|C]]" were unable to standardize their numeric behavior because decimal computers had groups of users too large to alienate.
During the Chinese Civil War&#8217;s first KMT-CCP united front, Mao served as the director of the Peasant Training Institute of the [[Kuomintang]] (also known as KMT or Nationalist Party). In early [[1927]], he was dispatched to Hunan province to report on the recent peasant uprisings in the wake of the [[Northern Expedition]]. The report that Mao produced from this investigation is considered the first important work of Maoist theory.
 
Even when designers used a binary system, they still had many odd ideas. Some used sign-magnitude arthmetic (-1 = 10001), rather than modern [[two's complement]] arithmetic (-1 = 11111). Most computers used six-bit character sets, because they adequately encoded [[Hollerith]] cards. It was a major revelation to designers of this period to realize that the data word should be a multiple of the character size. They began to design computers with 12, 24 and 36 bit data words.
==Political ideas==
''Main article: [[Maoism]]''
 
In this era, [[Grosch's law]] dominated computer design: Computer cost increased as the square of its speed.
During this time, Mao developed many of his political theories. These ideas have had a monumental impact on generations of Chinese and have significantly affected the rest of the world.
 
=== 1960s: the computer revolution and CISC ===
Mao's thought transformed traditional Marxism into a political ideology that could work to win a revolution and consolidate power in China. Marxism-Leninism could only exist in concrete manifestations, meaning that it could only work if it was applied to certain situations. Mao hypothesized that peasants could form the basis of a communist revolution, but only if the party elites took the message of revolution to the grass roots and make it comprehensible to the peasant population. This meant a process of getting party cadres to understand local realities and trying to integrate the concerns of peasants with party policy, something called Mass Line.
 
One major problem with early computers was that a program for one would not work on others. Computer companies found that their customers had little reason to remain loyal to a particular brand, as the next computer they purchased would be incompatible anyway. At that point price and performance were usually the only concerns.
Mao also built on the theories of [[Hegel]] and [[Karl Marx|Marx]] to create a new theory of [[materialist]] [[dialectic]]s. By applying the theory of the dialectic to real-world conflicts, then by asserting that only the empirical reality of the conflict mattered, Mao developed a type of dialectic theory that was studied for decades. It is difficult to determine the true validity of this theory, however, since so many analyses of it have been heavily influenced by political biases.
 
In 1962, IBM tried a new approach to designing computers. The plan was to make an entire family of computers that could all run the same software, but with different performances, and at different prices. As users' requirements grew they could move up to larger computers, and still keep all of their investment in programs, data and storage media.
During this time, Mao also developed more practical ideas, such as a three-stage theory of [[guerilla warfare]] and the concept of the [[people's democratic dictatorship]].
 
In order to do this they designed a single ''reference computer'' called the '''[[System 360]]''' (or '''S/360'''). The System 360 was a virtual computer, a reference instruction set and capabilities that all machines in the family would support. In order to provide different classes of machines, each computer in the family would use more or less hardware emulation, and more or less [[microprogram]] emulation, to create a machine capable of running the entire System 360 [[instruction set]].
==War and Revolution==
 
For instance a low-end machine could include a very simple processor for low cost. However this would require the use of a larger microcode emulator to provide the rest of the instruction set, which would slow it down. A high-end machine would use a much more complex processor that could directly process more of the System 360 design, thus running a much simpler and faster emulator.
Mao escaped the [[white terror]] in the spring and summer of 1927 and led the ill-fated [[Autumn Harvest Uprising]] at [[Changsha]], Hunan, that autumn. Mao barely survived this mishap (he escaped his guards on the way to his execution). He and his rag-tag band of loyal guerillas found refuge in the [[Jinggang Mountains]] in southeastern China. There, from 1931 to 1934, Mao helped establish the [[Chinese Soviet Republic]] and was elected chairman. It was during this period that Mao married [[He Zizhen]], after Yang Kaihui had been killed by KMT forces.
 
IBM chose to make the reference [[instruction set]] quite complex, and very capable. This was a conscious choice. Even though the computer was complex, its "[[control store]]" containing the [[microprogram]] would stay relatively small, and could be made with very fast memory. Another important effect was that a single instruction could describe quite a complex sequence of operations. Thus the computers would generally have to fetch fewer instructions from the main memory, which could be made slower, smaller and less expensive for a given combination of speed and price.
Mao, with the help of [[Zhu De]], built a modest but effective guerilla army, undertook experiments in rural reform and government, and provided refuge for Communists fleeing the rightist purges in the cities. Under increasing pressure from the KMT encirclement campaigns, there was a struggle for power within the Communist leadership. Mao was removed from his important positions and replaced by individuals (including [[Zhou Enlai]]) who appeared loyal to the orthodox line advocated by [[Moscow]] and represented within the CPC by a group known as the [[28 Bolsheviks]].
 
As the S/360 was to be a successor to both scientific machines like the [[IBM 7090|7090]] and data processing machines like the [[IBM 1401|1401]], it needed a design that could reasonably support all forms of processing. Hence the instruction set was designed to manipulate not just simple binary numbers, but text, scientific floating-point (similar to the numbers used in a calculator), and the [[binary coded decimal]] arithmetic needed by accounting systems.
[[Chiang Kai-shek]], who had earlier assumed nominal control of China due in part to the Northern Expedition, was determined to eliminate the Communists. To evade the KMT forces, the Communists engaged in the "[[Long March]]", a retreat from Jiangxi in the southeast to [[Shaanxi]] in the northwest of China. It was during this 9600-km, year-long journey that Mao emerged as the top Communist leader, aided by the [[Zunyi Conference]] and the defection of [[Zhou Enlai]] to Mao's side. At this Conference, Mao entered the Standing Committee of the Politburo of the Communist Party of China.
 
Almost all following computers included these innovations in some form. This basic set of features is now called a "[[complex instruction set computer]]," or CISC (pronounced "sisk"), a term not invented until many years later.
From his base in [[Yan'an]], Mao led the Communist resistance against the Japanese in the [[Sino-Japanese War (1937-1945)]]. Mao further consolidated power over the Communist Party in [[1942]] by launching the [[Cheng Feng]], or "Rectification" campaign against rival CPC members such as [[Wang Ming]], [[Wang Shiwei]], and Ding Ling. Also while in Yan'an, Mao divorced He Zizhen and married the actress Lan Ping, who would become known as [[Jiang Qing]].
 
In many CISCs, an instruction could access either registers or memory, usually in several different ways.
During the Sino-Japanese War, Mao Zedong's strategies were opposed by both Chiang Kai-shek and the United States. The US regarded Chiang as an important ally, able to help shorten the war by engaging the Japanese occupiers in China. Chiang, in contrast, sought to build the ROC army for the certain conflict with Mao's communist forces after the end of [[World War II]]. This fact was not understood well in the US, and precious [[lend-lease]] armaments continued to be allocated to the Kuomintang. In turn, Mao spent some of the war fighting the Kuomintang for control of certain parts of China. Both the Communists and Nationalists have been criticised by academics for fighting amongst themselves rather than ally against the Imperial Japanese Army.
This made the CISCs easier to program, because a programmer could remember just thirty to a hundred instructions, and a set of three to ten [[addressing mode]]s rather than thousands of distinct instructions.
This was called an "[[orthogonal instruction set]]."
The [[PDP-11]] and [[Motorola 68000]] architecture are examples of nearly orthogonal instruction sets.
 
There was also the ''BUNCH'' (Burroughs, Univac, NCR, CDC, and Honeywell) that competed against IBM at this time though IBM dominated the era with [[S/360]].
However, Americans sent a special diplomatic envoy, called the [[Dixie mission]], to the Communists by 1944. According to Edwin Moise, in ''Modern China: A History 2nd Edition'',
: ''Most of the Americans were favourably impressed. The CCP seemed less corrupt, more unified, and more vigorous in its resistance to Japan than the Guomingdang. United States fliers shot down over North China...confirmed to their superiors that the CCP was both strong and popular over a broad area. In the end, the contacts with the USA developed with the CCP led to very little.''
 
The Burroughs Corporation (which later became Unisys when they merged with Sperry/Univac) offered an alternative to S/360 with their [[Burroughs B5000|B5000]] series machines. The B5000 series [[1961]] had virtual memory, a multi-programming operating system (Master Control Program or MCP), written in [[ALGOL 60]], and the industry's first recursive-descent compilers as early as 1963.
After the end of World War II, the US continued to support Chiang Kai-shek, now openly against the Communist [[People's Liberation Army|Red Army]], led by Mao Zedong, in the civil war for control of China as part of its view to contain and defeat "world communism". Likewise, the Soviet Union gave quasi-covert support to Mao (acting as a concerned neighbor more than a military ally, to avoid open conflict with the US) and gave large supplies of arms to the Chinese Communists, although newer Chinese records indicate the Soviet "supplies" were not as large as previously believed, and consistently fell short of the promised amount of aid.
 
=== 1970s: large scale integration ===
On [[January 21]], 1949, Kuomintang forces suffered massive losses against Mao's Red Army. In the early morning of [[December 10]], 1949, Red Army troops laid siege to [[Chengdu]], the last KMT-occupied city in mainland China, and Chiang Kai-shek evacuated from the mainland to [[Taiwan]] that same day.
 
In the 1960s, the [[Apollo guidance computer]] and [[Minuteman missile]] made the [[integrated circuit]] economical and practical.
==Leadership of China==
 
Around 1971, the first calculator and clock chips began to show that very small computers might be possible. The first [[microprocessor]] was the 4004, designed in 1971 for a calculator company, and produced by [[Intel]]. The 4004 is the direct ancestor of the [[Intel 80386]], even now maintaining some code compatibility. Just a few years later, the word size of the 4004 was doubled to form the 8008.
[[Image:China, Mao (2).jpg|right|250px|thumb|Mao declared the founding of the PRC on October 1, 1949.]]
 
By the mid-1970s, the use of integrated circuits in computers was commonplace. The whole decade consists of upheavals caused by the shrinking price of transistors.
After the Japanese were defeated in World War II, the Communists defeated the Kuomintang in an ensuing civil war and established the People's Republic of China on [[October 1]], 1949. It was the culmination of over two decades of popular struggle led by the Communist Party. From [[1954]] to [[1959]], Mao was the [[President of the People's Republic of China|Chairman of the PRC]]. He took up residence in [[Zhongnanhai]], a compound next to the [[Forbidden City]] in Beijing, and there he decreed the construction of an indoor swimming pool and other buildings. Mao often did his work either in bed or by the side of the pool during his chairmanship, according to Dr. [[Li Zhisui]], who claimed to be his physician. (Li's book, ''[[The Private Life of Chairman Mao]]'', has been subject to controversy.)
 
It became possible to put an entire CPU on a single printed circuit board. The result was that minicomputers, usually with 16-bit words, and 4k to 64K of memory, came to be commonplace.
Following the consolidation of power, Mao launched a phase of rapid collectivization, lasting until around [[1958]]. The CPC introduced price controls largely successful at breaking the inflationary spiral of the preceding [[Republic of China|ROC]] as well as a [[Simplified Chinese character|Chinese character simplification]] aimed at increasing literacy. Land was redistributed from landowners to poor peasants and large-scale industrialization projects were undertaken, contributing to the construction of a modern national infrastructure. During this period, China sustained yearly increases in GDP of about 4&ndash;9% as well as dramatic improvements in quality-of-life indicators such as life expectancy and literacy.
 
CISCs were believed to be the most powerful types of computers, because their microcode was small and could be stored in very high-speed memory. The CISC architecture also addressed the "semantic gap" as it was perceived at the time. This was a defined distance between the machine language, and the higher level language people used to program a machine. It was felt that compilers could do a better job with a richer instruction set.
Programs pursued during this time include the [[Hundred Flowers Campaign]], in which Mao indicated his willingness to consider different opinions about how China should be governed. Given the freedom to express themselves, liberal and intellectual Chinese began opposing the Communist Party and questioning its leadership. This was initially tolerated and even encouraged, since it was thought that constructive criticism would be beneficial to the Party. However, after a few months, Mao's government reversed its policy and rounded up those who criticized the Party in what is called the [[Anti-Rightist Movement]]. Authors such as [[Jung Chang]] allege that the Hundred Flowers Campaign was merely a ruse to root out "dangerous" thinking more easily.
 
Custom CISCs were commonly constructed using "bit slice" computer logic such as the AMD 2900 chips, with custom microcode. A bit slice component is a piece of an [[ALU]], register file or microsequencer. Most bit-slice integrated circuits were 4-bits wide.
In [[1958]], Mao launched the [[Great Leap Forward]], a plan intended as an alternative model for economic growth which contradicted the Soviet model of heavy industry that was advocated by others in the party. Under this economic program, Chinese agriculture was to be collectivized and rural small-scale industry was to be promoted.
 
By the early 1970s, the [[PDP-11]] was developed, arguably the most advanced small computer of its day. Almost immediately, wider-word CISCs were introduced, the 32-bit [[VAX]] and 36-bit [[PDP-10]].
At first, the Great Leap began with tremendous success, with agricultural and steel production running very high. However, instead of maintaining the steady growth, Mao and other party leaders believed they could achieve unrealistically high quotas. A damaging number of agricultural peasants were moved to steel production. Numbers were inflated, although "they were not just lies intended for public consumption, they were actually believed." (Moise 140)
 
Also, to control a cruise missile, Intel developed a more-capable version of its 8008 microprocessor, the 8080.
By 1959, the Great Leap Forward had become a disaster for Red China. Although the steel quotas were reached, critics point out much of the steel produced was useless, as it had been made from scrap metal. According to Zhang Rongmei, a Geometry teacher in rural Shanghai during the Great Leap Forward,
:''We took all the furniture, pots, and pans we had in our house, and all our neighbors did likewise. We put all everything in a big fire and melted down all the metal.''
 
IBM continued to make large, fast computers. However the definition of large and fast now meant more than a megabyte of RAM, clock speeds near one megahertz [http://www.hometoys.com/mentors/caswell/sep00/trends01.htm][http://research.microsoft.com/users/GBell/Computer_Structures_Principles_and_Examples/csp0727.htm], and tens of megabytes of disk drives.
[[Khrushchev]] cancelled Soviet technical support because of worsening Sino-Soviet relations. Severe droughts also occurred, further reducing agricultural output. Unrealistic grain demands by the government, Soviet withdrawl of support, [[Three Years of Natural Disaster|natural disasters]], and an economy that had spent ten years recovering from decades of war and chaos caused famine across the nation.
 
IBM's System 370 was a version of the 360 tweaked to run virtual computing environments. The [[VM (Operating system) |virtual computer]] was developed in order to reduce the possibility of an unrecoverable software failure.
There is a great deal of controversy over the number of deaths by starvation during the Great Leap Forward. A mainstream figure is that some thirty million people died during the famine that followed. In 1957, before the Great Leap, about 7&ndash;10 million people died. Due to the tremendous crop failure in 1959 caused by incompetent policies from the Great Leap Forward, around 9 to 12 million people died. According to historian [[Edwin Moise]]:
: ''Probably there was no year when China was under Guomingdang control when the death rate was as low as 1.46 percent. The number of excess deaths...was about 2,500,000 (in 1959).''
 
The Burroughs B5000/B6000/B7000 series reached its largest market share. It was a stack computer programmed in a dialect of Algol. It used 64-bit fixed-point arithmetic, rather than floating-point.
However, the policies of the Great Leap coincided with another round of natural disasters in 1960. According to Sun Yefang, the death rate was around 2.54 percent in 1960 and around 9 million "excess deaths" occurred that year. During the so-called [[Three Years of Natural Disasters]], the excess number of deaths "reached 16 million and other sources give higher figures." (Moise 142) Finally, the Great Leap ended in [[1960]], as a tremendous economic failure.
 
All these different developments competed madly for marketshare.
The withdrawal of Soviet aid, border disputes, disputes over the control and direction of world communism, whether it should be revolutionary or status quo, and other disputes pertaining to foreign policy contributed to the [[Sino-Soviet split]] in the 1960s. Most of the problems, regarding communist unity, resulted from the death of Stalin and his replacement by Khrushchev. Stalin had established himself as the fount of correct Marxist thought well before Mao controlled the CCP, and therefore Mao never challenged the suitability of any Stalinist doctrine (at least while Stalin was alive). Upon the death of Stalin, Mao believed (perhaps because of seniority) leadership of "correct" Marxist doctrine would fall to him. The resulting tension between Khrushchev (at the head of a politically/militarily superior government), and Mao (believing he had a superior understanding of Marxist ideology) eroded the previous patron-client relationship between the USSR and CCP.
 
=== Early 1980s: the lessons of RISC ===
Following these events, other members of the Communist Party, including [[Liu Shaoqi]] and [[Deng Xiaoping]], decided that Mao should be removed from actual power and only remain in a largely ceremonial and symbolic role. They attempted to marginalize Mao, and by [[1959]], Liu Shaoqi became [[President of the People's Republic of China|State President]], but Mao remained Chairman. Liu and others began to look at the situation much more realistically, somewhat abandoning the idealism Mao wished for.
 
In the early [[1980s]], researchers at [[UC Berkeley]] and [[IBM]] both discovered that most computer language compilers and interpreters used only a small subset of the instructions of a [[CISC]]. Much of the power of the CPU was simply being ignored in real-world use. They realized that by making the computer simpler and less orthogonal, they could make it faster and less expensive at the same time.
Facing the prospect of losing his place on the political stage, Mao responded to Liu and Deng's movements by launching the [[Cultural Revolution]] in [[1966]]. This allowed Mao to circumvent the Communist hierarchy by giving power directly to the [[Red Guard (China)|Red Guards]], groups of young people, often teenagers, who set up their own tribunals. The Revolution led to the destruction of much of China's cultural heritage and the imprisonment of a huge number of Chinese intellectuals, as well as creating general economic and social chaos in the country. It was during this period that Mao chose [[Lin Biao]] to become his successor. Later, it is unclear whether Lin was planning a military coup (or assassination), but before he could be questioned, Lin died trying to flee China (probably anticipating his arrest) in a suspicious plane crash over Mongolia. It was declared that Lin was planning to depose Mao, and he was posthumously expelled from the CCP. Mao lost trust in many of the top CCP figures.
[[Image:Nixon_meets_Mao_in_China_1972.gif|thumb|right|Mao greeted United States President [[Richard Nixon]] (right) in a China visit in 1972]]
 
At the same time, CPUs were growing faster in relation to the memory they addressed. Designers also experimented with using large sets of internal registers. The idea was to [[cache]] intermediate results in the registers under the control of the compiler.
In [[1969]], Mao declared the Cultural Revolution to be over, although the official history of the People's Republic of China marks the end of the Cultural Revolution in 1976 with Mao's death. In the last years of his life, Mao was faced with declining health due to either [[Parkinson's disease]] or, according to Li Zhisui, [[motor neuron disease]], as well as lung ailments due to [[tobacco smoking|smoking]] and heart trouble. Mao remained passive as various factions within the Communist Party mobilized for the power struggle anticipated after his death. When Mao could not swim any longer, the indoor swimming pool he had at Zhongnanhai was converted into a giant reception hall, according to [[Li Zhisui]].
This also reduced the number of [[addressing mode]]s and orthogonality.
 
The computer designs based on this theory were called [[Reduced Instruction Set Computer]]s, or RISC. RISCs generally had larger numbers of registers, accessed by simpler instructions, with a few instructions specifically to load and store data to memory. The result was a very simple core CPU running at very high speed, supporting the exact sorts of operations the compilers were using anyway.
As anticipated after Mao&#8217;s death on [[September 9]], [[1976]], there was a power struggle for control of China. On one side were the [[leftist]]s led by the [[Gang of Four (China)|Gang of Four]], who wanted to continue the policy of revolutionary mass mobilization. On the other side were the [[rightist]]s, which consisted of two groups. One was the restorationists led by [[Hua Guofeng]] who advocated a return to central planning along the Soviet model. The other was the reformers, led by Deng Xiaoping, who wanted to overhaul the Chinese economy based on pragmatic policies and to de-emphasize the role of ideology in determining economic and political policy.
 
A common variation on the RISC design employs the [[Harvard architecture]], as opposed to the [[Von Neumann architecture|Von Neumann]] or Stored Program architecture common to most other designs. In a Harvard Architecture machine, the program and data occupy separate memory devices and can be accessed simultaneously. In Von Neumann machines the data and programs are mixed in a single memory device, requiring sequential accessing which produces the so-called "Von Neumann bottleneck."
Eventually, the moderates won control of the government. Deng Xiaoping defeated Hua Guofeng in a bloodless power struggle shortly afterwards.
 
One downside to the RISC design has been that the programs that run on them tend to be larger. This is because [[compiler]]s have to generate longer sequences of the simpler instructions to accomplish the same results. Since these instructions need to be loaded from memory anyway, the larger code size offsets some of the RISC design's fast memory handling.
==Cult of Mao==
 
Recently, engineers have found ways to compress the reduced instruction sets so they fit in even smaller memory systems than CISCs. Examples of such compression schemes include [[ARM architecture|the ARM]]'s "Thumb" instruction set. In applications that do not need to run older binary software, compressed RISCs are coming to dominate sales.
One of the reasons Mao is most remembered is the ''Cult of Mao'', the personality cult that was created around him. Mao presented himself as an enemy of landowners, businessmen and Western and American imperialism, as well as an ally of impoverished peasants, farmers and workers. Some people argue that [[Cult of personality|personality cults]] go against the basic ideas of Marxism, but the propaganda that was inherent with most Communist regimes contradicted this, as can be seen by the Cult of Stalin.
 
Another approach to RISCs was the "[[niladic]]" or "zero-address" instruction set. This approach realized that the majority of space in an instruction was to identify the operands of the instruction. These machines placed the operands on a push-down (last-in, first out) [[stack (computing)|stack]]. The instruction set was supplemented with a few instructions to fetch and store memory. Most used simple caching to provide extremely fast RISC machines, with very compact code. Another benefit was that the interrupt latencies were extremely small, smaller than most CISC machines (a rare trait in RISC machines). The first zero-address computer was developed by [[Chuck Moore|Charles Moore]]. It placed six 5-bit instructions in a 32-bit word, and was a precursor to [[VLIW]] design (see below: 1990 to Today).
Mao said the following about cults at the 1958 Party congress in Chengdu, where he expressed support for the idea of personality cults - even ones like Stalin's:
 
Commercial variants were mostly characterized as "[[FORTH]]" machines, and probably failed because that language became unpopular. Also, the machines were developed by defense contractors at exactly the time that the cold war ended. Loss of funding may have broken up the development teams before the companies could perform adequate commercial marketing.
::"There are two kinds of personality cults. One is a healthy personality cult, that is, to worship men like Marx, Engels, Lenin, and Stalin. Because they hold the truth in their hands. The other is a false personality cult, i.e. not analysed and blind worship."
 
RISC chips now dominate the market for 32-bit embedded systems. Smaller RISC chips are even becoming common in the cost-sensitive 8-bit embedded-system market. The main market for RISC CPUs has been systems that require low power or small size.
In 1962, Mao proposed the Socialist Education Movement (SEM), in an attempt to 'protect' the peasants against the temptations of [[feudalism]] and the sprouts of capitalism that he saw re-emerging in the countryside (thanks to Liu's economic reforms). Large quantities of politicised art were produced and circulated - with Mao at the centre. Numerous posters and musical compositions referred to Mao as "A red sun in the centre of our hearts" (&#25105;&#20204;&#24515;&#20013;&#30340;&#32418;&#22826;&#38451;) and a "Savior of the people" (&#20154;&#27665;&#30340;&#22823;&#25937;&#26143;).
 
Even some CISC processors (based on architectures that were created before RISC became dominant) translate instructions internally into a RISC-like instruction set. These CISC chips include newer [[X86|x86]] and [[VAX]] models.
The Cult of Mao proved vital in starting the Cultural Revolution. China's youth had mostly been brought up during the Communist era, and they had been told to love Mao. Thus they were his greatest supporters. Their feelings for him were so strong that many followed his urge to challenge all established authority.
 
These numbers may surprise many, because the "market" is perceived to be desktop computers. With Intel x86 designs dominating the vast majority of all desktop sales, RISC is found only in the [[Apple Computer|Apple]] desktop computer lines. However, desktop computers are only a tiny fraction of the computers now sold. Most people own more computers in embedded systems in their car and house than on their desks.
In October 1966, Mao's ''[[Quotations of Chairman Mao Zedong]]'' (also known as the "[[Little Red Book]]") was published. Party members were encouraged to carry a copy with them and possession was almost mandatory in order for membership. Over the years, Mao's image became displayed everywhere, in every home, office and shop. His quotations were included in boldface or red type in even the most mundane writings.
 
=== Mid-1980s to today: exploiting instruction level parallelism ===
==Legacy ==
 
In the mid-to-late 1980s, designers began using a technique known as '''[[instruction pipelining]]''', in which the processor works on multiple instructions in different stages of completion. For example, the processor may be retrieving the operands for the next instruction while calculating the result of the current one. Modern CPUs may use over a dozen such stages.
Mao's legacy has produced a large amount of controversy. Some people emphasize the major failures such as the [[Sino-Soviet Split]], the Great Leap Forward and the chaos of the Cultural Revolution. Most mainland Chinese believe that Mao Zedong was a great revolutionary leader, although he made serious mistakes in his later life. According to Deng Xiaoping, Mao was "seven parts right and three parts wrong", and his "contributions are primary and his mistakes secondary."
 
A similar idea, introduced only a few years later, was to execute multiple instructions in parallel on separate arithmetic-logic units ([[ALU]]s). Instead of operating on only one instruction at a time, the CPU will look for several similar instructions that are not dependent on each other, and execute them in parallel. This approach is known as [[superscalar]] processor design.
Supporters of Mao point out that before 1949, for instance, the illiteracy rate in Mainland China was 80 percent, and life expectancy was a meager 35 years. At his death, they claim illiteracy had declined to less than seven percent, and average life expectancy had increased to more than 70 years (alternative statistics also quote improvements, though not nearly as dramatic). In addition to these increases, the total population of China increased 57% to 700 million, from the constant 400 million mark during the span between the Opium War and the Chinese Civil War. Supporters also state that under Mao's regime, China ended its "Century of Humiliation" from Western imperialism and regained its status as a major world power. They also state their belief that Mao also industrialized China to a considerable extent and ensured China's sovereignty during his rule. Some of Mao's supporters view the Kuomintang as having been corrupt and credit Mao with driving them off the Chinese mainland to Taiwan.
 
Such techniques are limited by the degree of [[instruction level parallelism]] (ILP), the number of non-dependent instructions in the program code. Some programs are able to run very well on superscalar processors due to their inherent high ILP, notably graphics. However more general problems do not have such high ILP, thus making the achievable speedups due to these techniques to be lower.
They also argue that the Maoist era improved women's rights by abolishing prostitution, a phenomenon that was to return after Deng Xiaoping and post-Maoist CCP leaders increased liberalization of the economy. Indeed, Mao once famously remarked that "Women hold up half the heavens".
 
Branching is one major culprit. For example, the program might add two numbers and branch to a different code segment if the number is bigger than a third number. In this case even if the branch operation is sent to the second ALU for processing, it still must wait for the results from the addition. It thus runs no faster than if there were only one ALU. The most common solution for this type of problem is to use a type of [[branch prediction]].
Skeptics observe that similar gains in life expectancy occurred in the [[East Asian Tigers]], most notably Taiwan, which was ruled by Mao's opponents, the Kuomintang. Some of the gains may have simply been the result of a country no longer at war, so perhaps any regime could achieve such improvements. On the other hand, the regime that took over in Taiwan was composed of the same people ruling the Mainland for over 20 years when life expectancy was so low.
 
To further the efficiency of multiple functional units which are available in superscalar designs, operand register dependencies was found to be another limiting factor. To minimize these dependencies, [[out-of-order execution]] of instructions was introduced. In such a scheme, the instruction results which complete out-of-order must be re-ordered in program order by the processor for the program to be restartable after an exception. ''Out-of-Order'' execution was the main advancement of the computer industry during the [[1990s]].
Mao believed that "socialism is the only way out for China," because the United States and other [[Western]] countries would not allow China to join the ranks of advanced capitalism. As if to support this theory, the United States placed a trade embargo on China that lasted until [[Richard Nixon]] decided Mao had made himself a force to be reckoned with in dealing with the Soviet Union. While the Tigers obtained favorable trade terms from the United States, most [[Third World]] capitalist countries did not, and they saw nothing like the social gains in China or the economic growth of the Tigers.
A similar concept is [[speculative execution]], where instructions from both sides of a branch are executed at the same time, and the results of one side or the other are thrown out once the branch answer is known.
 
These advances, which were originally developed from research for RISC-style designs, allow modern CISC processors to execute twelve or more instructions per clock cycle, when traditional CISC designs could take twelve or more cycles to execute just one instruction.
Some, including members of the Communist Party of China, hold Mao responsible for initiating the [[Sino-Soviet Split]]. The [[Great Leap Forward]] and the [[Cultural Revolution]] were also considered to be major disasters in his policy. Still other critics of Mao fault him for not encouraging [[birth control]] and for creating a demographic bump which later Chinese leaders responded to with the [[one child policy]].
 
The resulting instruction scheduling logic of these processors is large, complex and difficult to verify. Furthermore, the higher complexity requires more transistors, increasing power consumption and heat. In this respect RISC is superior because the instructions are simpler, have less interdependence and make superscalar implementations easier. However, as Intel has demonstrated, the concepts can be applied to a CISC design, given enough time and money.
There is more consensus on Mao's role as a military strategist and tactician during the Chinese Civil War and the [[Korean War]]. Even among those who find Mao's ideology to be either unworkable or abhorrent, many acknowledge that Mao was a brilliant political and military strategist - Mao's military writings continue to have a large amount of influence both among those who seek to create an insurgency and those who seek to crush one.
 
:Historical note: Some of these techniques (e.g. pipelining) were originally developed in the late [[1950s]] by [[International Business Machines|IBM]] on their [[IBM 7030|Stretch]] mainframe computer.
[[Image:Mao-tiananmen-portrait.jpg|right|thumb|Remains of Mao's personality cult: one of the last publicly displayed portraits of Mao Zedong at the Tiananmen gate.]]
 
=== 1990 to today: looking forward ===
The ideology of [[Maoism]] has influenced many communists around the world, including [[third world]] revolutionary movements such as [[Cambodia]]'s [[Khmer Rouge]], [[Peru]]'s [[Shining Path]], the revolutionary movement in [[Nepal]], and also the [[Revolutionary Communist Party]] in the United States. China has moved sharply away from Maoism since Mao's death, and most people outside of China who describe themselves as Maoist regard the Deng Xiaoping reforms to be a betrayal of Mao's legacy.
 
====VLIW and EPIC====
In mainland China, many people still consider Mao a hero in the first half of his life, but hold that he was too idealistic after gaining power. His actions during the Cultural Revolution regarding the "Four Great Evils" polarizes many Chinese. Mao is also criticized for creating a cult of personality. However, in an era where economic growth has caused corruption to increase in mainland China, there are those who regard the era of Mao as a time of peace and equality. At the same time, contemporary views about him in the PRC are affected by bans on works that criticise Mao heavily.
 
The instruction scheduling logic that makes a superscalar processor is just boolean logic. In the early 1990s, a significant innovation was to realize that the coordination of a multiple-ALU computer could be moved into the [[compiler]], the software that translates a programmer's instructions into machine-level instructions.
In the mid-1990s, Mao Zedong's picture began to appear on all new [[renminbi]] currency from the People&#8217;s Republic of China. This is intended primarily as an anti-counterfeiting measure as Mao's face is widely recognized in contrast to the generic figures that appear in older currency.
 
This type of computer is called a '''[[very long instruction word]]''' (VLIW) computer.
== Family ==
Wives:
# [[Yang Kaihui]] (&#26472;&#24320;&#24935;, 1901-1930) of [[Changsha]]: married 1921 to 1927, executed by the Kuomintang in 1930
# [[He Zizhen]] (&#36154;&#23376;&#29645;, 1910-1984) of Jiangxi: married May 1928 to 1939
# [[Jiang Qing]]: (&#27743;&#38738;), married 1939 to Mao's death
 
Statically scheduling the instructions in the compiler (as opposed to letting the processor do the scheduling dynamically) has many practical advantages over doing so in the CPU.
[[Image:Mao-family-1919.jpg|right|thumb|225px|From left to right: [[Mao Zetan]], [[Mao Zemin]], Wen Qimei, Mao Zedong. At [[Changsha]], 1919.]]
 
Oddly, speed is not one of them. With enough transistors, the CPU could do everything at once. However all those transistors make the chip larger, and therefore more expensive. The transistors also use power, which means that they generate heat that must be removed. The heat also makes the design less reliable.
Ancestors:
* Wen Qimei (&#25991;&#19971;&#22969;, 1867-1919), mother
* Mao Yichang (&#27611;&#36155;&#26124;, 1870-1920), father, [[courtesy name]] Mao Shunsheng (&#27611;&#39034;&#29983;)
* Mao Enpu (&#27611;&#24681;&#26222;), paternal grandfather
 
Since compiling happens only once on the developer's machine, the control logic is "canned" in the final realization of the program. This means that it consumes no transistors, and no power, and therefore is free, and generates no heat.
Siblings:
 
The resulting CPU is simpler, and runs at least as fast as if the scheduling were in the CPU.
* [[Mao Zemin]] (&#27611;&#27901;&#27665;, 1895-1943), younger brother
* [[Mao Zetan]] (&#27611;&#27901;&#35203;, 1905-1935), younger brother
* [[Mao Zehong]], sister (executed by the Kuomintang in 1930)
 
There were several unsuccessful attempts to commercialize VLIW. The basic problem is that a VLIW computer does not scale to different price and performance points, as a dynamically scheduled computer can.
:Mao Zedong's parents altogether had six sons and two daughters. Two of the sons and both daughters died young, leaving the three brothers Mao Zedong, Mao Zemin, and Mao Zetan. Like all three of Mao Zedong's wives, Mao Zemin and Mao Zetan were communists. Like Yang Kaihui, both Zemin and Zetan were killed in warfare during Mao Zedong's lifetime.
Note that the character ''ze'' (&#27901;) appears in all of the siblings' given names. This is a common Chinese naming convention.
 
Also, VLIW computers optimise for throughput, not low latency, so they were not attractive to the engineers designing controllers and other computers embedded in machinery. The [[embedded system]]s markets had often pioneered other computer improvements by providing a large market that did not care about compatibility with older software.
Children:
* [[Mao Anying]] (&#27611;&#23736;&#33521;): son to Yang, married to Liu Siqi (&#21016;&#24605;&#40784;), who was born Liu Songlin (&#21016;&#26494;&#26519;), killed in action during the [[Korean War]]
* [[Mao Anqing]] (&#27611;&#23736;&#38738;): son to Yang, married to Shao Hua (&#37045;&#21326;), son Mao Xinyu (&#27611;&#26032;&#23431;)
* [[Li Min]] (&#26446;&#25935;): daughter to He, married to Kong Linghua (&#23380;&#20196;&#21326;), son Kong Ji'ning (&#23380;&#32487;&#23425;), daughter Kong Dongmei (&#23380;&#20908;&#26757;)
* Li Na (&#26446;&#35767;): daughter to Jiang (whose birth given name was Li), married to Wang Jingqing (&#29579;&#26223;&#28165;), son Wang Xiaozhi (&#29579;&#25928;&#33437;)
 
In January [[2000]], a company called [[Transmeta]] took the interesting
:Sources suggest that Mao did have other children during his revolutionary days; in most of these cases the children were left with peasant families because it was difficult to take care of the children while focusing on revolution. Two English researchers who retraced the entire Long March route in 2002-2003[http://www.chinadaily.com.cn/en/doc/2003-11/23/content_283948.htm]located a woman who they believe might well be a missing child abandoned by Mao and He to peasants in 1935[http://english.qianlong.com/7778/2003-4-16/208@792743.htm]. Ed Jocelyn and Andrew McEwen[http://www.newlongmarchers.com] hope a member of the Mao family will respond to requests for a DNA test.
step of placing a compiler in the central processing unit, and making the compiler translate from a reference byte code (in their case, [[x86]] instructions) to an internal VLIW instruction set. This approach
combines the hardware simplicity, low power and speed of VLIW RISC with
the compact main memory system and software reverse-compatibility provided
by popular CISC.
 
[[Intel]] released a chip, called the [[Itanium]], based on what they call an [[Explicitly Parallel Instruction Computing]] (EPIC) design. This design supposedly provides the VLIW advantage of increased instruction throughput. However, it avoids some of the issues of scaling and complexity, by explicitly providing in each "bundle" of instructions information concerning their dependencies. This information is calculated by the compiler, as it would be in a VLIW design. The early versions are also backward-compatible with current [[x86]] software by means of an on-chip [[emulation]] mode. Integer performance has been disappointing as have sales in volume markets.
== Writings ==
 
====Multi-threading====
Mao is the attributed author of ''[[Quotations from Chairman Mao Zedong]]'', known in the West as the "Little Red Book": this is a collection of extracts from his speeches and articles. He wrote several other philosophical treatises, both before and after he assumed power. These include:
* ''On Practice''; [[1937]]
* ''On Contradiction''; [[1937]]
* ''On New Democracy''; [[1940]]
* ''On Literature and Art''; [[1942]]
* ''On the Correct Handling of the Contradictions Among the People''; [[1957]]
* ''On Guerilla Warfare''.
* "In Memory of Doctor Bethune"
* "The Foolish Man Who Removed A Mountain"
* "Serve the People"
 
Also, we may soon see multi-threaded CPUs. Current designs work best when the computer is running only a single program, however nearly all modern [[operating system]]s allow the user to run multiple programs at the same time. For the CPU to change over and do work on another program requires expensive [[context switching]]. In contrast, a multi-threaded CPU could handle instructions from multiple programs at once.
Mao wrote [[poetry]], mainly in the ''[[ci (poetry)|ci]]'' and ''[[shi (poetry)|shi]]'' forms. Its literary merit is difficult to evaluate in the light of the author's controversial political status, and it is more highly thought of within the PRC than abroad.
 
To do this, such CPUs include several sets of registers. When a context switch occurs, the contents of the "working registers" are simply copied into one of a set of registers for this purpose.
See also:
*[[Famous military writers]]
*[[Mao (game)]]
 
Such designs often include thousands of registers instead of hundreds as in a typical design. On the downside, registers tend to be somewhat expensive in chip space needed to implement them. This chip space might otherwise be used for some other purpose.
== External links ==
{{wikiquote}}
*[http://www.etext.org/Politics/MIM/classics/mao/index.html Collected Works of Mao Zedong]
*[http://news.bbc.co.uk/media/audio/41246000/rm/_41246539_28.ram Interview part 1 (RealPlayer) 其采访录音(上) 请用RealPlayer打开]
*[http://news.bbc.co.uk/media/audio/41246000/rm/_41246435_29.ram Interview part 2 (RealPlayer) 其采访录音(下) 请用RealPlayer打开]
*[http://www.spartacus.schoolnet.co.uk/COLDmao.htm Mao Zedong Biography] From Spartacus Educational
*[http://artchina.free.fr/items/creasite.php?params=Mao%20Zedong_CATEGORY_0 Mao Zedong on propaganda posters] Set of propaganda paintings showing Mao Zedong as the great leader of China.
*[http://www.etext.org/Politics/MIM/ MIM] Maoist Internationalist Movement, a sect of Maoism (their theories are NOT the same as all Maoists)
*[http://art-bin.com/art/omaotoc.html Quotations from Chairman Mao Tse-tung] (Mao's most famous book, also known in the West as Mao's "Little Red Book")
*[http://marxists.org/glossary/terms/m/a.htm#maoism The Encyclopedia of Marxism] gives a Marxist (Trotskyist) view of Mao Zedong Thought.
*[http://www.marxists.org/glossary/people/m/a.htm#mao-tse-tung The Encyclopedia of Marxism] gives a [[Trotsky]]ist view of Mao's life. Parts of this article are based on it.
 
====Reconfigurable logic====
=== Reviews of ''Mao: The Unknown Story'' by Jung Chang ===
:''Main article at [[Mao: The Unknown Story]]''
*[http://www.amazon.co.uk/exec/obidos/ASIN/0224071262/qid=1120369825/sr=8-1/ref=pd_ka_1/026-6065789-2044429 Mao: The Unknown Story -- Jung Chang 张戎《毛泽东—不为人知的故事》]
*[http://news.bbc.co.uk/chinese/simp/hi/newsid_4630000/newsid_4638100/4638107.stm BBCChinese.com BBC中文网 中国丛谈特辑] (An Interview with Jung Chang)
* [http://www.guardian.co.uk/comment/story/0,,1534674,00.html A Great Leap Backward]
* [http://www.project-syndicate.org/commentary/shaw3 Mao, the False God]
* [http://www.the-tls.co.uk/this_week/story.aspx?story_id=2111465 Mad, Bad Mao] (by erudite sinologist Perry Link)
* [http://books.guardian.co.uk/reviews/biography/0,6121,1498718,00.html Bad Element]
* [http://www.spiked-online.com/Articles/0000000CAC41.htm Mao: The End of the Affair]
* [http://smh.com.au A Bow to Mao Now so Embarrassing] (You must sign in [free] to the Sydney Morning Herald for this review)
 
Another track of development is to combine reconfigurable logic with a general-purpose CPU. In this scheme, a special computer language compiles fast-running subroutines into a bit-mask to configure the logic. Slower, or less-critical parts of the program can be run by sharing their time on the CPU. This process has the capability to create devices such as software [[radio]]s, by using digital signal processing to perform functions usually performed by analog [[electronics]].
=== Video ===
*[http://www.chairmanmao.org/gb/yingxiang/shikuang/002.asf Mao declares the founding of the PRC] - 852 Kb [[Advanced Streaming Format|ASF]] file
 
====Public ___domain processors====
(In Chinese with Chinese subtitles)
 
As the lines between hardware and software increasingly blur due to progress in design methodology and availability of chips such as [[FPGA]]s and cheaper production processes, even [[open source hardware]] has begun to appear. Loosely-knit communities like [[OpenCores]] have recently announced completely open CPU architectures such as the [[OpenRISC]] which can be readily implemented on FPGAs or in custom produced chips, by anyone, without paying license fees.
== Reference ==
*[http://www.asiasource.org/society/mao.cfm Asia Source biography]
* Becker, Jasper. ''Hungry Ghosts : Mao's Secret Famine'', 1998.
* [[Jung Chang]]. ''Mao : The Unknown Story'', 2005.
* Li Zhi-Sui. ''The Private Life of Chairman Mao'', 1996.
 
====High end processor economics====
 
Developing new, high-end CPUs is a '''very''' expensive proposition. Both the logical complexity (needing very large logic design and logic verification teams and simulation farms with perhaps thousands of computers) and the high operating frequencies (needing large circuit design teams and access to the state-of-the-art fabrication process) account for the high cost of design for this type of chip. The design cost of a high-end CPU will be on the order of US $100 million. Since the design of such high-end chips nominally take about five years to complete, to stay competitive a company has to fund at least two of these large design teams to release products at the rate of 2.5 years per product generation. Only the personal computer mass market (with production rates in the hundreds of millions, producing billions of dollars in revenue) can support such economics. As of 2004, only four companies are actively designing and fabricating state of the art general purpose computing CPU chips: [[Intel]], [[AMD]], [[IBM]] and [[Fujitsu]]. [[Motorola]] has spun off its semiconductor division as [[Freescale]] as that division was dragging down profit margins for the rest of the company. [[Texas Instruments]], [[TSMC]] and [[Toshiba]] are a few examples of a companies doing manufacturing for another company's CPU chip design.
 
== Embedded design ==
{{start box}}
{{succession box|before=[[Chen Duxiu]]|after=[[Hua Guofeng]]|title=[[Chairman of the Communist Party of China]]|years=1945&ndash;1976}}
{{succession box|before=None|after=[[Liu Shaoqi]]|title=[[President of the People's Republic of China]]|years=1949&ndash;1959}}
{{succession box|before=--|after=[[Hua Guofeng]]|title=Chairman of the [[Central Military Commission]] of CCP|years=1936&ndash;1976}}
{{end box}}
 
The majority of computer systems in use today are embedded in other machinery, such as telephones, clocks, appliances, vehicles, and infrastructure. An [[embedded system]] usually has minimal requirements for memory and program length and may require simple but unusual input/output systems. For example, most embedded systems lack keyboards, screens, disks, printers, or other recognizable I/O devices of a personal computer. They may control electric motors, relays or voltages, and reed switches, variable resistors or other electronic devices. Often, the only I/O device readable by a human is a single light-emitting diode, and severe cost or power constraints can even eliminate that.
 
In contrast to general-purpose computers, embedded systems often seek to minimize [[interrupt latency]] over instruction throughput.
[[Category:1893 births|Mao, Zedong]]
[[Category:1976 deaths|Mao, Zedong]]
[[Category:Chinese people|Mao, Zedong]]
[[Category:Chinese politicians|Mao, Zedong]]
[[Category:Chinese poets|Mao, Zedong]]
[[Category:Cold War people|Mao, Zedong]]
[[Category:Communists|Mao, Zedong]]
[[Category:CPC leaders|Mao, Zedong]]
[[Category:Maoism|Mao, Zedong]]
 
When an electronic device causes an interrupt, the intermediate results, the registers, have to be saved before the software responsible for handling the interrupt can run, and then must be put back after it is finished. If there are more registers, this saving and restoring process takes more time, increasing the latency.
<!---->
 
Low-latency CPUs generally have relatively few registers in their central processing units, or they have "shadow registers" that are only used by the interrupt software.
[[ar:ماو تسي تونغ]]
 
[[bg:Мао Дзедун]]
=== Other design issues ===
[[ca:Mao Zedong]]
 
[[cs:Mao Zedong]]
<!-- [[virtual memory]] moved to [[Computer architecture]] -->
[[da:Mao Zedong]]
 
[[de:Mao Zedong]]
One interesting near-term possibility would be to eliminate the bus. Modern vertical [[laser diode]]s enable this change. In theory, an optical computer's components could directly connect through a holographic or phased open-air switching system. This would provide a large increase in effective speed and design flexibility, and a large reduction in cost. Since a computer's connectors are also its most likely failure point, a busless system might be more reliable, as well.
[[et:Mao Zedong]]
 
[[es:Mao Zedong]]
Another farther-term possibility is to use light instead of electricity for the digital logic itself.
[[eo:MAO Zedong]]
In theory, this could run about 30% faster and use less power, as well as permit a direct interface with quantum computational devices.
[[fr:Mao Zedong]]
The chief problem with this approach is that for the foreseeable future, electronic devices are faster, smaller (i.e. cheaper) and more reliable.
[[gl:Mao Tse Tung - 毛澤東]]
An important theoretical problem is that electronic computational elements are already smaller than some wavelengths of light, and therefore even wave-guide based optical logic may be uneconomic compared to electronic logic.
[[ko:마오쩌둥]]
We can therefore expect the majority of development to focus on electronics, no matter how unfair it might seem.
[[id:Mao Zedong]]
See also [[optical computing]].
[[it:Mao Zedong]]
 
[[he:מאו צה דונג]]
Yet another possibility is the "clockless CPU" (asynchronous CPU). Unlike conventional processors, clockless processors have no central clock to coordinate the progress of data through the pipeline.
[[lt:Mao Dzedunas]]
Instead, stages of the CPU are coordinated using logic devices called "pipe line controls" or "FIFO sequencers." Basically, the pipeline controller clocks the next stage of logic when the existing stage is complete. In this way, a central clock is unnecessary. There are two advantages to clockless CPUs over clocked CPUs:
[[hu:Mao Ce-tung]]
* components can run at different speeds in the clockless CPU. In a clocked CPU, no component can run faster than the clock rate.
[[mk:Мао Це Тунг]]
* In a clocked CPU, the clock can go no faster than the worst-case performance of the slowest stage. In a clockless CPU, when a stage finishes quicker than normal, the next stage can immediately take the results rather than waiting for the next clock tick. A stage might finish quicker than normal because of the particular data inputs (multiplication can be very fast if it is multiplying by 0 or 1), or because it is running at a higher voltage or lower temperature than normal.
[[nl:Mao Zedong]]
 
[[ja:毛沢東]]
Two examples of asynchronous CPUs are the [[ARM_architecture|ARM]]-implementing [[AMULET_microprocessor|AMULET]] and the asynchronous implementation of [[MIPS_architecture|MIPS]] R3000, dubbed [http://www.async.caltech.edu/mips.html MiniMIPS].
[[no:Mao Zedong]]
 
[[pl:Mao Zedong]]
The biggest disadvantage of the clockless CPU is that most CPU design tools assume a clocked CPU, so making a clockless CPU involves modifying the design tools to handle clockless logic and doing extra testing to ensure the design avoids [[Metastability in electronics|metastable]] problems. For example, the group that designs the aforementioned AMULET developed a tool called [http://www.cs.man.ac.uk/apt/projects/tools/lard/ LARD] to cope with the complex design of AMULET3.
[[pt:Mao Tse-tung]]
 
[[ru:Мао Цзэдун]]
==Design concepts==
[[sl:Mao Cetung]]
In general, all processors, micro or otherwise, run the same sort of task over and over:
[[fi:Mao Zedong]]
 
[[sv:Mao Zedong]]
#read an instruction and decode it
[[th:เหมาเจ๋อตุง]]
#find any associated data that is needed to process the instruction
[[uk:Мао Цзедун]]
#process the instruction
[[zh:毛泽东]]
#write the results out
 
Complicating this simple-looking series of events is the fact that [[main memory]] has always been slower than the processor itself. Step (2) often introduces a lengthy (in CPU terms) delay while the data arrives over the [[computer bus]]. A considerable amount of research has been put into designs that avoid these delays as much as possible. This often requires complex circuitry and was at one time found only on hand-wired [[supercomputer]] designs. However, as the manufacturing processes have improved, they have become a common feature of almost all designs.
 
===RISC===
The basic concept of [[RISC]] is to clearly identify what step 2 does. In older processor designs, now retroactively known as [[CISC]], the instructions were offered in a number of different modes that meant that step 2 took an unknown length of time to complete. In RISC, almost all instructions come in exactly one mode that reads data from one place -- the registers. These ''addressing modes'' are then handled by the [[compiler]], which writes code to load the data into the registers and store it back out. For this reason the term '''load-store''' is often used to describe this philosophy in design; there are many processors with limited instruction sets that are not really RISC.
 
The side effect of this change is twofold. One is that the resulting logic core is much smaller, largely by making step 1 and 2 much simpler. Secondly it means that step 2 always takes one cycle, also reducing the complexity of the overall chip design which would otherwise require complex "locks" that ensure the processor completes one instruction before starting the other. For any given level of performance, a RISC design will have a much smaller "gate count" (number of transistors), the main driver in overall cost -- in other words a fast RISC chip is much cheaper than a fast CISC chip.
 
The downside is that the program gets much longer as a side effect of the compiler having to write out explicit instructions for memory handling, the "code density" is lower. This increases the number of instructions that have to be read over the computer bus. When RISC was first being introduced there were arguments that the increased bus access would overwhelm the speed, and that such designs would actually be slower. In theory this might be true, but the real reason for RISC was to allow [[instruction pipeline]]s to be built much more easily.
 
===Instruction pipelining===
One of the first, and most powerful, techniques to improve performance is the [[instruction pipeline]]. Early microcoded designs would carry out all of the steps above for one instruction before moving onto the next. Large portions of the circuitry were left idle at any one step, for instance, the instruction decoding circuitry would be idle during execution and so on.
 
Pipelines improve performance by allowing a number of instructions to work their way through the processor at the same time. In the same basic example, the processor would start to decode (step 1) a new instruction while the last one was waiting for results. This would allow up to four instructions to be "in flight" at one time, making the processor look four times as fast. Although any one instruction takes just as long to complete, there's still four steps, the CPU as a whole "retires" instructions much faster and can be run at a much higher clock speed.
 
RISC make pipelines smaller, and much easier to construct by cleanly separating each stage of the instruction process and making them take the same amount of time -- one cycle. The processor as a whole operates in an [[assembly line]] fashion, with instructions coming in one side and results out the other. Due to the reduced complexity of the [[Classic RISC pipeline]], the pipelined core and an instruction cache could be placed on the same size die that would otherwise fit the core alone on a CISC design. This was the real reason that RISC was faster, early designs like the [[SPARC]] and [[MIPS architecture|MIPS]] often running over 10 times as fast as [[Intel]] and [[Motorola]] CISC solutions at the same clock speed and price.
 
Pipelines are by no means limited to RISC designs. By 1986 the top-of-the-line VAX (the 8800) was a heavily pipelined design, slightly predating the first commercial MIPS and SPARC designs. Most modern CPUs (even embedded CPUs) are now pipelined, and microcoded CPUs with no pipelining are seen only in the most area-constrained embedded processors. Large CISC machines, from the VAX 8800 to the modern Pentium 4 and Athlon, are implemented with both microcode and pipelines. Improvements in pipelining and caching are the two major microarchitectural advances that have enabled processor performance to keep pace with the circuit technology on which they are based.
 
===Speculative execution===
One problem with an instruction pipeline is that there are a class of instructions that must make their way entirely through the pipeline before execution can continue. In particular, conditional branches need to know the result of some prior instruction before "which side" of the branch to run is known. For instance, an instruction that says "if x is larger than 5 then do this, otherwise do that" will have to wait for the results of x to be known before it knows if the instructions for this or that can be fetched.
 
For a small four-deep pipeline this means a delay of up to three cycles -- the decode can still happen. But as clock speeds increase the depth of the pipeline increases with it, and modern processors may have 20 stages or more. In this case the CPU is being stalled for the vast majority of its cycles every time one of these instructions is encountered.
 
The solution, or one of them, is ''[[speculative execution]]'', also known as ''branch prediction''. In reality one side or the other of the branch will be called much more often than the other, so it is often correct to simply go ahead and say "x will likely be smaller than five, start processing that". If the prediction turns out to be correct, a huge amount of time will be saved. Modern designs have rather complex prediction systems, which watch the results of past branches to predict the future with greater accuracy.
 
===Cache===
It was not long before improvements in chip manufacturing allowed for even more circuitry to be placed on the die, and designers started looking for ways to use it. One of the most common was to add an ever-increasing amount of [[CPU cache|cache memory]] on-die. Cache is simply very fast memory, memory that can be accessed in a few cycles as opposed to "many" needed to talk to main memory. The CPU includes a cache controller which automates reading and writing from the cache, if the data is already in the cache it simply "appears", whereas if it is not the processor is "stalled" while the cache controller reads it in.
 
RISC designs started adding cache in the mid-to-late 1980s, often only 4k in total. This number grew over time, and modern CPU's typically include about 512kbytes, while CPU's intended for server use come with 1 or 2 Mbytes. Generally speaking, more cache means more speed.
 
===Out-of-order execution===
Use of cache also introduces a new delay when the data asked for by the CPU is not already in the cache. In early designs this would force the cache controller to stall the processor and wait. Of course there may be some other instruction in the program whose data ''is'' available in the cache at that point. [[out-of-order execution]] allows that instruction to be processed while the processor waits on the cache, then re-orders the results to make it appear that everything happened in the normal order.
 
===Superscalar designs===
Even with all of the added complexity and gates needed to support the concepts outlined above, chip manufacturing had soon made even them have room left over. This led to the rise of [[superscalar]] processors in the early 1990s, processors that could run more than one instruction at once.
 
In the outline above the processor runs parts of a single instruction at a time. If one were simply to place two entire cores on a die, then the processor would be able to run two instructions at once. However this is not actually required, as in the average program certain instructions are much more common than others. For instance, the load-store instructions on a RISC design are more common than [[floating point]], so building two complete cores isn't as efficient a use of space as building two load-store units and only one floating point.
 
In modern designs it is common to find two load units, one store (many instructions have no results to store), two or more integer math units, two or more floating point units, and often a [[SIMD]] unit of some sort. The decoder grows in complexity by reading in a huge list of instructions from memory and handing them off to the different units that are idle at that point. The results are then collected and re-ordered at the end, as in out-of-order.
 
===Simultaneous multithreading===
One of the newest techniques in high-speed processor design is [[simultaneous multithreading]]. Oddly it may have been easier to add this in the past than some of the other techniques described above.
 
The cache controller knows where in main memory any piece of data came from. It therefore "knows" that different data in the cache are actually from different programs entirely, a side effect of modern [[computer multitasking|multitasking]] [[operating system]]s. In simultaneous multithreading designs, the cache controller will not look just for the instruction that is ready, but the program (or thread) that is "most ready". This can be quite effective in many cases, as programs often switch between handling data and processing, simultaneous multithreading can make more effecient use of the various units in these cases by going out and finding entirely different programs to run while the "running one" waits for data.
 
== See also ==
 
* [[Microprocessor]]
* [[Moore's Law]]
* [[Amdahl's law]]
* [[Simultaneous multithreading]]
* [[RISC]]
* [[CISC]]
 
[[Category:Computer architecture]]
 
[[nl:Processorarchitectuur]]