Bài giảng Computer architecture - Chapter 1: Computer abstractions and technology
Introduction
Computers have led to a third revolution for civilization
(alongside the agricultural and the industrial revolutions)
There is now a new vein of scientific investigation,
• with computational scientists joining theoretical
• and experimental scientists in the exploration of new frontiers in
astronomy, biology, chemistry, physics, etc.
In recent past, the following applications were “computer science fiction.”
Computers in automobiles
Cell phones
Human genome project
World Wide Web
Search engines
Computers have led to a third revolution for civilization
(alongside the agricultural and the industrial revolutions)
There is now a new vein of scientific investigation,
• with computational scientists joining theoretical
• and experimental scientists in the exploration of new frontiers in
astronomy, biology, chemistry, physics, etc.
In recent past, the following applications were “computer science fiction.”
Computers in automobiles
Cell phones
Human genome project
World Wide Web
Search engines
Bạn đang xem 20 trang mẫu của tài liệu "Bài giảng Computer architecture - Chapter 1: Computer abstractions and technology", để tải tài liệu gốc về máy hãy click vào nút Download ở trên.
File đính kèm:
- bai_giang_computer_architecture_chapter_1_computer_abstracti.pdf
Nội dung text: Bài giảng Computer architecture - Chapter 1: Computer abstractions and technology
- CE COMPUTER ABSTRACTIONS and TECHNOLOGY 1. Introduction 2. Below your program 3. Under the Covers 4. Performance 11
- CE Below your program - Operating system These layers of hardware and software: - Compiler, etc. • Applications • Systems software • Hardware Systems software: Software that provides services that are commonly useful. There are many types of systems software, but two types of systems software are central to every computer system today: • An operating system • And a compiler Fig.1 A simplified view of hardware Operating system: Supervising program and software as hierarchical layers, that manages the resources of a computer for shown as concentric circles with hardware in the center and the benefit of the programs that run on that applications software outermost machine. Compiler: A program that translates high- level language statements into assembly language statements. 12
- CE Below your program Operating system An operating system interfaces between a user’s program and the hardware and provides a variety of services and supervisory functions. Among the most important functions are . handling basic input and output operations . allocating storage and memory . providing for sharing the computer among multiple applications using it simultaneously Examples of operating systems in use today are Windows, Linux, and MacOS. Compiler Compilers perform another vital function: the translation of a program written in a high-level language, such as C or Java, into instructions that the hardware can execute. Given the sophistication of modern programming languages and the simple instructions executed by the hardware, the translation from a high-level language program to hardware instructions is complex. 13
- CE Below your program From a High-Level Language to the Language of Hardware Computer alphabet: 0 and 1 To actually speak to an electronic machine, you need to send electrical signals. The easiest signals for machines to understand are on (0) and off (1) • English alphabet is 26 letters • Computer alphabet is 2 letters binary number; each letter as a binary digit or bit Computer language Instruction: A command that computer hardware understanding and obeys. For example: 1000110010100000 – tell one computer to add two numbers How to programmers communicate to computers The first programmers communicated to computers in binary numbers, but this was so tedious that they quickly invented new notations that were closer to the way humans think 14
- CE Below your program From a High-Level Language to the Language of Hardware How to programmers communicate to computers Assembly language: A symbolic representation of machine Instructions Assembler: A program that translates a symbolic version of instructions into the binary version. High-level programming language: A portable language such as C, Fortran, or Java composed of words and algebraic notation that can be translated by a compiler into assembly language. Note: Although the translation from high-level language to binary machine language is shown in two steps (Figure 2), some compilers cut out the middleman and produce binary machine language Fig.2 C program compiled into assembly directly language and then assembled into binary 15 machine language
- CE COMPUTER ABSTRACTIONS and TECHNOLOGY 1. Introduction 2. Below your program 3. Under the Covers 4. Performance 16
- CE Under the Covers Let’s open the covers of the computer to learn about the underlying hardware. The underlying hardware in any computer performs the same basic functions: inputting data outputting data processing data storing data The five classic components of a computer are: Input Output Memory Datapath Control (with the last two sometimes combined and called the processor) 17
- CE Under the Covers The processor gets instructions and data from memory. Input writes data to memory, and output reads data from memory. Control sends the signals that determine the operations of the datapath, memory, input, and output. Fig.3 The organization of a computer, showing the five classic components. 18
- CE Under the Covers The screen is the primary output device Keyboard and mouse are the primary input devices The box contains the processor as well as additional I/O devices. (Some devices, such as networks and disks, provide both input and output to the computer) o Electromechanical mouse (original mouse) o Optical mouse Fig.4 A desktop computer LCD – Liquid crystal displays: thin, low power display CRT - cathode ray tube: Based on television technology 19
- CE Under the Covers The color images • The image is composed of a matrix of picture elements, or pixels, which can be represented as a matrix of bits, called a bit map. Pixel: The smallest individual picture element. Screen are composed of hundreds of thousands to millions of pixels, organized in a matrix. • Depending on the size of the screen and the resolution, the display matrix ranges in size from 640 x 480 to 2560 x 1600 pixels in 2008 • A color display might use 8 bits for each of the three colors (red, blue, and green), for 24 bits per pixel, permitting millions of different colors to be displayed. 20
- CE Under the Covers The color images The computer hardware support for graphics consists mainly of a raster refresh buffer, or frame buffer, to store the bit map. The image to be represented on screen is stored in the frame buffer, and the bit pattern per pixel is read out to the graphics display at the refresh rate. Fig.5 Frame buffer with a simplified design of just 4 bits per pixel. Each coordinate in the frame buffer on the left determines the shade of the corresponding coordinate for the raster scan CRT display on the right. Pixel (X0, Y0) contains the bit pattern 0011, which is a lighter shade of gray on the screen than the bit pattern 1101 in pixel (X1, Y1). 21
- CE Under the Covers Opening the Box Fig.6 Inside the desktop computer 22 Fig.7 Inside the laptop computer
- CE Under the Covers Opening the Box • Motherboard: A plastic board containing packages of integrated circuits or chips, including processor, cache, memory, and connectors for I/O devices such as networks and disks. • Integrated circuit: Also called chip. A device combining dozens to millions of transistors. • Memory: The storage area in which programs are kept when they are running and that contains the data needed by the running programs. Dynamic random access memory (DRAM): Memory built as an integrated circuit, it provides random access to any location. RAM – Random access memory, in contrast to sequential access memories, such as magnetic tapes, means that memory access take basically the same amount of time no matter what portion of the memory is read. DIMM (dual inline memory module): A small board that contains DRAM chips on both sides. SIMMs have DRAMs on only one side. 23
- CE Under the Covers Opening the Box • Central processor unit (CPU): Also called processor. The active part of the computer, which contains the datapath and control and which adds numbers, tests numbers, signals I/O devices to activate, and so on. • Datapath: The component of the processor that performs arithmetic operations. • Control: The component of the processor that commands the datapath, memory, and I/O devices according to the instructions of the program. The datapath performs the arithmetic operations, and control tells the datapath, memory, and I/O devices what to do according to the wishes of the instructions of the program. Datapath and control, the respective brawn and brain of the processor. 24
- CE Under the Covers Details of a micro-processor Fig.8 Inside the AMD Barcelona microprocessor. The left-hand side use a microphotograph of the AMD Barcelona processor chip, and the right-hand side shows the major blocks in the processor. This chip has four processors or “cores”. 25
- CE Under the Covers Details of a micro-processor Cache: Inside the processor is another type of memory - cache memory. Cache memory consists of a small, fast memory that acts as a buffer for the DRAM memory. Cache is built using a different memory technology, static random access memory (SRAM). SRAM is faster but less dense, and hence more expensive, than DRAM. 26
- CE Under the Covers A safe place for data • Volatile memory: Storage, such as DRAM, that only retains data only if it is receiving power • Nonvolatile memory: A form of memory that retains data even in the absence of a power source and that is used to store programs between runs. Magnetic disk is nonvolatile. Main memory: Also called primary memory. Volatile memory used to hold programs while they are running; typically consists of DRAM in today’s computers. Secondary memory: Non-volatile memory used to store programs and data between runs; typically consists of magnetic disks in today’s computers. Magnetic disk (also called hard disk): A form of nonvolatile secondary memory composed of rotating platters coated with a magnetic recording material. o Gigabyte: Traditionally 1.073.741.824 (230) bytes, although some communications and secondary storage systems have redefined it to mean 1.000.000.000 (109) bytes. Similarly, depending on the context, megabyte is either 109 or 230 bytes. o Although most hard drives appear inside computers, hard drives can also be attached using external interfaces such as universal serial bus (USB). Optical disks: CDs (Compact disks) and DVDs (Digital video disks) 27
- CE Under the Covers A safe place for data Flash memory: . A nonvolatile semiconductor memory, is used instead of disks in mobile devices such as cell phones and is increasingly replacing disks in music player and even laptops. . Is cheaper and slower than DRAM but more expensive and faster than magnetic disks. 28
- CE Under the Covers Communicating with Other Computers Computer networks: connect whole computers, allowing computer users to extend the power of computing by including communication. Networks have become so popular that they are the backbone of current computer systems Networked computers have several major advantages: ■ Communication: Information is exchanged between computers at high speeds. ■ Resource sharing: Rather than each machine having its own I/O devices, devices can be shared by computers on the network. ■ Nonlocal access: By connecting computers over long distances, users need not be near the computer they are using. 29
- CE Under the Covers Communicating with Other Computers Networks vary in length and performance, with the cost of communication increasing according to both the speed of communication and the distance that information travels. . Ethernet (Perhaps the most popular type of network): It can be up to a kilometer long and transfer at up to 10 gigabits per second. useful to connect computers on the same floor of a building; hence, it is an example of what is generically called a local area network. Local area network (LAN): A network designed to carry data within a geographically confined area, typically within a single building. . Wide area networks (cross continents and are the backbone of the Internet, which supports the World Wide Web): It can be up to hundreds of kilometers long and transfer at up to gigabits per second. They are typically based on optical fibers and are leased from telecommunication companies. Wide area network (WAN): A network extended over hundreds of kilometers which can span a continent. . Wireless technology (widely deployed, and most laptops now incorporate this technology): Currently available wireless technologies, called by the IEEE standard name 802.11, allow for transmission rates from 1 to less than 100 million bits per second. 30
- CE Under the Covers Technologies for Building Processors and Memories . Transistor: An on/off switch controlled by an electric signal very large scale integrated . . Very large scale integrated circuit (VLSI): A device containing hundreds of thousands to millions of transistors. . Moore’s law: the number of transistors on integrated circuits doubles approximately every 18–24 months (made by Gordon Moore, one of the founders of Intel during the 1960s.) 31
- CE Under the Covers Technologies for Building Processors and Memories Fig.9 Moore's law. Source: ’s_law 32
- CE COMPUTER ABSTRACTIONS and TECHNOLOGY 1. Introduction 2. Below your program 3. Under the Covers 4. Performance 33
- CE Performance Response time: Also called execution time. The total time requires for the computer to complete a task, including disk accesses, memory accesses, I/O activities, operating system overhead, CPU execution time, and so on. Throughput: Also called bandwidth. Another measure of performance, it is the number of tasks completed per unit time. 34
- CE Performance Clock cycle: Also called tick, clock tick, clock period, clock, cycle. The time for one clock period, usually of the processor clock, which runs at a constant rate. Clock period: The length of each clock cycle. 35
- CE Performance CPI (clock cycle per instruction): Average number of clock cycles per instruction for a program or program fragment. 36
- CE Performance MIPS (Million instructions per second): A measurement of program execution speed based on the number of millions of instructions. MIPS is computed as the instruction count divided by the product of the execution time and 106. 37
- CE Performance Example 1. Our favorite program runs in 10 seconds on computer A, which has a 2 GHz clock. We are trying to help a computer designer build a computer, B, which will run this program in 6 seconds. The designer has determined that a substantial increase in the clock rate is possible, but this increase will affect the rest of the CPU design, causing computer B to require 1.2 times as many clock cycles as computer A for this program. What clock rate should we tell the designer to target? 38
- CE Performance Example 1. 39
- CE Performance Example 2. Suppose we have two implementations of the same instruction set architecture. Computer A has a clock cycle time of 250 ps and a CPI of 2.0 for some program, and computer B has a clock cycle time of 500 ps and a CPI of 1.2 for the same program. Which computer is faster for this program and by how much? 40
- CE Performance Example 2. 41
- CE Performance Example 3. 42
- CE Performance Example 3. 43
- CE Performance In conclusion, three basic components of performance: 44
- CE Performance The performance of a program depends on algorithm, the language, the compiler, the architecture, and the actual hardware. The following table summarizes how these components affect the factors in the CPU performance equation 45