Program Performance: - The Algorithm determines both the number of source-level statements and the number of I/O operations executed. - The Programming language, compiler, and architecture determines the number of computer instructions for each source-level statement - The Processor and memory system determines how fast instructions can be executed. - The I/O system (hardware and operating system) determines how fast I/O operations may be executed. Eight Great Ideas in Computer Architecture: 1. Moore’s Law a. IC resources double every 18-24 months, so when planning a project, that should be allocated while doing it. For example, if a project is projected to take 3 years, then a crucial aspect of the resource planning should take into account Moore’s Law and anticipate where technology will be when design finishes rather than design for where it starts. 2. Use Abstraction to Simplify Design a. Abstractions to simplify design as levels increase. Basically, lower-level intricate details are hidden to offer a more simple model at higher levels. 3. Make the Common Case Fast a. Optimize the common case first and make it fast instead of attempting to optimize the rare case. You must know what the common case is, which is only possible with careful experimentation and measurement. 4. Performance via Parallelism a. More performance by computing operations in parallel. Basic AI idea with using different hardware accelerator architectures such as GPUs, TPUs, NPUs, etc. AI has a bunch of data being computed and that needs to be computed as fast as possible to allow high throughput. 5. Performance via Pipelining a. Pipelining is a particular pattern of parallelism. It basically allows multiple components to work together and divide up the tasks, like an assembly line. 6. Performance via Prediction a. In some cases, it can be faster on average to guess and start working rather than wait until you know for sure, assuming that the mechanism to recover from a misprediction is not too expensive and your prediction is relatively accurate. 7. Hierarchy of Memories a. Programmers want the memory to be fast, large, and cheap as memory speed often shapes performance, capacity limits the size of problems that can be solved, and the cost of memory today is often the majority of computer cost. This can be solved with a hierarchy of memories. Cache gives the illusion that main memory is almost as fast as the top of the hierarchy and nearly as big and cheap as the bottom of the hierarchy. The closer to the top, the faster and more expensive per bit the memory; the wider the base of the layer, the bigger the memory. 8. Dependability via Redundancy a. Computers not only need to be fast but they need to be dependable. We can do this through redundancy. Any physical device can fail, so we need redundant components that can take over when a failure occurs and help detect failures. 1.3 Through abstraction, multiple layers can be placed over each other. A simplified example could be the middle being hardware, a layer above and the middle layer being systems software (operating systems, compilers, loaders, and assemblers), and the uppermost layer being application software. In complex applications, there are often multiple layers of application software as well. For example, a database system may run on top of the systems software hosting an application, which in turn runs on top of the database. Operating System interfaces between a user’s program and the hardware and provides a variety of service and supervisory functions. Among the most important are: - Handling basic input and output operations - Allocating storage and memory - Providing for protected sharing of the computer among multiple applications using it simultaneously Examples of operating systems in use today are Linux, iOS, and Windows. Compilers translate a program written in a high-level language, such as C, C++, or Java (etc.) into instructions that the hardware can execute. The translation between the complex modern programming languages and the basic instructions executed by the hardware, is very complex. An assembler is a program that translates a symbolic version of instructions (assembly language) into the binary version (machine language). Assembly is still very tedious and requires the programmer to write one line for every instruction that the computer will follow. 1.4 Hardware in any computer performs the same basic functions: inputting data, outputting data, processing data, and storing data. The five classic components of a computer are input, output, memory, datapath, and control, with the last two sometimes combined and called the processor/CPU. The computer has two “main parts”, being the processor and the memory. The processor gets instructions and data from memory. Input writes data or memory, and output reads data from memory. All this data then goes through an interface and through a compiler. Graphics Displays The graphic display is an example of an I/O device. Budget & Entry-Level Devices use LCDs (Liquid Crystal Display) as they are cheap to produce. The LCD controls the transmission of light. A typical LCD includes rod-shaped molecules in a liquid that form a twisting helix that bends light entering the display. The rods straighten out when a current is applied and no longer bend the light. Light can only pass through when it’s bent. LCDs use an active matrix display which has a tiny transistor switch at each pixel to control current precisely and make sharper images. In a color active matrix LCD, there are three transistor switches at each point (R,G,B). 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. A color display may use 8 bits for each of the three colors (R,G,B), for 24 bits per pixel, permitting millions of different colors to be displayed. 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 shown on the display is stored in the frame buffer, and the bit pattern per pixel is read to the graphics display at the refresh rate. Touchscreen There are many ways to implement a touch screen. One way is capacitive sensing. People are electrical conductors, so if an insulator like glass is covered with a transparent conductor, touching distorts the electrostatic field of the screen, which results in a change in capacitance. Inside the Computer The processor (image shown below) is made up of two main components: datapath and control. 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. The image shows the processor IC inside the A5 package. The A5 chip constraints two ARM processors that operate at a clock rate of 1 GHz and have 512 MB of main memory inside. There is also another chip for 32 GB flash memory for non-volatile storage (data which is permanently retained after power has been shut off. The processor/CPU follows the instructions of a program exactly. It adds numbers, signals I/O devices to activate, and so on. The image has two ARM processors or cores in the middle left of the chip and a PowerVR GPU with four datapaths in the upper left quadrant. To the left and bottom side of the ARM cores are interfaces to main memory (DRAM). The package also contains two memory chips which in total supply 512 MiB. The memory is where the programs are kept when they are running; it also contains the data needed by the running programs. The memory is built from DRAM chips. Multiple DRAMs are used together to contain the instructions and data of a program. The RAM portion of DRAM means the memory accesses are very quick as they are examples of volatile memory; where data is temporary (will be cleared when power is shut off). Inside the processor is cache memory. Cache memory consists of a small, faster memory that acts as a buffer for the DRAM memory. Cache is built using SRAM (static random access memory). SRAM is faster but less dense, and hence more expensive, than DRAM. SRAM and DRAM are two layers of the memory hierarchy. Instruction set architecture is the interface between hardware and low-level software. It typically includes anything programmers need to know to make a binary machine language program work correctly, including instructions, I/O devices, and so on. Typically, the OS will encapsulate the details of doing I/O, allocating memory, and other low-level system functions so that application programmers don’t need to worry about all of those details. The application binary interface (ABI) is the user portion of the instruction set plus the OS interfaces used by application programmers. A Safe Place for Data Main memory refers to volatile memory used to hold data and programs while they are running. Secondary memory refers to nonvolatile memory used to store data and programs between runs. Personal mobile devices use flash memory, a nonvolatile semiconductor memory, instead of hard disks. While this is slower than DRAM, it is much cheaper plus nonvolatile. Flash memory is the standard secondary memory for PMDs (personal mobile devices). Unlike disks and DRAM, flash memory bits wear out after 100,000 to 1,000,000 writes. So, file systems must keep track of the number of writes and have a plan to avoid wearing out storage, such as moving popular data. Communicating with Other Computers Computer networks interconnect whole computers, allowing computer users to extend the power of computing by including communication. They have several advantages: - Communication: Information is exchanged between computers at high speeds. - Resource sharing: Computers on the network can share I/O devices - Nonlocal access: By connecting computers over long distances, users don’t have to be by the computer they’re using. The most popular type of network is Ethernet. It can be up to a kilometer long and transfer at up to 40 gigabits per second. Its use case is mainly to connect computers on the same floor of a building. This is an example of a local area network (LAN). Wide area networks cross continents and are the backbone of the Internet, which supports the web. They are typically based on optical fibers. 1.5 Technologies for Building Processors and Memory Integrated circuits (IC) combine dozens to hundreds of transistors into a single chip. The abbreviation VLSI (very large-scale integrated circuit) is used to describe the tremendous increase in the number of transistors from hundreds to millions. The manufacture of a chip begins with silicon which is a substance found in sand. Since silicon doesn’t conduct well with electricity, it is called a semiconductor. Silicon can be transformed into one of three devices: - Excellent conductors of electricity - Excellent insulators from electricity - Areas that can conduct or insulate under specific conditions (as a switch) The process begins with silicon crystal ingot which is then sliced into very thin wafers. These wafers then go through a chemical process which creates the transistors, conductors, and insulators. 1.6 Performance Defining Performance As an individual computer user, we are interested in reducing response time; the time between the start and completion of a task, also known as execution time. Datacenter managers care more about increasing throughput or handwidth; the total amount of work done in a given time. Decreasing response time almost always improves throughput. Measuring Performance CPU execution time or CPU time is the time the CPU spends computing for the task and doesn’t include time spent waiting for I/O or running other programs. CPU time can then be broken down into the CPU time spent in the program, called user CPU time, and the CPU time spent in the OS performing tasks on behalf of the system, called system CPU time. CPU Time = Instruction count * CPI * Clock Cycle Time Instruction Performance Clock cycles per instruction, which is the average number of clock cycles each instruction takes to execute, is often abbreviated as CPI. To determine each it differs: - CPU execution time: find by running the program - Clock cycle time: usually published as part of the documentation for a computer The instruction count and CPI can be more difficult to obtain. If we know the clock rate and CPU execution time, we only need one of the instruction count or the CPI to determine the other. The instruction count depends on the architecture, but not on the exact implementation, so we can measure it without knowing all the details of the specific implementation. The CPI however depends on a wide variety of design details in the computer, including both the memory system and the processor structure, as well as on the mix of instruction types executed in an application. When comparing two computers, you must look at the clock rate, CPI, and instruction count, which all combine to form the execution time. - Algorithms affect the instruction count and CPI: it determines the number of source program instructions executed and hence the number of processor instructions - - - executed. The algorithm can also affect CPI, depending on using slower or faster instructions, like for example, using more divides will tend to have a higher CPI. Programming Language affects instruction count and CPI: statements in the language are translated to processor instructions so it will definitely affect the instruction count. It may also affect the CPI because of its features. For example, a language with heavy support for data abstraction (e.g., Java) will require indirect calls, which use higher CPI instructions. The Compiler affects Instruction count and CPI: the compiler determines the translation of the source language instructions into computer instructions. ISA affects all three; Instruction count, clock rate, and CPI: it affects the instructions needed for a function, the cost in cycles for each instruction, and the overall clock rate of the processor. 1.7 The Power Wall Power is a challenge for ICs for two reasons. First, power must be brought in and distributed around the chip. Second, power is dissipated as heat and must be removed.The world has run into the practical power limit for cooling commodity microprocessors. Scaling up processor clock speeds generated so much heat that standard cooling couldn’t keep the silicon from melting or manufacturing. What the world has pivoted to now, is multicore processors instead of building single, ultra-fast processors that burn too hot. The technology in ICs is called CMOS (complementary metal oxide semiconductor). For CMOS, the primary source of energy consumption is so-called dynamic energy, which is energy that is consumed when transistors switch states from 0 to 1 and vice versa. 1.8 The Switch from Uniprocessors to Multiprocessors Rather than continuing to decrease the response time of one program running on the single processor, now the standard is microprocessors with multiple processors per chip, where the benefit is more on throughput than response time. Processors are usually referred to as “cores”. Parallel programming is hard because, by definition, it’s performance programming. CPU Performance Equation, Amdhal’s Law Do not predict performance based on one of the clock rate, instruction count, or CPI. One alternative to time is MIPS (million instructions per second). MIPS is simply the instruction count divided by the product of execution time and 6. Faster computers mean larger MIPS.
0
You can add this document to your study collection(s)
Sign in Available only to authorized usersYou can add this document to your saved list
Sign in Available only to authorized users(For complaints, use another form )