Errata
Page 34, Example 2.8. The exponent field should be 10000001, not 10000011
Page 38, Problem 2.5. Using 5 bits to represent each number, write...
Page 39, Problem 2.13. binary representations, not binary numbers.
Page 40, Problem 2.18. Replace the problem with the following:
Express the negative value -27 as a 2's complement integer, using 8 bits. Repeat, using 16 bits. Repeat, using 32 bits. What does this illustrate with respect to the properties of sign extension, as they pertain to 2's complement representation?
Page 41, Problem 2.32. In Example 2.5, what are the masks used for?
Page 43, Problem 2.41. ASCII code for three is 0011 0011, instead of 0110 0011, as shown.
Page 48, Problem 4.10. NOT instead of NOP.
Page 87, Problem 4.5, part 2d. Change to: Interpret location 0 and 1 as unsigned integers.
Page 114, Problem 5.1. First line: NOP should be NOT.
Page 114, Problem 5.2. What is the page number for each of the following LC-2 memory addresses? Express your answers in hex.
Page 115, Problem 5.5. Change 2, 3, 4 as follows:
2. Write an LC-2 instruction that determines whether both machines 2 and 3 are busy.
3. Write an LC-2 instruction that indicates none of the machines are busy.
4. Change 13 to 6.
Page 116, Problem 5.10. The last
line of the program. The address should be 0100 0101 0110 1000,
not 0100 0101 0110 01111.
Page 117, Problem 5.18. Part 5, second line: Replace *did not change any of the opcodes* to *kept the number of opcodes at 16*
Page 117, Problem 5.19. First line:
The LC-2 ISA contains the instruction LDR DR,BaseR,offset. After the LDR instruction is decoded, the following operations (called microinstructions) are carried out to complete the processing of the LDR instruction:
* insert here lines 3 through 8 of the problem statement *
* Replace the subsequent items 1 and 2 with the following *
1. The MOVE instruction is not really necessary since it can be accomplished with a sequence of existing LC-2 instructions. What sequence of existing LC-2 instructions implements (also called "emulates") MOVE R0,R1 ?
2. If the MOVE instruction were added to the LC-2 ISA, what sequence of microinstructions, following the decode operation, would emulate MOVE DR,SR ?
Page 117, Problem 5.20. Restate problem as follows:
As stated in the text, we have saved the JMP/JSR and JMPR/JSRR for Chapter 9. Those who can't wait can find the description of these two instructions in Appendix A. Note that JMP and JSR have exactly the same opcode, but their execution depends on the value of L. Why is the case L=0 irrelevant to the LC-2 ISA? The opcodes JMPR and JSRR also have exactly the same opcode. However, for JMPR/JSRR, the case L=0 is not irrelevant. Why?
Page 118, Problem 5.21. First line. Change Section 3.5.5 to Section 5.3.5.
Page 155, Problem 7.14. We got the 0 and 1 wrong! So, change the wording in lines 5 and 6 so it reads:
If the strings are the same, the program terminates with the value 1 in R5. If the strings are different, the program terminates with the value 0 in R5.
Page 173, Figure 9.2 should contain
...
x0020 x0400
x0021 x0430
x0022 x0450
x0023 x4A0
...etc.
Page 222, Problem 10.8, part 3: replace ZYXWVUTSR with ZYXWV.
Page 222, Problem 10.9. Change problem statement to:
Describe, in your own words, how the Multiply step of the OpMult algorithm in Figure 10.12 works. How many instructions are executed to perform the Multiply step? Express your answer in terms of n, the value of the multiplier. [Note: If an instruction executes 5 times, it contributes 5 to the total count.] Write a program fragment that performs the Multiply step in fewer instructions if the value of the multiplier is less than 25. How many?
Problem 11.9.
This problem should read: What happens if we changed the second-to-last line of the program in Figure 11.2 from
printf("%d\n", counter);
to:
1. printf("%c\n", counter + 'A');
2. printf("%d\n%d\n", counter, counter + startPoint);
Page 294, Chapter 12.2.4: Disregard the last sentence of the first paragraph, "See Problem 15..." The while version of the program behaves like the do-while version.
Problem 13.11 - The correct answer is:
#include <stdio>
main()
{
int a, b;b = 10;
a = 5;
a = b - a;
b = a + a;if (a > 0)
printf('1');}
Page 308, Problem 13.15. This problem would be discarded. There is no difference in behavior between the code in Figure 13.10 and Figure 13.16.
Page 332, Problem 14.9. Part 2 should read: If the function food takes no arguments, then how many local variables must it have?
Page 344, Problem 15.4. The program should echo not only the alphabetic characters, but ALSO the numeric characters AND the space character.
Page 344-345, Problem 15.5. The problem is correct as stated, however the variable names in the function IsDivisibleBy were incorrectly used chosen. The parameter "divisor" should instead be "dividend" and the parameter "quotient" should instead be "divisor".
Page 363, Problem 16.9. The function which is defined as "void M( )" should be defined as "int M( )".
Page 427, Problem 19.4.
The printed version of this problem contains an error. It is also a very challenging problem.
An easier version of the problem is included below, and the solutions for this are provided in the solutions manual.
#include <stdio.h>
#define MAX 4
struct char_rec {
char ch;
struct char_rec *back;};
main()
{struct char_rec *ptr, pat[MAX + 2];
int i = 1, j = 1;printf("Pattern: ");
pat[1].back = pat;
ptr = pat;while ((pat[i].ch = getchar()) != '/n') {
pat[++i].back = ++ptr;
if (i > MAX) break;}
while (j < i)
printf("%d ", pat[j++].back - pat);
}
Page 449, Table A-3 will read:
x22 PUTS Write a string pointed to by R0 to the console. Each
memory location contains one ASCII character.
x24 PUTSP Write a string pointed to by R0 to the console. Each
memory location contains two ASCII characers.
feedback form |
permissions |
international |
locate your campus rep |
request a review copy
Copyright ©2001 The McGraw-Hill Companies.
digital solutions |
publish with us |
customer service |
mhhe home
Any use is subject to the
Terms of Use and Privacy Policy.
McGraw-Hill Higher Education is one of the many fine businesses of the
The McGraw-Hill Companies.