0% found this document useful (0 votes)
18 views6 pages

CH 03

Chapter 3 covers data storage, including various data types and representations such as bitmap graphics and two's complement. It provides review questions, multiple-choice questions, and exercises related to binary conversions, overflow, and data encoding. The chapter emphasizes the importance of understanding data types and their binary representations for effective data storage solutions.

Uploaded by

Thabo Mojava
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)
18 views6 pages

CH 03

Chapter 3 covers data storage, including various data types and representations such as bitmap graphics and two's complement. It provides review questions, multiple-choice questions, and exercises related to binary conversions, overflow, and data encoding. The chapter emphasizes the importance of understanding data types and their binary representations for effective data storage solutions.

Uploaded by

Thabo Mojava
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/ 6

CHAPTER 3

Data Storage
(Solutions to Odd-Numbered Problems)

Review Questions
1. We discussed five data types: number, text, audio, image, and video.
3. In the bitmap graphic method each pixel is represented by a bit pattern.
5. The three steps are sampling, quantization, and encoding.
7. In both representations, the upper half of the range represents the negative num-
bers. However, the wrapping is different as shown in Figure S3.7. In addition,
there are two zeros in sign-and-magnitude but only one in two’s complement.

Figure S3.7

Wrapping

Minimum −0 +0 Maximum
Wrapping in sign-and-magnitude representation

Wrapping

Minimum 0 Maximum
Wrapping in two’s complement representation

9. In both systems, the leftmost bit represents the sign. If the leftmost bit is 0, the
number is positive; if it is 1, the number is negative.

1
SECTION 2

Multiple-Choice Questions
11. c 13. d 15. b 17. a 19. a 21. d
23. c 25. d 27. b

Exercises
29. 102 = 100 if zero is allowed. 92 = 81 if zero is not allowed.
31. 2n = 8 → n =3 or log28 = 3
33. 2n = 900 → n ≈ 10 or log2900 = 9.81 → 10. With n = 10 we can uniquely assign
210 = 1024 bit pattern. Then 1024 − 900 = 124 patterns are unassigned. These
unassigned patterns are not sufficient for extra 300 employees. If the company
hires 300 new employees, it is needed to increase the number of bits to 11.

35. 256 level can be represented by 8 bits because 28 = 256. Therefore, the number of
bits per seconds is

(8000 sample/ sec) × (8 bits / sample) = 64,000 bits /seconds

37.
a. 41 = 32 + 8 +1 = (0000 0000 0010 1001)2
b. 411 = 256 + 128 + 16 + 8 + 2 + 1 = (0000 0001 1001 1011)2
c. 1234 = 1024 + 128 + 64 + 16 + 2 = (0000 0100 1101 0010)2
d. 342 = 256 + 64 + 16 + 4 + 2 = (0000 0001 0101 0110)2
39.
a. 102 =
Convert 102 to binary 0 0 0 0 0 0 0 0 0 1 1 0 0 1 1 0

b. −179 =
Convert 179 to binary 0 0 0 0 0 0 0 0 1 0 1 1 0 0 1 1
↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
Apply two’s complement operation 1 1 1 1 1 1 1 1 0 1 0 0 1 1 0 1

c. 534 =
Convert 534 to binary 0 0 0 0 0 0 1 0 0 0 0 1 0 1 1 0

d. Overflow occurs because 62,056 is not in the range −32768, +32767


SECTION 3

41.
a. 0111 0111 =
Leftmost bit is 0. The sign is + 0 1 1 1 0 1 1 1
Integer changed to decimal 119
Sign is added + 119

b. 1111 1100 =
Leftmost bit is 1. The sign is − 1 1 1 1 1 1 0 0
↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
Apply two’s complement operation 0 0 0 0 0 1 0 0
Integer changed to decimal 4
Sign is added −4

c. 0111 0100 =
Leftmost bit is 0. The sign is + 0 1 1 1 0 1 0 0
Integer changed to decimal 116
Sign is added + 116

d. 1100 1110 =
Leftmost bit is 1. The sign is − 1 1 0 0 1 1 1 0
↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
Apply two’s complement operation 0 0 1 1 0 0 1 0
Integer changed to decimal 50
Sign is added −50

43.
a. 01110111 → 10001001 → 01110111
b. 11111100 → 00000100 → 11111100
c. 01110100 → 10001100 → 01110100
d. 11001110 → 00110010 → 11001110
45. Answers are shown with space between the three parts for clarity
a. S = 1,
E = 0 + 127 = 127 = (01111111)2,
M = 10001 (plus 18 zero added at the right to make the number of bits 23)
→ 1 01111111 10001000000000000000000
b. S = 0,
E = 3 + 127 = 130 = (10000010)2,
M = 111111 (plus 17 zero added at the right)
→ 0 10000010 11111100000000000000000
c. S = 0
E = −4 + 127 = 123 = (01111011)2,
SECTION 4

M = 01110011 (plus 15 zero added at the right)


→ 0 01111011 01110011000000000000000
d. S = 1
E = −5 + 127 = 122 = (01111010)2,
M = 01101000 (plus 15 zero added at the right)
→ 1 01111010 01101000000000000000000
47. Answers are shown with spaces between the three parts for clarity
a. 7.1875 = (111.0011)2 = 22 × 1.110011
S=0
E = 2 + 127 = 129 = (10000001)2
M = 110011 (plus 17 zero at the right)
→ 0 10000001 11001100000000000000000
b. −12.640625 = (−1100.101001)2 = − 23 × 1.100101001
S=1
E = 3 + 127 = 130 = (10000010)2
M = 100101001 (plus 14 zero at the right)
→ 1 10000010 10010100100000000000000
c. 11.40625 = (1011.01101)2 = 23 × 1.01101101
S=0
E = 3 + 127 = 130 = (10000010)2
M = 01101101 (plus 15 zero at the right)
→ 0 10000010 01101101000000000000000
d. −0.375 = −0.011 = − 2−2 × 1.1
S=1
E = −2 + 127 =125 = (01111101)2
M = 1 (plus 22 zero at the right)
→ 1 01111101 10000000000000000000000
49.
a. 53 = 32 + 16 + 4 + 1 =
+ 0 32 16 0 4 0 1
↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
0 0 1 1 0 1 0 1 = 0011 0101

b. −107 = − (64 + 32 + 8 + 2 + 1) =

− 64 32 0 8 0 2 1
↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
1 1 1 0 1 0 1 1 = 1110 1011

c. −5 = − (4+1) = 10000101

− 0 0 0 0 4 0 1
↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
1 0 0 0 0 1 0 1 = 1000 0101
SECTION 5

d. 154 creates overflow because 154 is not in the range −127 to +127
51.
a. (01110111)2 =
Leftmost bit is 0. The sign is + 0 1 1 1 0 1 1 1
Integer changed to decimal 119
Sign is added +119

b. (11111100)2 =
Leftmost bit is 1. The sign is − 1 1 1 1 1 1 0 0
↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
Apply one’s complement operation 0 0 0 0 0 0 1 1
Integer changed to decimal 3
Sign is added −3

c. (01110100)2 =
Leftmost bit is 0. The sign is + 0 1 1 1 0 1 0 0
Integer changed to decimal 116
Sign is added +116

d. (11001110)2 =
Leftmost bit is 1. The sign is − 1 1 0 0 1 1 1 0
↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
Apply one’s complement operation 0 0 1 1 0 0 0 1
Integer changed to decimal 49
Sign is added −49

53.
a. (01110111)2

One’s complement = 10001000 Two’s complement = 10001001


+1
10001001

b. (11111100)2

One’s complement = 00000011 Two’s complement = 00000100


+1
00000100
SECTION 6

c. (01110100)2

One’s complement = 10001011 Two’s complement = 10001100


+1
10001100

d. (11001110)2

One’s complement = 00110001 Two’s complement = 00110010


+1
00110010

55.
a. +234 → 234
b. +560 → Overflow because 560 is not in the range −499 to 499
c. −125 → 874
d. −111 → 888
57.
a. +234 → 234
b. +560 → Overflow because 560 is not in the range −500 to 499
c. −125 → 874 + 1 = 875
d. −111 → 888 + 1 = 889
59.
a. (+B14)16 → (B14)16
b. (+FE1)16 → Overflow because it is not in the range (−7FF)16 to (7FF)16
c. (−1A)16 = (−01A)16 → (FE5)16
d. (−1E2)16 → (E1D)16
61.
a. (+B14)16 → (B14)16
b. (+FE1)16 → Overflow because it is not in the range (−800)16 to (7FF)16
c. (−1A)16 = (−01A)16 → (FE5 +1)16 = (FE6)16
d. (−1E2)16 → (E1D +1)16 = (E1E)16

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy