Presentation is loading. Please wait.

Presentation is loading. Please wait.

Binary & Decimal numbers

Similar presentations


Presentation on theme: "Binary & Decimal numbers"— Presentation transcript:

1 Binary & Decimal numbers

2 Decimal system: Ten digits: 0,1,2,3,…,9 3185
Example: = 3* * *10 + 5*1 = 3* * * *100

3 10110 Binary system: Two digits: 0,1
Example: 1*(24) + 0*(23) + 1*(22) + 1*(21) + 0*(20)

4 Byte and Bit 1 Bit: (binary digit) either 0 or 1
Byte: an ordered collection of 8 bits 1 MSB (Most significant bit) LSB (Least significant bit)

5 Binary to Decimal 1 23 + 21 + 20 = 11 * 27 26 25 24 23 22 21 20 0*(27)
1 * 27 26 25 24 23 22 21 20 0*(27) 0*(26) 0*(25) 0*(24) 1*(23) 0*(22) 1*(21) 1*(20) = 11

6 Decimal to Binary 25 1 [25%2=1] 12 [25/2=12] 0 [12%2=0] 6 [12/2=6]
0 [6%2=0] 3 [6/2=2] 1 [3%2=1] 1 [3/2=1] 1 [1%2=1] 0 [1/2=0] Right 1 2 3 4 5 6 7 8 9 Left 10 25 (decimal) = (binary)

7 Overflow 1 1 The highest number represented by 8 bits is 255 (why?).
What happens when we add 1 to it? 1 The bit is lost !


Download ppt "Binary & Decimal numbers"

Similar presentations


Ads by Google