You are on page 1of 2

94 Chapter 2 The Logic of Compound Statements

Solution A316 = 101000112


BB16 = 101110112
5916 = 010110012
2E16 = 001011102 ■

Test Yourself
1. To represent a nonnegative integer in binary notation means 6. To find the 8-bit two’s complement of a positive integer a
to write it as a sum of products of the form , where . that is at most 255, you , , and .
2. To add integers in binary notation, you use the facts that 7. If a is an integer with −128 ≤ a ≤ 127, the 8-bit represen-
12 + 12 = and 12 + 12 + 12 = . tation of a is if a ≥ 0 and is if a < 0.
3. To subtract integers in binary notation, you use the facts that 8. To add two integers in the range −128 through 127 whose
102 − 12 = and 112 − 12 = . sum is also in the range −128 through 127, you , ,
, and .
4. A half-adder is a digital logic circuit that
, and a full-adder is a digital logic circuit 9. To represent a nonnegative integer in hexadecimal notation
that . means to write it as a sum of products of the form ,
where .
5. The 8-bit two’s complement of a positive integer a
is . 10. To convert a nonnegative integer from hexadecimal to binary
notation, you and .

Exercise Set 2.5


Represent the decimal integers in 1–6 in binary notation. C1
P
AND S
1. 19 2. 55 3. 287 half-adder #1
S1
Q
4. 458 5. 1609 6. 1424 C2
Represent the integers in 7–12 in decimal notation. half-adder #2
7. 11102 8. 101112 9. 1101102 R T

10. 11001012 11. 10001112 12. 10110112


Perform the arithmetic in 13–20 using binary notation. 22. Add 111111112 + 12 and convert the result to decimal nota-
13. 10112 14. 10012 tion, to verify that 111111112 = (28 − 1)10 .
+ 1012 + 10112
Find the 8-bit two’s complements for the integers in 23–26.
15. 1011012 16. 1101110112
+ 111012 + 10010110102 23. 23 24. 67 25. 4 26. 115

17. 101002 18. 110102 Find the decimal representations for the integers with the 8-bit
− 11012 − 11012 representations given in 27–30.

19. 1011012 20. 10101002 27. 11010011 28. 10011001


− 100112 − 101112 29. 11110010 30. 10111010
21. Give the output signals S and T for the circuit in the right Use 8-bit representations to compute the sums in 31–36.
column if the input signals P, Q, and R are as specified.
Note that this is not the circuit for a full-adder. 31. 57 + (−118) 32. 62 + (−18)
a. P = 1, Q = 1, R = 1 33. (−6) + (−73) 34. 89 + (−55)
b. P = 0, Q = 1, R = 0
c. P = 1, Q = 0, R = 1 35. (−15) + (−46) 36. 123 + (−94)

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
2.5 Application: Number Systems and Circuits for Addition 95

✶ 37. Show that if a, b, and a + b are integers in the range 1 46. 110010010111002
through 128, then
47. Octal Notation: In addition to binary and hexadecimal,
(28 − a) + (28 − b) = (28 − (a + b)) + 28 ≥ 28 + 27 . computer scientists also use octal notation (base 8) to rep-
resent numbers. Octal notation is based on the fact that any
Explain why it follows that if the 8-bit binary representa-
integer can be uniquely represented as a sum of numbers of
tion of the sum of the negatives of two numbers in the given
the form d · 8n , where each n is a nonnegative integer and
range is computed, the result is a negative number.
each d is one of the integers from 0 to 7. Thus, for example,
Convert the integers in 38–40 from hexadecimal to decimal 50738 = 5 · 83 + 0 · 82 + 7 · 81 + 3 · 80 = 261910 .
notation. a. Convert 615028 to decimal notation.
b. Convert 207638 to decimal notation.
38. A2BC16 39. E0D16 40. 39EB16
c. Describe methods for converting integers from octal to
Convert the integers in 41–43 from hexadecimal to binary nota- binary notation and the reverse that are similar to the
tion. methods used in Examples 2.5.12 and 2.5.13 for con-
verting back and forth from hexadecimal to binary nota-
41. 1C0ABE16 42. B53DF816 43. 4ADF8316
tion. Give examples showing that these methods result
Convert the integers in 44–46 from binary to hexadecimal in correct answers.
notation.
44. 001011102 45. 10110111110001012

Answers for Test Yourself


1. d · 2n ; d = 0 or d = 1, and n is a nonnegative integer 2. 102 ;112 3. 12 ;102
4. outputs the sum of any two binary digits; outputs the sum of any three binary digits
5. 28 − a 6. write the 8-bit binary representation of a; flip the bits; add 1 in binary notation
7. the 8-bit binary representation of a; the 8-bit binary representation of 28 − a
8. convert both integers to their 8-bit binary representations; add the results using binary notation; truncate any leading 1; convert
back to decimal form
9. d · 16n ; d = 0, 1, 2, . . . 9, A, B, C, D, E, F, and n is a nonnegative integer
10. write each hexadecimal digit in 4-bit binary notation; juxtapose the results

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.

You might also like