1.3 Under the Covers 13 A compiler enables a programmer to write this high-level language expression: A+B The compiler would compile it into this assembly language statement: add A.B As shown above,the assembler would translate this statement into the binary instructions that tell the computer to add the two numbers A and B. High-level programming languages offer several important benefits.First,they allow the programmer to think in a more natural language,using English words and algebraic notation,resulting in programs that look much more like text than like tables of cryptic symbols(see Figure 1.3).Moreover,they allow languages to be designed according to their intended use.Hence,Fortran was designed for scientific computation,Cobol for business data processing,Lisp for symbol manipulation, and so on.There are also domain-specific languages for even narrower groups of users,such as those interested in simulation of fluids,for example. The second advantage of programming languages is improved programmer productivity.One of the few areas of widespread agreement in software develop- ment is that it takes less time to develop programs when they are written in languages that require fewer lines to express an idea.Conciseness is a clear advantage of high-level languages over assembly language. The final advantage is that programming languages allow programs to be inde- pendent of the computer on which they were developed,since compilers and assemblers can translate high-level language programs to the binary instructions of any computer.These three advantages are so strong that today little program- ming is done in assembly language. 1.3 Under the Covers Now that we have looked below your program to uncover the underlying software, let's open the covers of your computer to learn about the underlying hardware.The underlying hardware in any computer performs the same basic functions:inputting data,outputting data,processing data,and storing data.How these functions are performed is the primary topic of this book,and subsequent chapters deal with different parts of these four tasks. When we come to an important point in this book,a point so important that we hope you will remember it forever,we emphasize it by identifying it as a Big Picture item.We have about a dozen Big Pictures in this book,the first being
A compiler enables a programmer to write this high-level language expression: A + B The compiler would compile it into this assembly language statement: add A,B As shown above, the assembler would translate this statement into the binary instructions that tell the computer to add the two numbers A and B. High-level programming languages offer several important benefits. First, they allow the programmer to think in a more natural language, using English words and algebraic notation, resulting in programs that look much more like text than like tables of cryptic symbols (see Figure 1.3). Moreover, they allow languages to be designed according to their intended use. Hence, Fortran was designed for scientific computation, Cobol for business data processing, Lisp for symbol manipulation, and so on. There are also domain-specific languages for even narrower groups of users, such as those interested in simulation of fluids, for example. The second advantage of programming languages is improved programmer productivity. One of the few areas of widespread agreement in software development is that it takes less time to develop programs when they are written in languages that require fewer lines to express an idea. Conciseness is a clear advantage of high-level languages over assembly language. The final advantage is that programming languages allow programs to be independent of the computer on which they were developed, since compilers and assemblers can translate high-level language programs to the binary instructions of any computer. These three advantages are so strong that today little programming is done in assembly language. 1.3 Under the Covers Now that we have looked below your program to uncover the underlying software, let’s open the covers of your computer to learn about the underlying hardware. The underlying hardware in any computer performs the same basic functions: inputting data, outputting data, processing data, and storing data. How these functions are performed is the primary topic of this book, and subsequent chapters deal with different parts of these four tasks. When we come to an important point in this book, a point so important that we hope you will remember it forever, we emphasize it by identifying it as a Big Picture item. We have about a dozen Big Pictures in this book, the first being 1.3 Under the Covers 13
14 Chapter 1 Computer Abstractions and Technology the five components of a computer that perform the tasks of inputting,outputting, processing,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.Figure 1.4 shows the standard organization of a computer. The BIG This organization is independent of hardware technology:you can place Picture every piece of every computer,past and present,into one of these five cat- egories.To help you keep all this in perspective,the five components of a computer are shown on the front page of each of the following chapters, with the portion of interest to that chapter highlighted. Compiler Interface Computer Input Control Datapath Evaluating pertormance Output Processor Memory FIGURE 1.4 The organization of a computer,showing the five classic components.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
14 Chapter 1 Computer Abstractions and Technology the five components of a computer that perform the tasks of inputting, outputting, processing, 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. Figure 1.4 shows the standard organization of a computer. This organization is independent of hardware technology: you can place every piece of every computer, past and present, into one of these five categories. To help you keep all this in perspective, the five components of a computer are shown on the front page of each of the following chapters, with the portion of interest to that chapter highlighted. The BIG Picture FIGURE 1.4 The organization of a computer, showing the five classic components. 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
1.3 Under the Covers 15 ◆0盟 FIGURE 1.5 A desktop computer.The liquid crystal display(LCD)screen is the primary output device,and the keyboard and mouse are the primary input devices.On the right side is an Ethernet cable that connected the laptop to the network and the Web.The laptop contains the processor,memory, and additional I/O devices.This system is a Macbook Pro 15"laptop connected to an external display. Figure 1.5 shows a computer with keyboard,wireless mouse,and screen.This input device photograph reveals two of the key components of computers:input devices,such A mechanism through as the keyboard and mouse,and output devices,such as the screen.As the names which the computer is fed suggest,input feeds the computer,and output is the result of computation sent to information,such as the keyboard or mouse. the user.Some devices,such as networks and disks,provide both input and output to the computer. output device Chapter 6 describes input/output (I/O)devices in more detail,but let's take an A mechanism that introductory tour through the computer hardware,starting with the external I/O conveys the result of a devices. computation to a user or another computer
Figure 1.5 shows a computer with keyboard, wireless mouse, and screen. This photograph reveals two of the key components of computers: input devices, such as the keyboard and mouse, and output devices, such as the screen. As the names suggest, input feeds the computer, and output is the result of computation sent to the user. Some devices, such as networks and disks, provide both input and output to the computer. Chapter 6 describes input/output (I/O) devices in more detail, but let’s take an introductory tour through the computer hardware, starting with the external I/O devices. input device A mechanism through which the computer is fed information, such as the keyboard or mouse. output device A mechanism that conveys the result of a computation to a user or another computer. FIGURE 1.5 A desktop computer. The liquid crystal display (LCD) screen is the primary output device, and the keyboard and mouse are the primary input devices. On the right side is an Ethernet cable that connected the laptop to the network and the Web. The laptop contains the processor, memory, and additional I/O devices. This system is a Macbook Pro 15" laptop connected to an external display. 1.3 Under the Covers 15
16 Chapter 1 Computer Abstractions and Technology I got the idea for the Anatomy of a Mouse mouse while attending a talk at a computer Although many users now take mice for granted,the idea of a pointing device such conference.The speaker as a mouse was first shown by Doug Engelbart using a research prototype in 1967 was so boring that I The Alto,which was the inspiration for all workstations as well as for the Macintosh started daydreaming and Windows OS,included a mouse as its pointing device in 1973.By the 1990s,all and hit upon the idea. desktop computers included this device,and new user interfaces based on graphics displays and mice became the norm. Doug Engelbart The original mouse was electromechanical and used a large ball that when rolled across a surface would cause an x and y counter to be incremented.The amount of Through computer increase in each counter told how far the mouse had been moved. displays I have landed The electromechanical mouse has largely been replaced by the newer all-optical an airplane on the deck mouse.The optical mouse is actually a miniature optical processor including an of a moving carrier, LED to provide lighting,a tiny black-and-white camera,and a simple optical pro- observed a nuclear cessor.The LED illuminates the surface underneath the mouse;the camera takes particle hit a potential 1500 sample pictures a second under the illumination.Successive pictures are sent well,flown in a rocket to a simple optical processor that compares the images and determines whether at nearly the speed of the mouse has moved and how far.The replacement of the electromechanical light and watched a mouse by the electro-optical mouse is an illustration of a common phenomenon computer reveal its where the decreasing costs and higher reliability of electronics cause an electronic innermost workings. solution to replace the older electromechanical technology.On page 22 we'll see another example:flash memory. Ivan Sutherland,the “father'"of computer graphics,Scientific Through the Looking Glass American,1984 The most fascinating I/O device is probably the graphics display.All laptop and handheld computers,calculators,cellular phones,and almost all desktop comput- liquid crystal display ers now use liquid crystal displays (LCDs)to get a thin,low-power display. A display technology The LCD is not the source of light;instead,it controls the transmission of light. using a thin layer of liquid A typical LCD includes rod-shaped molecules in a liquid that form a twisting polymers that can be used helix that bends light entering the display,from either a light source behind the to transmit or block light according to whether a display or less often from reflected light.The rods straighten out when a current is charge is applied. applied and no longer bend the light.Since the liquid crystal material is between two screens polarized at 90 degrees,the light cannot pass through unless it is bent. active matrix display Today,most LCD displays use an active matrix that has a tiny transistor switch at A liquid crystal display using a transistor to each pixel to precisely control current and make sharper images.A red-green-blue control the transmission mask associated with each dot on the display determines the intensity of the three of light at each individual color components in the final image;in a color active matrix LCD,there are three pixel. transistor switches at each point. pixel The smallest The image is composed of a matrix of picture elements,or pixels,which can be individual picture element. represented as a matrix of bits,called a bit map.Depending on the size of the screen Screens are composed of and the resolution,the display matrix ranges in size from 640 x 480 to 2560 x 1600 hundreds of thousands pixels in 2008.A color display might use 8 bits for each of the three colors(red, to millions of pixels, blue,and green),for 24 bits per pixel,permitting millions of different colors to be organized in a matrix. displayed
16 Chapter 1 Computer Abstractions and Technology Anatomy of a Mouse Although many users now take mice for granted, the idea of a pointing device such as a mouse was first shown by Doug Engelbart using a research prototype in 1967. The Alto, which was the inspiration for all workstations as well as for the Macintosh and Windows OS, included a mouse as its pointing device in 1973. By the 1990s, all desktop computers included this device, and new user interfaces based on graphics displays and mice became the norm. The original mouse was electromechanical and used a large ball that when rolled across a surface would cause an x and y counter to be incremented. The amount of increase in each counter told how far the mouse had been moved. The electromechanical mouse has largely been replaced by the newer all-optical mouse. The optical mouse is actually a miniature optical processor including an LED to provide lighting, a tiny black-and-white camera, and a simple optical processor. The LED illuminates the surface underneath the mouse; the camera takes 1500 sample pictures a second under the illumination. Successive pictures are sent to a simple optical processor that compares the images and determines whether the mouse has moved and how far. The replacement of the electromechanical mouse by the electro-optical mouse is an illustration of a common phenomenon where the decreasing costs and higher reliability of electronics cause an electronic solution to replace the older electromechanical technology. On page 22 we’ll see another example: flash memory. Through the Looking Glass The most fascinating I/O device is probably the graphics display. All laptop and handheld computers, calculators, cellular phones, and almost all desktop computers now use liquid crystal displays (LCDs) to get a thin, low-power display. The LCD is not the source of light; instead, it 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, from either a light source behind the display or less often from reflected light. The rods straighten out when a current is applied and no longer bend the light. Since the liquid crystal material is between two screens polarized at 90 degrees, the light cannot pass through unless it is bent. Today, most LCD displays use an active matrix that has a tiny transistor switch at each pixel to precisely control current and make sharper images. A red-green-blue mask associated with each dot on the display determines the intensity of the three color components in the final image; in a color active matrix LCD, there are three transistor switches at each point. 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. Depending on the size of the screen and the resolution, the display matrix ranges in size from 640 × 480 to 2560 × 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. I got the idea for the mouse while attending a talk at a computer conference. The speaker was so boring that I started daydreaming and hit upon the idea. Doug Engelbart Through computer displays I have landed an airplane on the deck of a moving carrier, observed a nuclear particle hit a potential well, flown in a rocket at nearly the speed of light and watched a computer reveal its innermost workings. Ivan Sutherland, the “father” of computer graphics, Scientifc American, 1984 liquid crystal display A display technology using a thin layer of liquid polymers that can be used to transmit or block light according to whether a charge is applied. active matrix display A liquid crystal display using a transistor to control the transmission of light at each individual pixel. pixel The smallest individual picture element. Screens are composed of hundreds of thousands to millions of pixels, organized in a matrix
1.3 Under the Covers 17 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 onscreen is stored in the frame buffer,and the bit pattern per pixel is read out to the graphics display at the refresh rate.Figure 1.6 shows a frame buffer with a simplified design of just 4 bits per pixel. Frame buffer Raster scan CRT display Xo X1 Xo X1 FIGURE 1.6 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(X Y) contains the bit pattern 0011,which is a lighter shade on the screen than the bit pattern 1101 in pixel(X,Y). The goal of the bit map is to faithfully represent what is on the screen.The challenges in graphics systems arise because the human eye is very good at detecting even subtle changes on the screen. Opening the Box motherboard A plastic board containing If we open the box containing the computer,we see a fascinating board of thin packages of integrated plastic,covered with dozens of small gray or black rectangles.Figure 1.7 shows the circuits or chips,including contents of the laptop computer in Figure 1.5.The motherboard is shown in the processor,cache,memory, upper part of the photo.Two disk drives are in front-the hard drive on the left and and connectors for I/O a DVD drive on the right.The hole in the middle is for the laptop battery. devices such as networks and disks. The small rectangles on the motherboard contain the devices that drive our advancing technology,called integrated circuits and nicknamed chips.The board integrated circuit Also is composed of three pieces:the piece connecting to the I/O devices mentioned called a chip.A device earlier,the memory,and the processor. combining dozens to millions of transistors. The memory is where the programs are kept when they are running;it also contains the data needed by the running programs.Figure 1.8 shows that memory memory The storage is found on the two small boards,and each small memory board contains eight area in which programs integrated circuits.The memory in Figure 1.8 is built from DRAM chips.DRAM are kept when they are running and that contains the data needed by the running programs
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 onscreen is stored in the frame buffer, and the bit pattern per pixel is read out to the graphics display at the refresh rate. Figure 1.6 shows a frame buffer with a simplified design of just 4 bits per pixel. X0 X1 Y0 Frame buffer Raster scan CRT display 0 011 1 101 Y1 X0 X1 Y0 Y1 FIGURE 1.6 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 on the screen than the bit pattern 1101 in pixel (X1 , Y1 ). The goal of the bit map is to faithfully represent what is on the screen. The challenges in graphics systems arise because the human eye is very good at detecting even subtle changes on the screen. Opening the Box If we open the box containing the computer, we see a fascinating board of thin plastic, covered with dozens of small gray or black rectangles. Figure 1.7 shows the contents of the laptop computer in Figure 1.5. The motherboard is shown in the upper part of the photo. Two disk drives are in front—the hard drive on the left and a DVD drive on the right. The hole in the middle is for the laptop battery. The small rectangles on the motherboard contain the devices that drive our advancing technology, called integrated circuits and nicknamed chips. The board is composed of three pieces: the piece connecting to the I/O devices mentioned earlier, the memory, and the processor. The memory is where the programs are kept when they are running; it also contains the data needed by the running programs. Figure 1.8 shows that memory is found on the two small boards, and each small memory board contains eight integrated circuits. The memory in Figure 1.8 is built from DRAM chips. DRAM 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 a 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. 1.3 Under the Covers 17