Solution Manual For Foundations of Computer Engineering, Edition 1 By Marilyn Wolf, Ph.D., Electrical Engineering, Stanford University
1 Part Instructor's Manual 2 Part Instructor's Manual 3 Part Instructor's Manual Chapter 1: Hardware and Software 1. Give an example of a computing service supplied by a data center. Shopping, credit card transactions, video streaming, banking. 2. Give an example of a computing application that makes use of both a personal computer and a data center. Bank account access, video streaming, shopping. 3. Give an example of an Internet-of-Things device. Video doorbell, thermostat. 4. Give an example of an application that makes use of an Internet-of-Things device connected by a network to another computer. Video doorbell, remote control doorbell. 5. Can the block diagram of a computer system in Figure 1.15 be expanded to include two CPUs? Explain your answer. Yes, both CPUs can be connected to the bus. 6. Give an example of an I/O device. Mouse, keyboard, display, storage device. 7. Redraw the block diagram of Figure 1.15 to include a graphics unit and a touchpad.
8. Where does an executable program reside in Figure 1.15? The executable program resides in memory. 9. Draw a UML object diagram of a two-function calculator that performs addition and subtraction. Include the keyboard, display, and calculator application.
10. Draw a UML sequence diagram for performing 2 + 3 = 5 on the two-function calculator.
11. Draw a UML state diagram for the two-function calculator application.
12. Give an example of a computer application that exhibits each of these trade-offs: a. Low cost, simple computing. Garage door opener. b. Moderate cost, general-purpose computing, flexible I/O. Laptop. c. Moderate cost, communication-centric computing, low power consumption. Smartphone. d. High-performance computing, large memory capacity. Data center server. 13. Write each of the digits 0 through 7 as a byte. 0: 00000000 1: 00000001
2: 00000010 3: 00000011 4: 00000100 5: 00000101 6: 00000110 7: 00000111 14. Write each of these decimal numbers as a sixteen-bit number: a. 15 0000000000001111 b. 16 0000000000010000 c. 2047 0000011111111111 d. 3333 0000110100000101 e. 10352 0010100001110000 15. How many bits are required to represent the 26 characters of the Roman alphabet? , enough for the 26 characters plus room for several others. 16. What role does an operating system play in the operation of a computer system? The operating system manages resources including the CPU, memory, storage, and I/O devices. 17. Draw a UML state diagram for a blinking light that blinks three dots (…). Show each operation as a state.
18. Give three utilities provided by an integrated development environment. Program editor and syntax checker, compiler, linker, loader, debugger. 19. Can an integrated development environment run on the same computer for which the program is being developed? Yes, integrated development environments have been built to support Windows and Mac development. 20. A program includes a bug caused by testing the wrong variable in an if statement. Describe how you can identify this bug: a. Without using a debugger. Output statements can be added to indicate when the program executes a certain path. These statements can help to isolate where the program takes the wrong path. b. Using a debugger. The debugger will allow breakpoints or single-stepping that allow you to view the program’s execution path as it runs.
Chapter 2: Operating Systems and Applications 1. What capabilities are provided by the operating system on your laptop computer?
Provide user interface, manage file system, provide I/O services, share computer among several applications, manage network communications. 2. What errors could be caused by two applications that directly save data on a storage device without going through an operating system? The applications could destroy each other’s data. 3. How could two applications share the CPU without going through an operating system? What errors might be introduced? The two applications could be written to transfer control to the other application. A programming error could cause one application to not transfer control, locking the other application out of the computer. 4. Give an example of a single application running concurrently as two separate processes. Two instances of an editor, each editing a different file? 5. Why might a program follow two different threads of execution at different times? Different data values can cause each thread to follow different paths of execution. 6. Can a computer system with a single CPU provide real concurrency? Explain. A basic CPU can execute only one program at a time. However, some CPUs provide multithreading that allow it to switch between multiple threads. The CPU may also operate concurrently with storage devices or I/O devices. 7. What happens to data stored in memory when the computer is disconnected from power? Memory is voltatile and will lose its data values when power is removed. 8. What happens to data stored in a solid-state disk when the computer is disconnected from power? Data stored in an SSD will be retained when power is removed. However, if power is removed while a write operation is in process, that data may be corrupted. 9. Is data stored in memory considered a file? No, data in memory is not organized in a file system. However, some data read or written to the file system may be temporarily stored in memory. 10. Describe a directory entry for a file foo.c whose data is stored in three separate areas of the chip: the first third of the file starting at storage location 100; the second third of the file starting at location 100,000; the third part of the file starting at location 51,326. 11. Draw a directory three that describes these three files: /a/b/c/foo.c, /a/b/d/foo.c, /x/y/foo.c