Solutions to End of Chapter Problems

advertisement

Solutions to End of Chapter Problems

Problem 1: Because data can only be stored in 2 states (on/off, open/closed, etc.).

Problem 2: Main memory is very expensive compared to secondary storage.

Problem 3: Secondary memory is very slow compared to main memory.

Problem 4: (a) Secondary memory (the hard drive)

(b) Main memory (i.e., Random Access Memory)

(c) Secondary memory (the hard drive)

Problem 5: False. Running programs are stored in main memory (i.e., Random Access Memory).

Problem 6: Secondary memory (the hard drive).

Problem 7: The operating system.

Problem 8: (a) 9216 bits / 8 bits per byte = 1152 bytes

(b) 1152 bytes / 4 bytes per word = 288 words

(c) 1152 bytes / 1024 bytes per KB = 1.125 KB

Problem 9. Writing the value of the position below each bit we have

1 0 0 0 0 0

32 16 8 4 2 1

Thus 100000

2

32

10

Problem 10. 10101

2

21

10

.

Problem 11: 0 1 1 1 0 1 0 1

2

7

2

6

2

5

2

4

2

3

2

2

2

1

2

0

0(128) + 1(64) + 1(32) + 1(16) + 0(8) + 1(4) + 0(2) + 1(1) = 64 + 32 + 16 + 4 + 1 = 117

10

Problem 12: 00101110 in base 2 is equivalent to 46 in base 10.

Problem 13. 78

10

1001110

2

Problem 14: 43

10

101011

2

5

Problem 15: 2

8

= 256 and 2

7

= 128 , so there is a 1 in the 2

7

position.

223 – 128 = 95. Since 2

6

= 64, there is a 1 in the 2

6

position.

95 – 64 = 31. Since 2 5 = 32 and 2 4 = 16, there is a 1 in the 2 4 position.

31 – 16 = 15. Since 2

3

= 8, there is a 1 in the 2

3

position.

15 – 8 = 7. Since 2

2

= 4, there is a 1 in the 2

2

position.

7 – 4 = 3. Since 2 1 = 2, there is a 1 in the 2 1 position.

3 – 2 = 1. Since 2

0

= 1, there is a 1 in the 2

0

position.

1 1 0 1 1 1 1 1

2

7

2

6

2

5

2

4

2

3

2

2

2

1

2

0

Problem 16. 0x27 is equivalent to 39 in base-10.

= 11011111

2

Problem 17: 0xBEE is equivalent to 3054 in base-10.

Problem 18. 0x100 is 100000000 in binary.

Problem 19: 0xF1E is equivalent to 111100011110 in binary.

Problem 20: 0xB9B

Problem 21. Since the first hexadecimal digit is C, the first four bits are 1100. Thus, the fourth bit is a zero.

Note how more difficult this question would have been if the address was provided in base-10 instead of in base-16.

Problem 22: The answer is 0x0000006B . The picture is:

Address

06B

06C

C

What is stored

is stored in these two bytes

06D

06E

06F

070

B is stored in these four bytes

071

072

073

A is stored in these four bytes

074

Problem 23: The letter k is stored as ASCII 0x6B which in binary is 01101011 .

Problem 24: The letter g is stored as ASCII 0x67 .

Problem 25: 0x138 + 0x6 = 0x13E .

Problem 26. 0x8D4 .

Problem 27: 0x113D

6

Problem 28:

(a)

0804839d

0804839e

0804839f

080483a0

080483a1

080483a2

080483a3

080483a4

(b) The four preceding addresses are (from lowest to highest):

08048398

08048399

0804839a

0804839b

(c) In ASCII, 0x55 = U, 0x53 =S, 0x4E = N, 0x41 = A, 0x21 = ! Thus: USNA!

Problem 29. 16 into 730 gives a quotient of 45 with a remainder of A

16 into 45 gives a quotient of 2 with a remainder of D

16 into 2 gives a quotient of 0 with a remainder of 2

Thus, 730

10

0x2DA . Since we are asked to use the number of hex digits appropriate for the x86 architecture, we must use 8 hex digits. Thus, the final answer is 0x000002DA

7

Download