Binary Hex Decimal 2 3 4 5 - New Mexico Institute of Mining and Technology

EE 308

Spring 2002

Binary, Hex and Decimal Numbers (4-bit representation)

Binary

0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111

Hex Decimal

0

0

1

1

2

2

3

3

4

4

5

5

6

6

7

7

8

8

9

9

A

10

B

11

C

12

D

13

E

14

F

15

1

EE 308

Spring 2002

What does a number represent?

Binary numbers are a code, and represent what the programmer intends for the code.

0x72

Some possible codes:

'r' (ASCII) INC (HC12 instruction) 2.26V (Input from A/D converter) 11410 (Unsigned number) 11410 (Signed number) Set temperature in room to 69 F Set cruise control speed to 120 mph

2

EE 308

Spring 2002

Binary to Unsigned Decimal:

Convert Binary to Unsigned Decimal 1111011 2

6

5

4

1x2 +1x2 +1x2

+

1

x

3

2+

0

x

2

2+

1

x

1

2

+

1

x

20

1 x 64 + 1 x 32 + 1 x 16 + 1 x 8 + 0 x 4 + 1 x 2 + 1 x 1

123

10

Hex to Unsigned Decimal Convert Hex to Unsigned Decimal 82D6 16

3

8 x 16

+ 2 x 16 2 + 13 x 16 1 + 6 x 16 0

8 x 4096 + 2 x 256 + 13 x 16 + 6 x 1

33494

10

3

EE 308

Unsigned Decimal to Hex

Convert Unsigned Decimal to Hex

Spring 2002

Division Q

721/16

45

45/16

2

2/16

0

R

Decimal Hex

1

1

13

D

2

2

721 = 2D1

10

16

4

EE 308

Unsigned Number Line: Numbers go from 0 to

Spring 2002

0 1 2 2 42 5 6 7 8 9 10 11 12 13

Unsigned Number Line

??????? Unsigned Number Wheel: Numbers go from 0 to

01234567 0

7

1

000

111

001

6

110

010

2

101

011

100

5

3

4

5

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download