1 / 9

CSE 2353 Spring 2006

CSE 2353 Spring 2006. Number Systems. Number Systems. Normal everyday math is in base 10 (decimal numbers) Why? Computers function in base 2 (binary numbers) Why? When interpreting computer data, humans often use base 8 (octal) or base 16 (hexadecimal) Why?. Number Systems.

trevord
Download Presentation

CSE 2353 Spring 2006

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSE 2353 Spring 2006 Number Systems SMU - Dunham

  2. Number Systems • Normal everyday math is in base 10 (decimal numbers) • Why? • Computers function in base 2 (binary numbers) • Why? • When interpreting computer data, humans often use base 8 (octal) or base 16 (hexadecimal) • Why? SMU - Dunham

  3. Number Systems • Decimal numbers: 0,1,2,…,9 • Binary numbers: 0,1(Bit) SMU - Dunham

  4. Number Systems • Octal numbers: 0,1,…,7 Group binary by threes • Hexadecimal numbers: 0,1,2,…,9,A,B,C,D,E,F Group binary by fours SMU - Dunham

  5. Exercises (EX #4) • Write the first 10 (in decimal) numbers in each number system. • Convert 101010 (binary) to decimal and octal and hexadecimal. • Convert 3920 (decimal) to binary (Algorithm p20) and octal (p22) and hexadecimal (p25). • Convert 756 (octal) to binary and decimal and hexadecimal • Convert D5E (hexadecimal) to binary and decimal and octal SMU - Dunham

  6. How is Data Represented? • What does 01010111 mean? • If an instruction, then the opcode indicates what it is • If not an instruction then must be interpreted differently: • Integer - Based on number system used by machine and instruction • Real - Based on how real numbers are stored for this machine and instruction • Character - Based on encoding scheme (ASCII, EBCDIC) SMU - Dunham

  7. Basic Integer Number Systems • Pp 68-74 • Unsigned: 0 to • Sign Magnitude: to • High order bit indicates sign (0-positive; 1-negative) • Low order (n-1) bits indicates “number” • One’s Complement: • Positive same as sign magnitude • Negative number obtained by inverting all bits • Same range as sign magnitude SMU - Dunham

  8. Basic Integer Number Systems • Two’s Complement • Range: to • Positive same as sign magnitude • Leftmost bit is sign (0-positive, 1-negative) • Negative number: Invert bits and add 1 • 8088/8086 • Excess • Same range as two’s complement • Leftmost bit is sign (0-negative, 1-positive) SMU - Dunham

  9. Why Different Number System? • Range supported • Ease of operations • Number of zeros SMU - Dunham

More Related