IS:112 SOFTWARE & HARDWARE CONCEPTS

STUDY GUIDE - NUMBER SYSTEMS

GENERAL

• There are many different number systems that can be used
• Different symbols (digits) are placed in position(s) which have an associated weight
• The base of a number system determines two things: the number of digits and the positional weights
• The lowest digit is always 0, the highest is one less than the base
• The positional weights are powers of the base, beginning with zero (this value is always 1)
• The value represented can be found by multiplying each digit by its positional weight and adding the products

DECIMAL SYSTEM - BASE 10

• Number system which we use to represent values
• Ten digits: 0 1 2 3 4 5 6 7 8 9
• Positional weights are powers of 10

10,000      1,000      100      10      1

What value does each of the following decimal numbers represent?

8

9       3      2

1          4      6      7

3               2         0       9      4

BINARY SYSTEM - BASE 2

• Number system used by computers to represent numbers, characters, instructions
• Two digits: 0 1
• Positional weights powers of two

256      128      64      32       16      8      4      2      1

What value does each of the following binary numbers represent?

1      0

1      0      1

1      0      1      1

0     0      1      1      0

1      0      0      0      1

1      1       1      1      0      0

1        0      0      0      1      1      0

1        1        1      1      1      1      1      1

• Convenient (shorthand) way to read binary numbers
• Sixteen digits: 0 1 2 3 4 5 6 7 8 9 A B C D E F
• Positional weights are powers of sixteen

4096      256      16      1

What value is represented by the following hexadecimal numbers?

8

B

4      2

A      5

1       D      F

A      B      C

1           1       1      E

CONVERTING FROM ONE SYSTEM TO ANOTHER

Binary to Decimal:

Use expansion method of multiplying the digit and the positional weight for all digits and summing.

(This is the method used previously in this handout)

Use expansion method of multiplying the digit and the positional weight for all digits and summing.

(This is the method used previously in this handout)

Decimal to Binary:

Repeatedly divide the decimal number (and subsequent quotients) by two until the quotient is zero; use remainders, with the first remainder being placed in the rightmost (low-order or ones) position.

Examples: Divide by two until quotient is 0:

2)37                                 2)248

2)18 R 1                          2)124 R 0

2)9 R 0                           2) 62 R 0

2)4 R 1                           2) 31 R 0

2)2 R 0                           2) 15 R 1

2)1 R 0                           2) 7 R 1

0 R 1                            2) 3 R 1

2) 1 R 1

0 R 1

Using remainders (first is low-order):

1 0 0 1 0 1
1 1 1 1 1 0 0 0

Repeatedly divide the decimal number (and subsequent quotients) by sixteen until the quotient is zero; use remainders, with the first remainder being placed in the rightmost (low-order or ones) position.

Examples: Divide by 16 until quotient is 0:

16)48                          16)243

16) 3 R 0                      16) 15 R 3

0 R 3                               0 R 15 = F

Using the remainders (first is low-order)

3 0
F 3

Group binary digits by four (starting at the rightmost position); convert each group into a single hex digit; add leading zeros if necessary.

Examples: 1 0 1 1 0 0 0 1 1 0 0 1 1 0 0

1011    0001    0100   1100

B          1          4         C

Convert each hex digit (starting at the rightmost position) into four binary digits; use all four positions for each hex digit to maintain binary position.

Examples:       4       A       C       2       A       0

0100 1010 1100 0010 1010 0000
0100101011000010101000000

Four basic addition results:      0      0 1      1

+0 +1 +0 +1

0 1 1 10

Examples: 1001 1100 1111

+ 101 + 101 + 101

1110 10001 10100

Four basic subtraction results: 0 1 1 (1)0 borrow

-0 -0 -1 - 1

1 1 0 1

Remember when subtracting, the value borrowed (if any) is 2 (decimal) or 10 (binary)

Examples: 1011 1010 1001 1000

- 10 - 10 - 10 - 1

1001 1000 111 111

There are many hexadecimal combinations/results, so each will not be listed.

Examples: 1 6 3 1 A 8

+ 9 7 + B B

1 F A 2 6 3

When subtracting in hexadecimal, the value borrowed (if any) is 16 (decimal) or 10 (hexadecimal)

Examples: 5 9 F 4 6 0 2 C A

- 2 C - E - E D

5 7 3 4 5 2 1 D D