# 02 binary numbers

Post on 06-Jul-2018

217 views

Category:

## Documents

Embed Size (px)

TRANSCRIPT

• 8/16/2019 02 Binary Numbers

1/79

Instructor: Alexander Stoytchev

http://www.ece.iastate.edu/~alexs/classes/

CprE 281: i!ital "o!ic

• 8/16/2019 02 Binary Numbers

2/79

#inary \$u%&ers

CprE 281: Digital Logic

Iowa State University, Ames, IA Copyright  Ale!an"er Stoytchev

• 8/16/2019 02 Binary Numbers

3/79

(his is the o''icial class we& pa!e:

http://www.ece.iastate.edu/~alexs/classes/2)1*+Sprin!+281/

I' you %issed the 'irst lecture, the sylla&us and other class

%aterials are posted there.

http://www.ece.iastate.edu/~alexs/classes/2014_Spring_281/ http://www.ece.iastate.edu/~alexs/classes/2014_Spring_281/ http://www.ece.iastate.edu/~alexs/classes/2014_Spring_281/

• 8/16/2019 02 Binary Numbers

4/79

• -1 is out

• It is due on ednesday e& 22 0 *p%.

• Su&%it it on paper &e'ore the start o' the lecture

• 8/16/2019 02 Binary Numbers

5/79

(he la&s and recitations start next wee:

•Section : (uesdays, 12:1)  3:))p% 4Coover -all, roo% 2)5)6

•Section 7: (uesdays, 3:1)  :))p% 4Coover -all, roo% 2)5)6

•Section 9: ednesdays, 12:1)  3:))p% 4Coover -all, roo% 2)5)6

•Section : ednesdays, :1)  ;:))p% 4Coover -all, roo% 2)5)6

•(he la& schedule is posted on the class we& pa!e

• 8/16/2019 02 Binary Numbers

6/79

"a&s \$ext ee

Figure 1.5 in the textbook: An FPGA board.

• 8/16/2019 02 Binary Numbers

7/79

"a&s \$ext ee

• 8/16/2019 02 Binary Numbers

8/79

• \$o class next >onday 4?niversity -oliday6

• 8/16/2019 02 Binary Numbers

9/79

(he eci%al Syste%

• 8/16/2019 02 Binary Numbers

10/79

hat nu%&er syste% is this one@

[http://freedomhygiene.com/wp-content/themes/branfordmagazine/images/backgrounds/Hands_141756.jpg]

• 8/16/2019 02 Binary Numbers

11/79

(he #inary Syste%

[ http://divaprojections.blogspot.com/2011/11/alien.html]

• 8/16/2019 02 Binary Numbers

12/79

\$u%&er Syste%s

• 8/16/2019 02 Binary Numbers

13/79

\$u%&er Syste%s

n-th digit

(most significant)

0-th digit

(least significant)

• 8/16/2019 02 Binary Numbers

14/79

• 8/16/2019 02 Binary Numbers

15/79

(he eci%al Syste%

• 8/16/2019 02 Binary Numbers

16/79

(he eci%al Syste%

• 8/16/2019 02 Binary Numbers

17/79

Another ay to "oo at (his

5 2 4

• 8/16/2019 02 Binary Numbers

18/79

Another ay to "oo at (his

5 2 4

102 101 100

• 8/16/2019 02 Binary Numbers

19/79

Another ay to "oo at (his

5 2 4

102 101 100

boxes

labels

Each box can contain only one digit and has only one label. From right

to left, the labels are increasing powers of the base, starting from 0.

• 8/16/2019 02 Binary Numbers

20/79

#ase 

• 8/16/2019 02 Binary Numbers

21/79

#ase 

base power

• 8/16/2019 02 Binary Numbers

22/79

#ase 

most significant

digit

least significant

digit

base power

• 8/16/2019 02 Binary Numbers

23/79

#ase 

• 8/16/2019 02 Binary Numbers

• 8/16/2019 02 Binary Numbers

25/79

#inary \$u%&ers 4#ase 26

• 8/16/2019 02 Binary Numbers

26/79

#inary \$u%&ers 4#ase 26

most significant bit least significant bit

base power

• 8/16/2019 02 Binary Numbers

27/79

#inary \$u%&ers 4#ase 26

• 8/16/2019 02 Binary Numbers

28/79

Another Exa%ple

• 8/16/2019 02 Binary Numbers

29/79

• 8/16/2019 02 Binary Numbers

30/79

hat is the value o' this &inary nu%&er@

•  ) ) 1 ) 1 1 ) )

• ) ) 1 ) 1 1 ) )

• )B2A   )B2  1B25   )B2*  1B23  1B22  )B21  )B2)

• )B128  )B*  1B32  )B1  1B8  1B*  )B2  )B1

• )B128  )B*  1B32  )B1  1B8  1B*  )B2  )B1

• 32 8  * D ** 4in deci%al6

• 8/16/2019 02 Binary Numbers

31/79

Another ay to "oo at (his

0 0 1 0 1 1 0 0 2021222324252627

• 8/16/2019 02 Binary Numbers

32/79

So%e (er%inolo!y

• A &inary di!it is called a bit

• A !roup o' ei!ht &its is called a &yte

• ne &it can represent only two possi&le states,which are denoted with 1 and )

• 8/16/2019 02 Binary Numbers

33/79

Felationship #etween a #yte and a #it

1 0 1 0 1 1 1 0

• 8/16/2019 02 Binary Numbers

34/79

Felationship #etween a #yte and a #it

1 0 1 0 1 1 1 0

1 bit

• 8/16/2019 02 Binary Numbers

35/79

Felationship #etween a #yte and a #it

1 0 1 0 1 1 1 0

8 bits = 1 byte

1 bit

• 8/16/2019 02 Binary Numbers

36/79

#it

• 8/16/2019 02 Binary Numbers

37/79

#it

• 8/16/2019 02 Binary Numbers

38/79

hat is the %axi%u% nu%&er that can &e stored in one &yte 48 &its6@

hat is the %axi%u% nu%&er that can &e

• 8/16/2019 02 Binary Numbers

39/79

hat is the %axi%u% nu%&er that can &e stored in one &yte 48 &its6@

•  1 1 1 1 1 1 1 1

• 1 1 1 1 1 1 1 1

• 1B2A   1B2  1B25   1B2*  1B23  1B22  1B21  1B2)

• 1B128  1B*  1B32  1B1  1B8  1B*  1B2  1B1

• 128  *  32  1  8  *  2  1 D 255 4in deci%al6

• Another way is: 1B28 H 1 D 25 H 1 D 255

hat would happen i' we try to add 1 to the lar!est

• 8/16/2019 02 Binary Numbers

40/79

hat would happen i' we try to add 1 to the lar!est

nu%&er that can &e stored in one &yte 48 &its6@

1 1 1 1 1 1 1 1



1   

1 ) ) ) ) ) ) ) )

) ) ) ) ) ) ) )

• 8/16/2019 02 Binary Numbers

41/79

Analo!y with car odo%eters

• 8/16/2019 02 Binary Numbers

42/79

Analo!y with car odo%eters

[http://www.hyperocity.com/volvo240/images/Volvo/odometerrepair/speedo999999.jpg]

eci%al to #inary Conversion

• 8/16/2019 02 Binary Numbers

43/79

eci%al to #inary Conversion

4?sin! uessin!6

eci%al to #inary Conversion

• 8/16/2019 02 Binary Numbers

44/79

eci%al to #inary Conversion

4?sin! uessin!6

• 8/16/2019 02 Binary Numbers

45/79

Convertin! 'ro% eci%al to #inary

• 8/16/2019 02 Binary Numbers

46/79

Convertin! 'ro% eci%al to #inary

• 8/16/2019 02 Binary Numbers

47/79

[ Figure 1.6 in the textbook ]

• 8/16/2019 02 Binary Numbers

48/79

ctal Syste% 4#ase 86

• 8/16/2019 02 Binary Numbers

49/79

#inary to ctal Conversion

• 8/16/2019 02 Binary Numbers

50/79

#inary to ctal Conversion

1011100101112 = ?8

• 8/16/2019 02 Binary Numbers

51/79

#inary to ctal Conversion

1011100101112 = ?8

101 110 010 111

• 8/16/2019 02 Binary Numbers

52/79

#inary to ctal Conversion

1011100101112 = ?8

101 110 010 111

5 6 2 7

• 8/16/2019 02 Binary Numbers

53/79

#inary to ctal Conversion

1011100101112 = ?8

101 110 010 111

5 6 2 7

Thus, 1011100101112 =

• 8/16/2019 02 Binary Numbers

54/79

-exadeci%al Syste% 4#ase 16

• 8/16/2019 02 Binary Numbers

55/79

• 8/16/2019 02 Binary Numbers

56/79

(he 1 -exadeci%al i!its

), 1, 2, 3, *, 5, , , 8, ;, A, #, C, , E, 

1), 11, 12, 13, 1*, 15