binary decimal

12
Binary Decimal

Upload: awentia-jackson

Post on 01-Jan-2016

42 views

Category:

Documents


1 download

DESCRIPTION

Binary  Decimal. Review. Each binary digit (bit) is a power of 2 Place the bits, multiply, and add Example: 11010110 2. Convert the following from binary to decimal. 1101 2 = ? 001101 2 = ? 10111010 2 = ?. Decimal  Binary. Decimal  Binary. Write out the powers of 2 - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Binary   Decimal

Binary Decimal

Page 2: Binary   Decimal

Review

Each binary digit (bit) is a power of 2 Place the bits, multiply, and add Example: 110101102

... 27 26 25 24 23 22 21 20

... 128 64 32 16 8 4 2 1

...

Page 3: Binary   Decimal

Convert the following from binary to decimal

11012 = ?

0011012 = ?

101110102 = ?

Page 4: Binary   Decimal

Decimal Binary

Page 5: Binary   Decimal

Decimal Binary

1. Write out the powers of 22. Subtract the largest power of 2 that is less than

your number3. Make note of which power of 2 you subtracted with

a 1 (unused powers of 2 will be 0)4. Subtract the next largest power of 2 from the result

that you have5. Repeat until you reach 06. Build your binary number from the 1s and 0s that

you have placed

Page 6: Binary   Decimal

Examples

1510 = ?

4910 = ?

... 27 26 25 24 23 22 21 20

... 128 64 32 16 8 4 2 1

...

Page 7: Binary   Decimal

Convert the following from decimal to binary

810 = ?

2510 = ?

8310 = ?

Page 8: Binary   Decimal

Data Representation

Representing numbers is great, but what else is binary good for? Umm…anything/everything

ASCII Example: ASCII Table ASCII B rB Bov rt ri a e e

Page 9: Binary   Decimal

Data Representation

If we have 2 bits, how many different binary numbers can we make? 00 01 10 11

And if we had 3? How about 4? Umm...32?

Page 10: Binary   Decimal

How many combinations?

Each bit can only be a 0 or 1 (2 choices)

The number of distinct combinations

of n-bits is given by 2n

Page 11: Binary   Decimal

Pixel and Color Depth

Pixel ~ Picture element What does an image look like when we zoo

m in? An image is a matrix of numbers

Numbers ~ Colors Number of bits restricts the number colors

we can use (pixel/color depth) Example: Lower your display setting’s color

quality

Page 12: Binary   Decimal

What is the maximum value?

If you had 2 bits? 3 bits? 4 bits?

What’s the pattern?