Number Systems

Tom Kelliher, CS 220

Aug. 31, 2001

Administrivia

Announcements

Assignment

Read 1.3 of Mano.

Outline

  1. Using voltages to represent information

  2. Number systems: decimal, binary, hexadecimal.

  3. Number ranges.

Coming Up

Base conversion and character representation.

Information Representation

Why are computers digital?

What number system do they use?

How do we represent 0 and 1? Voltage.

Logic levels for SN7400 5 V part (see class home page for data sheet):

  1. VoH: 2.4 V min

  2. VoL: 0.4 V max

  3. ViH: 2.0 V min

  4. ViL: 0.8 V max
Why the discrepancy on input/output voltages?

Example: 7400 two-input NAND gate waveform. Note voltage vs. time.

Why is digital logic binary?

Number Systems

Positional, weighted number systems. Example of a non-weighted number system: Roman numerals. Example of non-positional non-weighted number system: unary.

Radix, digit set.

Decimal Numbers

  1. Radix 10, digit set 0--9.

  2. .

    Radix point.

  3. General case:

    We can substitute any radix and digit set we want.

Binary Numbers

  1. Radix 2, digit set: 0, 1.

  2. Decimal values of , , and ?

    Binary point

  3. Powers of two. K, M, and G.

Hexadecimal Numbers

(Octal is similar --- study on your own.)

  1. Radix 16, digit set: 0--9, A--F.

  2. Generally used as compact binary form.

    How? --- Powers of two.

  3. C Constants: 0XFE23, 0x89ab. (0567).

  4. Relationship to binary and decimal.

    .

Number Ranges

  1. Range of values which can be represented.

    Meaning of unsigned.

  2. Consider an n-bit number. How many values can be represented? What is the range of values for an n-bit unsigned number?

  3. What is the range of values of an 8-bit unsigned number?

Exercises

Convert the following binary numbers to hexadecimal and decimal:

  1. 11100111

  2. 00111010

  3. 11000111

  4. 00011111

  5. 11101110



Thomas P. Kelliher
Tue Sep 4 15:47:30 EDT 2001
Tom Kelliher