0% found this document useful (0 votes)
11 views4 pages

Ch02 Selected

This document contains solutions to selected problems from Chapter 2 of a textbook on computer organization and design. The solutions include binary representations of numbers, logic gate truth tables, binary arithmetic calculations and overflow examples, bitwise operations, hexadecimal to binary conversions, and analyzing word length requirements.

Uploaded by

Moheud Malic
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views4 pages

Ch02 Selected

This document contains solutions to selected problems from Chapter 2 of a textbook on computer organization and design. The solutions include binary representations of numbers, logic gate truth tables, binary arithmetic calculations and overflow examples, bitwise operations, hexadecimal to binary conversions, and analyzing word length requirements.

Uploaded by

Moheud Malic
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Appendix F

Selected Solutions

F.2 Chapter 2 Solutions

2.1 The answer is 2n

2.3 (a) For 400 students, we need at least 9 bits.


(b) 29 = 512, so 112 more students could enter.

2.5 If each number is represented with 5 bits,

7 = 00111 in all three systems


-7 = 11000 (1's complement)
= 10111 (signed magnitude)
= 11001 (2's complement)

2.7 Refer to the following table:

0000 0
0001 1
0010 2
0011 3
0100 4
0101 5
0110 6
0111 7
1000 -8
1001 -7
1010 -6
1011 -5
1100 -4
1101 -3
1110 -2
1111 -1

2.9 Avogadro's number (6.02 x 1023) requires 80 bits to be represented in two's complement
binary representation.

1
2 APPENDIX F. SELECTED SOLUTIONS

2.11 (a) 01100110


(b) 01000000
(c) 00100001
(d) 10000000
(e) 01111111

2.13 (a) 11111010


(b) 00011001
(c) 11111000
(d) 00000001

2.15 Dividing the number by two.

2.17 (a) 1100 (binary) or -4 (decimal)


(b) 01010100 (binary) or 84 (decimal)
(c) 0011 (binary) or 3 (decimal)
(d) 11 (binary) or -1 (decimal)

2.19 11100101, 1111111111100101, 11111111111111111111111111100101. Sign


extension does not affect the value represented.

2.21 Overflow has occurred if both operands are positive and the result is negative, or if both
operands are negative and the result is positive.

2.23 Overflow has occurred in an unsigned addition when you get a carry out of the leftmost
bits.
2.25 Because their sum will be a number which if positive, will have a lower magnitude (less
positive) than the original positive number (because a negative number is being added
to it), and vice versa.

2.27 The problem here is that overflow has occurred as adding 2 positive numbers has
resulted in a negative number.

2.29 Refer to the following table:

X Y X AND Y
0 0 0
0 1 0
1 0 0
1 1 1

2.31 When at least one of the inputs is 1.


F.2. CHAPTER 2 SOLUTIONS 3

2.33 (a) 11010111


(b) 111
(c) 11110100
(d) 10111111
(e) 1101
(f) 1101

2.35 The masks are used to set bits (by ORing a 1) and to clear bits (by ANDing a 0).

2.37 [(n AND m AND (NOT s)) OR ((NOT n) AND (NOT m) AND s)] AND 1000

2.39 (a) 0 10000000 11100000000000000000000


(b) 1 10000100 10111010111000000000000
(c) 0 10000000 10010010000111111011011
(d) 0 10001110 11110100000000000000000

2.41 (a) 127


(b) -126

2.43 (a) Hello!


(b) hELLO!
(c) Computers!
(d) LC-2

2.45 (a) xD1AF


(b) x1F
(c) x1
(d) xEDB2

2.47 (a) -16


(b) 2047
(c) 22
(d) -32768

2.49 (a) x2939


(b) x6E36
(c) x46F4
(d) xF1A8
(e) The results must be wrong. In (3), the sum of two negative numbers produced a
positive result. In (4), the sum of two positive numbers produced a negative result. We
call such additions OVERFLOW.
4 APPENDIX F. SELECTED SOLUTIONS

2.51 (a) x644B


(b) x4428E800
(c) x48656C6C6F

2.53 Refer to the table below:

A B Q1 Q2
0 0 1 0
0 1 1 1
1 0 1 1
1 1 0 1
Q2 = A OR B

2.55 (a) 63
(b) 4n – 1
(c) 310
(d) 222
(e) 11011.11
(f) 0100 0001 1101 1110 0000 0000 0000 0000
(g) 4(4^m)

You might also like