chapter 1 the big picture. quiz 2 5 explain the abstractions we normally apply when using the...

68
Chapter 1 The Big Picture

Upload: brianna-dawson

Post on 23-Dec-2015

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

Chapter 1

The Big Picture

Page 2: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

QUIZ

2 5

Explain the abstractions we normally apply when using the following systems:

DVD player

Registering for classes on DuckTrax

Walking

In each case, explain what is the internal view and what is the abstract view.

Page 3: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

QUIZ

Explain the abstraction applied in browsing the WWW:

• What is the internal view?• What is the abstract view?

3

Page 4: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

QUIZ

Connect each generation of computer hardware with its defining technology:

1st Gen. ICs2nd Gen. Multi-core processors3rd Gen. LSI, VLSI4th Gen. Vacuum tubes5th Gen. Transistors

4

Page 5: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

Practice Flashcards on the text website

5

Page 6: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

Chapter 2

Binary Values and Number Systems

Page 7: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

Converting Binary to Decimal

7

What is the decimal equivalent of the binary number 1101110?

11011102 = ???10

13

Page 8: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

Converting Binary to Decimal

8

What is the decimal equivalent of the binary number 1101110?

1 x 26 = 1 x 64 = 64 + 1 x 25 = 1 x 32 = 32 + 0 x 24 = 0 x 16 = 0 + 1 x 23 = 1 x 8 = 8 + 1 x 22 = 1 x 4 = 4

+ 1 x 21 = 1 x 2 = 2 + 0 x 2º = 0 x 1 = 0

= 110 in base 10

13

Page 9: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

QUIZ:

100110102 = ???10

9

Page 10: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

Converting Hexadecimal to Decimal

10

What is the decimal equivalent of the hexadecimal number DEF?

D x 162 = 13 x 256 = 3328 + E x 161 = 14 x 16 = 224 + F x 16º = 15 x 1 = 15

= 3567 in base 10

Page 11: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

QUIZ:

2AF16 = ???10

11

Page 12: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

Converting Octal to Decimal

12

What is the decimal equivalent of the octal number 642?

6428 = ???10

11

Page 13: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

Converting Octal to Decimal

13

What is the decimal equivalent of the octal number 642?

6 x 82 = 6 x 64 = 384 + 4 x 81 = 4 x 8 = 32 + 2 x 8º = 2 x 1 = 2

= 418 in base 10

11

Page 14: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

QUIZ: Convert to decimal

1101 00112 = ???10

AB716 = ???10

5138 = ???10

6928 = ???1014

Page 15: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

Addition QUIZ

15

Carry valuesgo here

1 0 1 0 1 1 0 +1 0 0 0 0 1 1

14

Check in base ten!

Page 16: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

Subtraction QUIZ

16

1 0 1 1 0 0 0 - 1 1 0 1 1 1

15

Borrow values

Check in base ten!

Page 17: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

Repeated division QUIZ

17

Convert 4210 to binary

42 2 = rem.

4210 = 2  

19

Page 18: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

Converting Binary to Octal

18

• Mark groups of three (from right)• Convert each group

10101011 10 101 011 2 5 3

10101011 is 253 in base 8

17

Page 19: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

Converting Binary to Hexadecimal

19

• Mark groups of four (from right)• Convert each group

10101011 1010 1011 A B

10101011 is AB in base 16

18

Page 20: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

Counting

20

Count from 5 to 17 in binary.Place the numbers in a table.

Page 21: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

Converting Octal to Hexadecimal

21

Convert octal 253 into hex.

18

Page 22: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

Converting Octal to Hexadecimal

22

Convert octal 253 into hex.

10 101 011 1010 1011 2 5 3 A B

253 in base 8 = AB in base 16

18

Page 23: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

Quiz on Ch.2

Convert 201023 to decimal

Page 24: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

Chapter 03

Data Representation

Page 25: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

Quiz

A video file is originally 3.5 GB long.We compress it to 490 MB. What is the compression ratio?

25

Page 26: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

Quiz

A digital thermometer has a scale from 50 to 100 degrees (F). The temperature is represented on 7 bits. What is the smallest temperature difference that it can measure?

26

Page 27: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

QUIZ

How many bits are needed to represent all the courses you’re planning to take in college?

27

Page 28: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

QUIZ

Given the following representations, find in each case what actual number is being represented: 51 52 96 47

28

Page 29: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

EXTRA-CREDIT QUIZ

If the representation is 76, what actual number is being represented?

29

Page 30: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

QUIZ

What is the representation for each of these actual numbers? -48 -40 -30 -5

30

Page 31: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

Let’s use ten’s complement!To perform addition, add the numbers and discard any carry

31

Now you try it

48 (signed-magnitude)

- 147

How does it work inthe new scheme?

Page 32: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

Adding two negative numbers

32

Try these: 4 - 4 -4- 3+3 + -3

Page 33: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

QUIZ

What is the 8-bit two’s complement representation of these numbers? -13 40

33

Page 34: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

QUIZ

Perform the following operation in 8-bit two’s complement:

40 – 13

34

Page 35: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

Trick QUIZ

What decimal number does this binary number represent?

1001 1110

35

Page 36: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

Converting fractions from binary to decimal

Easy! Just multiply with the powers of 2, as we did for unsigned binary. Only difference is that now the powers are negative.

Example: .10012 = 0. 10

36

Page 37: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

QUIZ

Convert:

.10112 = 0. 10

37

Page 38: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

Converting fractions from decimal to binary

Remember the repeated division algorithm?We apply it for the integer part of the number.

To covert the fractional part, we use the repeated multiplication algorithm!

Example: 0.43510 = 0. 2

38

Page 39: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

QUIZ

Convert:

0.310 = 0. 2

39

Page 40: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

QUIZ

Finite decimal fractions may have infinite binary representation!

0.310 = 0. 0100110011 2

40

Stop after 8 bits!

Page 41: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

QUIZ

Convert to floating point and to scientific notation:

123.332 =

-0.0034 =

0.0 =

41

Page 42: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

QUIZEncode “Hello, world!” in ASCIIDecode 67 83 32 49 49 48 from ASCII

42

Page 43: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

Huffman decoding QUIZ

43

Decode:

1011111001010

Page 44: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

QUIZ

44

Explain the similarities and differences between 00FF00 and 008800

Page 45: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

Extra-credit question

TrueColorA 24-bit color depth: eight bits used for each number in an RGB value

How many different colors can be represented in TrueColor? Please show your work.

45

Page 46: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

QUIZ

46

Are these HiColor or TrueColor?

Page 47: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

Extra-credit question

How many bits are needed to represent this palette? Please show your work.

47

Page 48: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

3.6 Representing VideoThe problem: huge amount of data!

Example: In HDTV, the Frame size is defined as the number of horizontal pixels × number of vertical pixels: 1280 × 720 1920 × 1080

Calculate: 1] Data rate (bits per second) for 25 fps 2] Size (bytes) of 2-hour movie

48

Page 49: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

Chapter 4

Gates and Circuits (with some transistors thrown in for

good measure)

All hail the HARDWARE!

Page 50: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

QUIZ: recognize the gate!

50

Page 51: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

QUIZ: elementary properties

51

A AND 0 = ?A AND 1 = ?Etc.

Page 52: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

Quiz

What are the 3 ways we use to describe gates and circuits?

Use the 3 ways to describe the NAND gateHint: Describe AND first!

52

Page 53: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

QUIZ

Draw the gate symbols for:4-input OR5-input NAND3-input NOR4-input XOR

53Figure 4.7 Various representations of a three-input AND gate

Page 54: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

QUIZ

Draw the gate symbols for:4-input OR5-input NAND3-input NOR4-input XOR

How many lines does each of the truth tables have?

54Figure 4.7 Various representations of a three-input AND gate

Page 55: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

QUIZ

Draw the gate symbols for:4-input OR5-input NAND3-input NOR4-input XOR

How many lines does each of the truth tables have?

Describe in your own words each of the truth tables.

55Figure 4.7 Various representations of a three-input AND gate

Page 56: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

QUIZ

A computer represents numbers in 8-bit two’s complement.Design a circuit that will detect the number zero (the output of

the circuit becomes 1 if and only if all 8 bits are 0):

56Figure 4.7 Various representations of a three-input AND gate

0 0 0 0 0 0 0 0

Page 57: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

Extra-credit QUIZ

A computer represents numbers in 8-bit two’s complement.Design a circuit that will detect the number -128 Hint: -128 is 1000 0000 in two’s comp.

57Figure 4.7 Various representations of a three-input AND gate

1 0 0 0 0 0 0 0

Page 58: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

From gates to circuits

58

Find the logic diagram of the circuit described by the following truth table:

Hint: The table is similar to which of the fundamental gates presented last time?

1

0

Page 59: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

SOLUTION

Having only one 0 in the output column, the circuit most resembles the OR gate!

It is different from the OR gate only in this respect: …

Write the Boolean expression:

Draw the diagram:59

Page 60: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

QUIZThe AND gate is obtained as a NAND followed by an

inverter. Draw its transistor diagram!

60

Page 61: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

QUIZDraw its switch diagram.Show the states of all switches for V1 = 0 and V2 = 1.

61

Page 62: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

DeMorgan’s law QUIZ

62

Apply DeMorgan’s Law directly on the gate diagrams below to obtain equivalent circuits:

Page 63: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

QUIZ

The XOR operation can be implemented with AND, OR and NOT gates:

63

How many transistors are required for the XOR gate?

=A’B+AB’

Page 64: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

QUIZ

64

Connect the MUX input to implement a prime number detector (i.e. the output F is 1 iff S2S1S0 are the binary code of a prime number)

Page 65: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

S – R latch “forbidden” inputs

What happens if both S and R are activated (made 0) at the same time?

65

Page 66: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

Use a MUXes as “lookup tables” to implement the 1-bit adder

66

Page 67: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

Show how a MUX with only 4 data inputs works

Assume S1 = 0, S0 = 1. Draw the equivalent circuit in this case and explain the value of the output q.

67

Page 68: Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on

Extra-creditHow many transistors are needed to build this

MUX?

68