Assignment 3 Sample problems

Preview:

DESCRIPTION

Assignment 3 Sample problems. You are given a picture, which is 1000 x 1000 pixels. where 1 pixel is represented by 3 bytes 1 kB = 1000 B 1 MB = 1000000 B. 1)How many bytes are needed to store the picture? 2)How many kilobytes are required to store the picture? - PowerPoint PPT Presentation

Citation preview

Assignment 3 Sample problems

You are given a picture, which is 1000 x 1000 pixels.

where1 pixel is represented by 3 bytes1 kB = 1000 B1 MB = 1000000 B

1)How many bytes are needed to store the picture?

2)How many kilobytes are required to store the picture? 

3)How many seconds will be required to send the picture over a 150 kB/s (150 kilobytes per second) connection?

1)How many bytes are needed to store the picture?

3,000,000 bytes2)How many kilobytes are required to store

the picture?    3,000 kilobytes3)How many seconds will be required to send

the picture over a 150 kB/s (150 kilobytes per second) connection? 20s

How can we get ?

1. 1000*1000*3=3,000,000 bytes

2. 3,000,000 / 1000=3,000 kilobytes

3. 3000 / 150 =20 s

Use this information for the following questions: At normal speaking rates, a person takes about 300 seconds to say a thousand words.

1)How many seconds does it take to say 500 words?

2)How many words can be spoken in 1 hour?

3)How many kilobits are needed if we record a 900 words at 200 kilobits per second (ie. it takes 200 kilobits to record one second of audio)?

1)How many seconds does it take to say 500 words?

150s2)How many words can be spoken in 1

hour? 12000words3)How many megabits are needed if we

record a 900 words at 200 kilobits per second (ie. it takes 200 kilobits to record one second of audio)? 54 megabits

How can we get ?

1. 300*500/1000=150s2. 3600*1000/300=12000 words3. 900*300/1000=270s 270*200=54,000 kilobits =54 megabits

Consider the following simplified NIM5 circuit, write the logic expression to make the user win.

fiveLeft threeLeft

twoLeft

C-Win

U-Win

takeOne1takeOne2

takeTwo2takeTwo1

AND GATE

True

OR GATE

OR GATE

AND GATE

AND GATE

Consider the following simplified NIM5 circuit, write the logic expression to make the user win.

fiveLeft threeLeft

twoLeft

C-Win

U-Win

takeOne1takeOne2

takeTwo2takeTwo1

AND GATE

True

OR GATE

OR GATE

AND GATE

AND GATE

fiveLeft and takeTwo1 and twoLeft and take two2

Consider the following circuit diagram:

A

B

AND GATE

OR GATE

NOT GATE

NOTGATE

AND GATE

C

Fill in the truth table with values ("True" or "False") corresponding to the diagram:

A B C

False False

False True

True False

True True

Fill in the truth table with values ("True" or "False") corresponding to the diagram:

A B C

False False False

False True False

True False False

True True False

How can we get ?1. C= (A and not B) and (not (A

or B))

Since and gate, any one part is false, will make C to be false.

Recall our bit equality gate and EQUAL-5 gate, To construct an EQUAL-10 gate (using 10 bit equality gates and 1 AND-10 gate), how many gates of each type are required:• binary AND: • binary OR: • unary NOT:

Recall our bit equality gate and EQUAL-5 gate, To construct an EQUAL-10 gate (using 10 bit equality gates and 1 AND-10 gate), how many gates of each type are required:• binary AND: 29• binary OR: 20• unary NOT: 10

How can we get ?

1. And gate: 2*10+5+3+1=29

2. Or gate: 1*10=10

3. Not gate: 2*10=20

If we wish to use the minimum possible total number of gates to construct an OR-5, how many gates of each type will be required:• binary AND: • binary OR: • unary NOT:

If we wish to use the minimum possible total number of gates to construct an OR-5, how many gates of each type will be required:• binary AND: 0• binary OR: 4• unary NOT: 0

How can we get ?

In OR-K, only or gate, so we do not need any and gate and not gate

1. And gate: 02. Or gate: 43. Not gate: 0 every two inputs need one or gate, so

the number of or gate is 2+1+1=4