



















Preview text:
  lOMoAR cPSD| 58950985         lOMoAR cPSD| 58950985  2 
Chapter 1 / Basic Concepts and Computer evolution Learning Objectives 
After studying this chapter, you should be able to:  
 Explain the general functions and structure of a digital computer.  
 Present an overview of the evolution of computer technology from early digital 
computers to the latest microprocessors.  
 Present an overview of the evolution of the x86 architecture.  
 Define embedded systems and list some of the requirements and constraints that 
various embedded systems must meet.  
1.1 Organization and architecture 
 In describing computers, a distinction is often made between computer 
architecture and computer organization. Although it is difficult to give precise 
definitions for these terms, a consensus exists about the general areas covered by 
each. For example, see [VRAN80], [SIEW82], and [BELL78a]; an interesting 
alternative view is presented in [REDD76]. 
 Computer architecture refers to those attributes of a system visible to a 
programmer or, put another way, those attributes that have a direct impact on the 
logical execution of a program. A term that is often used interchangeably with 
computer architecture is instruction set architecture (ISA). The ISA defines 
instruction formats, instruction opcodes, registers, instruction and data memory; 
the effect of executed instructions on the registers and memory; and an algorithm 
for control ling instruction execution. Computer organization refers to the 
operational units and their interconnections that realize the architectural 
specifications. Examples of architectural attributes include the instruction set, the 
number of bits used to represent various data types (e.g., numbers, characters), 
I/O mechanisms, and techniques for addressing memory. Organizational attributes 
include those hardware details transparent to the programmer, such as control 
signals; interfaces between the computer and peripherals; and the memory  technology used. 
 For example, it is an architectural design issue whether a computer will 
have a multiply instruction. It is an organizational issue whether that instruction 
will be implemented by a special multiply unit or by a mechanism that makes 
repeated use of the add unit of the system. The organizational decision may be 
based on the anticipated frequency of use of the multiply instruction, the relative 
speed of the two approaches, and the cost and physical size of a special multiply  unit.             lOMoAR cPSD| 58950985  3 
CHƯƠNG 1 / CÁC KHÁI NIỆM CƠ BẢN VÀ SỰ PHÁT TRIỂN CỦA MÁY  TÍNH  Mục tiêu học tập 
 Sau khi học xong chương này, bạn sẽ có khả năng: 
 Giải thích các chức năng chung và cấu trúc của một máy tính số. 
 Trình bày tổng quan về sự tiến hóa của công nghệ máy tính từ những máy tính 
số đầu tiên đến các vi xử lý mới nhất. 
 Trình bày tổng quan về sự tiến hóa của kiến trúc x86. 
 Định nghĩa các hệ thống nhúng và liệt kê một số yêu cầu và giới hạn mà các hệ 
thống nhúng phải đáp ứng. 
1.1 TỔ CHỨC VÀ KIẾN TRÚC 
 Khi mô tả về máy tính, thường có sự phân biệt giữa kiến trúc máy tính và tổ 
chức máy tính. Mặc dù rất khó để đưa ra định nghĩa chính xác cho các thuật ngữ này, 
nhưng có sự đồng thuận về các lĩnh vực chung mà mỗi thuật ngữ này đề cập đến. Ví 
dụ, có thể tham khảo [VRAN80], [SIEW82], và [BELL78a]; một quan điểm thay thế 
thú vị được trình bày trong [REDD76]. 
 Kiến trúc máy tính đề cập đến những đặc điểm của hệ thống mà lập trình 
viên có thể nhìn thấy, hoặc nói cách khác, những đặc điểm có tác động trực tiếp đến 
việc thực thi logic của một chương trình. Một thuật ngữ thường được sử dụng thay thế 
cho kiến trúc máy tính là kiến trúc bộ lệnh (ISA). ISA định nghĩa các định dạng lệnh, 
mã lệnh, các thanh ghi, bộ nhớ lệnh và dữ liệu; tác động của các lệnh đã thực thi lên 
các thanh ghi và bộ nhớ; và thuật toán điều khiển việc thực thi lệnh. Tổ chức máy 
tính đề cập đến các đơn vị hoạt động và sự kết nối của chúng để thực hiện các đặc tả 
kiến trúc. Các đặc điểm của kiến trúc bao gồm bộ lệnh, số bit được sử dụng để biểu 
diễn các kiểu dữ liệu khác nhau (ví dụ: số, ký tự), cơ chế I/O, và kỹ thuật định địa chỉ 
bộ nhớ. Các đặc điểm tổ chức bao gồm những chi tiết phần cứng mà lập trình viên 
không cần quan tâm, chẳng hạn như tín hiệu điều khiển; giao diện giữa máy tính và 
các thiết bị ngoại vi; và công nghệ bộ nhớ được sử dụng. 
 Ví dụ, đó là một vấn đề thiết kế kiến trúc liệu máy tính có lệnh nhân 
(multiply) hay không. Còn đó là vấn đề tổ chức liệu lệnh đó sẽ được thực hiện bởi một 
đơn vị nhân đặc biệt hay bởi một cơ chế tái sử dụng đơn vị cộng (add unit) của hệ 
thống. Quyết định tổ chức có thể dựa trên tần suất sử dụng dự kiến của lệnh nhân, tốc 
độ tương đối của hai phương pháp, cũng như chi phí và kích thước vật lý của một đơn  vị nhân đặc biệt.      4      lOMoAR cPSD| 58950985
 Historically, and still today, the distinction between architecture and 
organ ization has been an important one. Many computer manufacturers offer a 
family of computer models, all with the same architecture but with differences in 
organization. Consequently, the different models in the family have different price 
and perform ance characteristics. Furthermore, a particular architecture may 
span many years and encompass a number of different computer models, its 
organization changing with changing technology. A prominent example of both 
these phenomena is the IBM System/370 architecture. This architecture was first 
introduced in 1970 and included a number of models. The customer with modest 
requirements could buy a cheaper, slower model and, if demand increased, later 
upgrade to a more expensive, faster model without having to abandon software 
that had already been developed. Over the years, IBM has introduced many new 
models with improved technology to replace older models, offering the customer 
greater speed, lower cost, or both. These newer models retained the same 
architecture so that the customer’s software investment was protected.  
Remarkably, the System/370 architecture, with a few enhancements, has survived 
to this day as the architecture of IBM’s mainframe product line.  
 In a class of computers called microcomputers, the relationship between 
archi tecture and organization is very close. Changes in technology not only 
influence organization but also result in the introduction of more powerful and 
more complex architectures. Generally, there is less of a requirement for 
generation- to- generation compatibility for these smaller machines. Thus, there is 
more interplay between organizational and architectural design decisions. An 
intriguing example of this is the reduced instruction set computer (RISC), which  we examine in Chapter 15. 
 This book examines both computer organization and computer 
architecture. The emphasis is perhaps more on the side of organization. However, 
because a computer organization must be designed to implement a particular 
architectural specification, a thorough treatment of organization requires a 
detailed examination of architecture as well.   5 
 Lich sử,và còn đến ngày nay, sự phân biệt giữa kiến trúc và tổ chức luôn là 
một điểm quan trọng. Nhiều nhà sản xuất máy tính cung cấp một gia đình các mô hình 
máy tính, tất cả đều có cùng kiến trúc nhưng khác biệt về tổ chức. Do đó, các mô hình 
khác nhau trong gia đình này có những đặc điểm về giá cả và hiệu suất khác nhau. 
Hơn nữa, một kiến trúc cụ thể có thể kéo dài qua nhiều năm và bao gồm nhiều mô 
hình máy tính khác nhau, với tổ chức thay đổi theo công nghệ thay đổi. Một ví dụ nổi 
bật cho cả hai hiện tượng này là kiến trúc IBM System/370. Kiến trúc này lần đầu tiên 
được giới thiệu vào năm 1970 và bao gồm một số mô hình. Khách hàng có yêu cầu      lOMoAR cPSD| 58950985
khiêm tốn có thể mua một mô hình rẻ hơn, chậm hơn và, nếu nhu cầu tăng lên, có thể 
nâng cấp lên một mô hình đắt tiền hơn, nhanh hơn mà không phải từ bỏ phần mềm đã 
phát triển trước đó. Trong suốt những năm qua, IBM đã giới thiệu nhiều mô hình mới 
với công nghệ cải tiến để thay thế các mô hình cũ, mang lại cho khách hàng tốc độ cao 
hơn, chi phí thấp hơn, hoặc cả hai. Những mô hình mới này giữ nguyên kiến trúc để 
bảo vệ đầu tư phần mềm của khách hàng. Đáng chú ý, kiến trúc System/370, với một 
số cải tiến, đã tồn tại cho đến ngày nay như là kiến trúc của dòng sản phẩm mainframe  của IBM. 
 Trong một lớp máy tính gọi là máy tính vi mô, mối quan hệ giữa kiến trúc 
và tổ chức là rất gần gũi. Những thay đổi trong công nghệ không chỉ ảnh hưởng đến tổ 
chức mà còn dẫn đến việc giới thiệu các kiến trúc mạnh mẽ và phức tạp hơn. Thông 
thường, yêu cầu về khả năng tương thích giữa các thế hệ máy tính đối với những máy 
tính nhỏ hơn này ít hơn. Do đó, có nhiều sự tương tác giữa quyết định thiết kế tổ chức 
và kiến trúc. Một ví dụ thú vị về điều này là máy tính với bộ lệnh giảm (RISC), mà 
chúng ta sẽ nghiên cứu trong Chương 15. 
 Cuốn sách này nghiên cứu cả tổ chức máy tính và kiến trúc máy tính. Mặc 
dù sự chú trọng có thể nghiêng về phía tổ chức, nhưng vì tổ chức máy tính phải được 
thiết kế để thực hiện một đặc tả kiến trúc cụ thể, nên việc xem xét kỹ lưỡng về tổ chức 
yêu cầu phải có một nghiên cứu chi tiết về kiến trúc.      6 
1.2 Structure and Function  
 A computer is a complex system; contemporary computers contain 
millions of elementary electronic components. How, then, can one clearly describe 
them? The key is to recognize the hierarchical nature of most complex systems, 
including the computer [SIMO96]. A hierarchical system is a set of interrelated 
subsystems, each of the latter, in turn, hierarchical in structure until we reach 
some lowest level of elementary subsystem.  
 The hierarchical nature of complex systems is essential to both their 
design and their description. The designer need only deal with a particular level of      lOMoAR cPSD| 58950985
the system at a time. At each level, the system consists of a set of components and 
their interrelationships. The behavior at each level depends only on a simplified, 
abstracted characterization of the system at the next lower level. At each level, the 
designer is concerned with structure and function: 
 ■ Structure: The way in which the components are interrelated. ■ 
Function: The operation of each individual component as part of the structure. 
 In terms of description, we have two choices: starting at the bottom and  
building up to a complete description, or beginning with a top view and 
decomposing the system into its subparts. Evidence from a number of fields 
suggests that the top-down approach is the clearest and most effective [WEIN75]. 
The approach taken in this book follows from this viewpoint. The computer system 
will be described from the top down. We begin with the major components of a 
computer, describing their structure and function, and proceed to successively 
lower layers of the hierarchy. The remainder of this section provides a very brief 
overview of this plan of attack.    7  
1.2 CÁU TRÚC VÀ CHỨC NĂNG 
 Máy tính là một hệ thống phức tạp; các máy tính hiện đại chứa hàng triệu 
thành phần điện tử cơ bản. Vậy làm thế nào để có thể mô tả chúng một cách rõ ràng? 
Chìa khóa là nhận ra tính chất phân cấp của hầu hết các hệ thống phức tạp, bao gồm cả 
máy tính [SIMO96]. Một hệ thống phân cấp là một tập hợp các hệ thống con có mối 
quan hệ với nhau, mỗi hệ thống con này, lần lượt, lại có cấu trúc phân cấp cho đến khi 
chúng ta đạt đến một mức độ cơ bản nhất của hệ thống con. 
 Tính phân cấp của các hệ thống phức tạp là yếu tố quan trọng trong cả thiết 
kế và mô tả của chúng. Nhà thiết kế chỉ cần làm việc với một mức độ của hệ thống tại 
mỗi thời điểm. Ở mỗi mức độ, hệ thống bao gồm một tập hợp các thành phần và mối 
quan hệ của chúng. Hành vi ở mỗi mức độ chỉ phụ thuộc vào một đặc điểm đơn giản 
hóa, trừu tượng của hệ thống ở mức độ thấp hơn. Ở mỗi mức độ, nhà thiết kế quan tâm 
đến cấu trúc và chức năng: 
 ■ Cấu trúc: Cách các thành phần liên kết với nhau. 
 ■ Chức năng: Hoạt động của từng thành phần như một phần của cấu trúc. 
 Về mặt mô tả, chúng ta có hai sự lựa chọn: bắt đầu từ dưới lên và xây dựng 
dần lên một mô tả đầy đủ, hoặc bắt đầu từ cái nhìn tổng thể và phân tách hệ thống 
thành các phần nhỏ hơn. Các bằng chứng từ nhiều lĩnh vực cho thấy phương pháp tiếp 
cận từ trên xuống là rõ ràng và hiệu quả nhất [WEIN75]. 
 Phương pháp được áp dụng trong cuốn sách này dựa trên quan điểm này. 
Hệ thống máy tính sẽ được mô tả từ trên xuống. Chúng ta bắt đầu với các thành phần      lOMoAR cPSD| 58950985
chính của một máy tính, mô tả cấu trúc và chức năng của chúng, và tiến hành đến các 
lớp dưới của hệ thống phân cấp. Phần còn lại của mục này cung cấp một cái nhìn tổng 
quan rất ngắn gọn về kế hoạch tiếp cận này.   8   Function 
 Both the structure and functioning of a computer are, in essence, simple. In 
general terms, there are only four basic functions that a computer can perform:  
 ■ Data processing: Data may take a wide variety of forms, and the range of 
processing requirements is broad. However, we shall see that there are only a few 
fundamental methods or types of data processing.  
 ■ Data storage: Even if the computer is processing data on the fly (i.e., data 
come in and get processed, and the results go out immediately), the computer must 
temporarily store at least those pieces of data that are being worked on at any given 
moment. Thus, there is at least a short- term data storage function. Equally important, 
the computer performs a long- term data storage function. Files of data are stored on 
the computer for subsequent retrieval and update.  
 ■ Data movement: The computer’s operating environment consists of devices 
that serve as either sources or destinations of data. When data are received from or 
delivered to a device that is directly connected to the computer, the process is known 
as input– output (I/O), and the device is referred to as a peripheral. When data are 
moved over longer distances, to or from a remote device, the process is known as data  communications.  
 ■ Control: Within the computer, a control unit manages the computer’s 
resources and orchestrates the performance of its functional parts in response to  instructions.       lOMoAR cPSD| 58950985
 The preceding discussion may seem absurdly generalized. It is certainly 
possible, even at a top level of computer structure, to differentiate a variety of 
functions, but to quote [SIEW82]:  
 There is remarkably little shaping of computer 
structure to fit the function to be performed. At the root of this lies 
the general- purpose nature of computers, in which all the 
functional specialization occurs at the time of programming and  not at the time of design   9  CHỨC NĂNG 
Cả cấu trúc và chức năng của một máy tính về bản chất đều rất đơn giản. Nói chung, 
có bốn chức năng cơ bản mà một máy tính có thể thực hiện: 
 ■ Xử lý dữ liệu: Dữ liệu có thể có nhiều dạng khác nhau, và yêu cầu về xử lý 
cũng rất đa dạng. Tuy nhiên, chúng ta sẽ thấy rằng chỉ có một vài phương pháp cơ bản 
hoặc loại xử lý dữ liệu. 
 ■ Lưu trữ dữ liệu: Ngay cả khi máy tính đang xử lý dữ liệu trực tiếp (tức là dữ 
liệu vào và được xử lý, và kết quả ra ngay lập tức), máy tính vẫn phải tạm thời lưu trữ 
ít nhất những phần dữ liệu đang được xử lý vào bất kỳ thời điểm nào. Do đó, có ít nhất 
một chức năng lưu trữ dữ liệu ngắn hạn. Cũng quan trọng không kém, máy tính thực 
hiện chức năng lưu trữ dữ liệu dài hạn. Các tệp dữ liệu được lưu trữ trong máy tính để 
có thể truy xuất và cập nhật sau này. 
 ■ Di chuyển dữ liệu: Môi trường vận hành của máy tính bao gồm các thiết bị 
phục vụ như nguồn hoặc đích của dữ liệu. Khi dữ liệu được nhận từ hoặc gửi đến một 
thiết bị được kết nối trực tiếp với máy tính, quá trình này được gọi là nhập-xuất (I/O), 
và thiết bị đó được gọi là ngoại vi. Khi dữ liệu được di chuyển qua các khoảng cách 
dài hơn, đến hoặc từ một thiết bị từ xa, quá trình này được gọi là truyền thông dữ liệu. 
 ■ Điều khiển: Bên trong máy tính, một đơn vị điều khiển quản lý các tài 
nguyên của máy tính và điều phối hoạt động của các bộ phận chức năng của nó theo  các lệnh.      lOMoAR cPSD| 58950985
 Cuộc thảo luận trên có thể có vẻ quá tổng quát. Chắc chắn rằng, ngay cả ở 
mức độ cao nhất của cấu trúc máy tính, chúng ta có thể phân biệt một loạt các chức 
năng, nhưng để trích dẫn từ [SIEW82]: 
 Có rất ít sự điều chỉnh cấu trúc máy tính để phù hợp với 
chức năng cần thực hiện. Nền tảng của điều này là tính chất máy 
tính đa dụng, trong đó tất cả sự chuyên biệt chức năng xảy ra vào 
thời điểm lập trình chứ không phải lúc thiết kế.   10  Structure 
We now look in a general way at the internal structure of a computer. We begin with a 
traditional computer with a single processor that employs a microprogrammed control 
unit, then examine a typical multicore structure.  
Simple single- processor computer Figure 1.1 provides a hierarchical view of the 
internal structure of a traditional single- processor computer. There are four main  structural components: 
  ■ Central processing unit (CPU): Controls the operation of the computer 
and performs its data processing functions; often simply referred to as processor.   
 ■ Main memory: Stores data.      lOMoAR cPSD| 58950985  11  CÁU TRÚC 
Bây giờ, chúng ta sẽ nhìn chung về cấu trúc bên trong của một máy tính. Chúng ta bắt 
đầu với một máy tính truyền thống có một bộ xử lý duy nhất sử dụng đơn vị điều khiển 
lập trình vi mô, sau đó xem xét một cấu trúc đa lõi điển hình. 
MÁY TÍNH ĐƠN LÕI ĐƠN GIẢN Hình 1.1 cung cấp một cái nhìn phân cấp về cấu 
trúc bên trong của một máy tính truyền thống với bộ xử lý đơn. Có bốn thành phần cấu  trúc chính: 
 ■ Đơn vị xử lý trung tâm (CPU): Kiểm soát hoạt động của máy tính và 
thực hiện các chức năng xử lý dữ liệu của nó; thường được gọi đơn giản là bộ  xử lý. 
 ■ Bộ nhớ chính: Lưu trữ dữ liệu.        lOMoAR cPSD| 58950985   12    
Figure 1.1 The Computer: Top-Level Structure CPU Registers Internal bus Control  unit ALU 
 ■ I/O: Moves data between the computer and its external environment.  
 ■ System interconnection: Some mechanism that provides for 
communication among CPU, main memory, and I/O. A common example of 
system intercon nection is by means of a system bus, consisting of a number 
of conducting wires to which all the other components attach.  
 There may be one or more of each of the aforementioned components. Tra 
ditionally, there has been just a single processor. In recent years, there has been 
increasing use of multiple processors in a single computer. Some design issues relat 
ing to multiple processors crop up and are discussed as the text proceeds; Part Five  focuses on such computers      lOMoAR cPSD| 58950985 13   
Hình 1.1 Máy tính: Cấu trúc bậc cao 
 ■ I/O: Di chuyển dữ liệu giữa máy tính và môi trường bên ngoài của nó. 
■ Kết nối hệ thống: Một cơ chế cung cấp khả năng giao tiếp giữa CPU, bộ nhớ chính 
và I/O. Một ví dụ phổ biến về kết nối hệ thống là thông qua một bus hệ thống, bao 
gồm một số dây dẫn mà tất cả các thành phần khác gắn vào. 
 Có thể có một hoặc nhiều thành phần như đã đề cập ở trên. Truyền thống, máy 
tính chỉ có một bộ xử lý duy nhất. Trong những năm gần đây, việc sử dụng nhiều bộ 
xử lý trong một máy tính đơn lẻ ngày càng trở nên phổ biến. Một số vấn đề thiết kế 
liên quan đến việc sử dụng nhiều bộ xử lý sẽ được đề cập và thảo luận khi bài viết tiếp 
tục; Phần Năm tập trung vào các máy tính như vậy.      lOMoAR cPSD| 58950985   14 
 Each of these components will be examined in some detail in Part Two. 
However, for our purposes, the most interesting and in some ways the most complex 
component is the CPU. Its major structural components are as follows:  
 ■ Control unit: Controls the operation of the CPU and hence the  computer. 
 ■ Arithmetic and logic unit (ALU): Performs the computer’s data  processing functions.  
 ■ Registers: Provides storage internal to the CPU.  
 ■ CPU interconnection: Some mechanism that provides for 
communication among the control unit, ALU, and registers.  
 Part Three covers these components, where we will see that complexity is 
added by the use of parallel and pipelined organizational techniques. Finally, there 
are sev eral approaches to the implementation of the control unit; one common 
approach is a microprogrammed implementation. In essence, a microprogrammed 
control unit operates by executing microinstructions that define the functionality of the 
control unit. With this approach, the structure of the control unit can be depicted, as in 
Figure 1.1. This structure is examined in Part Four.  
 Multicore Computer Structure As was mentioned, contemporary 
computers generally have multiple processors. When these processors all reside on a 
single chip, the term multicore computer is used, and each processing unit (consisting 
of a control unit, ALU, registers, and perhaps cache) is called a core. To clarify the 
terminology, this text will use the following definitions.  
 ■ Central processing unit (CPU): That portion of a computer that fetches 
and executes instructions. It consists of an ALU, a control unit, and registers. In a 
system with a single processing unit, it is often simply referred to as a processor.  
 ■ Core: An individual processing unit on a processor chip. A core may be 
equiv alent in functionality to a CPU on a single- CPU system. Other specialized pro 
cessing units, such as one optimized for vector and matrix operations, are also  referred to as cores.  
 ■ Processor: A physical piece of silicon containing one or more cores. The 
processor is the computer component that interprets and executes instruc tions. If a 
processor contains multiple cores, it is referred to as a multicore processor.     15      lOMoAR cPSD| 58950985
 After about a decade of discussion, there is broad industry consensus on this 
usage. Another prominent feature of contemporary computers is the use of multiple 
layers of memory, called cache memory, between the processor and main memory. 
Chapter 4 is devoted to the topic of cache memory. For our purposes in this section, 
we simply note that a cache memory is smaller and faster than main memory and is 
used to speed up memory access, by placing in the cache data from main memory, that 
is likely to be used in the near future. A greater performance improvement may be 
obtained by using multiple levels of cache, with level 1 (L1) closest to the core and 
additional levels (L2, L3, and so on) progressively farther from the core. In this 
scheme, level n is smaller and faster than level n + 1.         lOMoAR cPSD| 58950985   16    
 Mỗi thành phần này sẽ được xem xét chi tiết trong Phần Hai. Tuy nhiên, đối với 
mục đích của chúng ta, thành phần thú vị nhất và theo một số cách là thành phần phức 
tạp nhất là CPU. Các thành phần cấu trúc chính của nó bao gồm: 
 ■ Đơn vị điều khiển: Kiểm soát hoạt động của CPU và do đó của toàn bộ máy  tính. 
 ■ Đơn vị số học và logic (ALU): Thực hiện các chức năng xử lý dữ liệu của  máy tính. 
 ■ Thanh ghi: Cung cấp bộ nhớ bên trong CPU. 
 ■ Kết nối CPU: Một cơ chế cung cấp khả năng giao tiếp giữa đơn vị điều 
khiển, ALU và các thanh ghi. 
 Phần Ba sẽ bao phủ các thành phần này, nơi chúng ta sẽ thấy rằng độ phức tạp 
được gia tăng nhờ việc sử dụng các kỹ thuật tổ chức song song và ống dẫn. Cuối 
cùng, có một số cách tiếp cận để triển khai đơn vị điều khiển; một cách tiếp cận phổ 
biến là triển khai bằng vi chương trình. Về bản chất, một đơn vị điều khiển vi chương 
trình hoạt động bằng cách thực thi các vi lệnh định nghĩa chức năng của đơn vị điều 
khiển. Với phương pháp này, cấu trúc của đơn vị điều khiển có thể được mô tả như 
trong Hình 1.1. Cấu trúc này sẽ được xem xét trong Phần Bốn. 
 CÁU TRÚC MÁY TÍNH ĐA LÕI Như đã đề cập, các máy tính hiện đại thường có 
nhiều bộ xử lý. Khi tất cả các bộ xử lý này đều nằm trên một chip duy nhất, thuật ngữ 
"máy tính đa lõi" được sử dụng, và mỗi đơn vị xử lý (bao gồm đơn vị điều khiển, 
ALU, thanh ghi và có thể là bộ nhớ đệm) được gọi là một lõi. Để làm rõ thuật ngữ, 
cuốn sách này sẽ sử dụng các định nghĩa sau: 
 ■ Đơn vị xử lý trung tâm (CPU): Phần của máy tính thực hiện việc lấy và thực 
thi lệnh. Nó bao gồm ALU, đơn vị điều khiển và thanh ghi. Trong một hệ thống với 
một đơn vị xử lý duy nhất, nó thường được gọi đơn giản là bộ xử lý. 
 ■ Lõi: Một đơn vị xử lý riêng lẻ trên một chip bộ xử lý. Một lõi có thể tương 
đương về chức năng với một CPU trong hệ thống có một CPU. Các đơn vị xử lý 
chuyên biệt khác, chẳng hạn như một lõi được tối ưu hóa cho các phép toán vectơ và 
ma trận, cũng được gọi là lõi. 
 ■ Bộ xử lý: Một phần silicon vật lý chứa một hoặc nhiều lõi. Bộ xử lý là thành 
phần của máy tính giải thích và thực thi các lệnh. Nếu một bộ xử lý chứa nhiều lõi, nó 
được gọi là bộ xử lý đa lõi.      lOMoAR cPSD| 58950985 17 
Sau khoảng một thập kỷ thảo luận, đã có sự đồng thuận rộng rãi trong ngành công 
nghiệp về cách sử dụng thuật ngữ này.   
 Một đặc điểm nổi bật khác của các máy tính hiện đại là việc sử dụng nhiều 
lớp bộ nhớ, gọi là bộ nhớ đệm (cache), giữa bộ xử lý và bộ nhớ chính. Chương 4 dành 
riêng cho chủ đề bộ nhớ đệm. Đối với mục đích của chúng ta trong phần này, chúng ta 
chỉ lưu ý rằng bộ nhớ đệm nhỏ hơn và nhanh hơn bộ nhớ chính và được sử dụng để 
tăng tốc độ truy cập bộ nhớ, bằng cách đưa vào bộ nhớ đệm những dữ liệu từ bộ nhớ 
chính có khả năng sẽ được sử dụng trong tương lai gần. Cải thiện hiệu suất lớn hơn có 
thể đạt được bằng cách sử dụng nhiều cấp độ bộ nhớ đệm, với cấp độ 1 (L1) gần nhất 
với lõi và các cấp độ bổ sung (L2, L3, và các cấp độ tiếp theo) xa dần lõi. Trong sơ đồ 
này, cấp độ n nhỏ hơn và nhanh hơn cấp độ n + 1.        lOMoAR cPSD| 58950985 18    
 Figure 1.2 is a simplified view of the principal components of a typical multicore 
computer. Most computers, including embedded computers in smartphones and 
tablets, plus personal computers, laptops, and workstations, are housed on a 
motherboard. Before describing this arrangement, we need to define some terms. A 
printed circuit board (PCB) is a rigid, flat board that holds and interconnects chips 
and other electronic components. The board is made of layers, typically two to ten, 
that interconnect components via copper pathways that are etched into the board. The 
main printed circuit board in a computer is called a system board or motherboard, 
while smaller ones that plug into the slots in the main board are called expansion  boards. 
 The most prominent elements on the motherboard are the chips. A chip is a 
single piece of semiconducting material, typically silicon, upon which electronic 
circuits and logic gates are fabricated. The resulting product is referred to as an 
integrated circuit.        lOMoAR cPSD| 58950985 19 
Figure 1.2 Simplified View of Major Elements of a Multicore Computer      lOMoAR cPSD| 58950985 19 
 Hình 1.2 là một cái nhìn đơn giản về các thành phần chính của một máy tính 
đa lõi điển hình. Hầu hết các máy tính, bao gồm máy tính nhúng trong điện thoại 
thông minh và máy tính bảng, cũng như máy tính cá nhân, laptop và trạm làm việc, 
đều được lắp đặt trên một bo mạch chủ. Trước khi mô tả cấu hình này, chúng ta cần 
định nghĩa một số thuật ngữ. Bo mạch in (PCB) là một tấm board cứng, phẳng, dùng 
để gắn và kết nối các vi mạch và các thành phần điện tử khác. Tấm board này được 
cấu tạo từ được khắc vào tấm board. Bo mạch in chính trong một máy tính được gọi là 
bo mạch hệ thống hoặc bo mạch chủ, trong khi các bo mạch nhỏ hơn cắm vào các 
khe trên bo mạch chính được gọi là bo mạch mở rộng. 
 Các yếu tố nổi bật nhất trên bo mạch chủ là các vi mạch. Một vi mạch là một 
mảnh vật liệu bán dẫn duy nhất, thường là silicon, trên đó các mạch điện tử và cổng 
logic được chế tạo. Sản phẩm cuối cùng này được gọi là một mạch tích hợp.   
Hình 1.2 Cái nhìn đơn giản về các yếu tố chính của một máy tính đa lõi