Sie sind auf Seite 1von 4

COMS W1004 Problem Set 3

Josh Cohen
4.1]

jkc2144

a) 1334 = 16 + (3 * 4) + 3 = 3110
b) 3678 = (3 * 64) + (6 * 8) + 7 = 24710
c) 1BA16 = 256 + (11 * 16) + 10 = 44210

4.6]

a) +71 = 01000111
b) -1 = 10000001
c) -81 = 11010001

4.15] a) 3 minutes = 180 seconds. 40,000 samples/second = 7,200,000 samples. 16 bit/sample =


115,200,000 bits. With a 5:1 compression scheme, the song uses 23,040,000 bits.
b) 1 RGB pixel = 3 * 8-bit values = 24 bit/pixel. 1200 * 800 = 960,000 pixels =
23,040,000 bits total. With an actual value of 2,400,000 bits, the compression
ratio must be 9.6 : 1.
4.25]
A

D
C

4.26]
Borrowin
0
0
0
0
1
1
1
1

A
0
0
1
1
0
0
1
1

B
0
1
0
1
0
1
0
1

Borrowout
0
1
0
0
1
1
0
1

Output
0
1
1
0
1
0
0
1

COMS W1004 Problem Set 3


Josh Cohen

jkc2144

Using Karnaugh maps we can determine the following relationships:


Borrowout = (B*Borrowin) + (A*Borrowin) + (A*B)
Output = Borrowin (XOR) A (XOR) B
Which gives:
A

Output

B
Borrowout

Borrowin

5.2]

a) 2^20 = 1,048,576 > 1Mb. Minimum 20 bits


b) 2^24 = 16,777,216. Minimum 24 bits
c) 2^27 = 134,217,728. Minimum 27 bits
d) 2^30 = 1,073,741,824. Minimum 30 bits

5.12] a) 1024 * 20 * 500 * 2 = 20,480,000 characters


b)

Seek
Latency
Transfer

Best
0 ms
0 ms
1/20 * 8.333 = .41665
ms

Worst
499*.05 = 24.95 ms
7200 rpm = 8.333 ms
.41665 ms

Average
150*.05=7.5 ms
rev = 4.1665 ms
.41665 ms

COMS W1004 Problem Set 3


Josh Cohen

jkc2144

5.13]

Seek
Latency
Transfer

Best
0 ms
0 ms
1/20 * 6.25 = .3125
ms

Worst
499*.05 = 24.95 ms
9600 rpm = 6.25 ms
.3125 ms

Average
150*.05=7.5 ms
rev = 3.125 ms
.3125 ms

5.19] a) Max = 2^k, k=6. Max instructions = 64


b) Max = 2(2^18) = 2^19 = 524,288 addresses
c) 1 byte for op-code, 3 bytes for address-1, 3 bytes for address-2 (this is assuming that
we need to feed the computer packets of bits for the instructions. So the
op-code would use 6 bits of the 8-bit byte, and each address would use 2 full
bytes and 2 bits from a third 8-bit byte). So the total number of bytes per
instruction is 3+3+1 = 7 bytes.
5.21] a) 50 | SUBTRACT 202,203,200
51 | ADD 204,200
52 | HALT
b) 50 | ADD 202,201
51 | ADD 204,203
52 | SUBTRACT 201,203,200
53 | HALT
c) 50 | COMPARE 200,201
51 | JUMPGE 54
52 | MOVE 202,204
53 | JUMP 55
54 | MOVE 202,203
55 | HALT

COMS W1004 Problem Set 3


Josh Cohen
d) 50 | COMPARE 203,204
51 | JUMPGE 56
52 | ADD 201,203
53 | ADD 204,203
54 | ADD 200,204
55 | JUMP 50
56 | HALT

jkc2144

Das könnte Ihnen auch gefallen