1 / 11

- Data and Numbering System - Conversion Between Numberings

- Data and Numbering System - Conversion Between Numberings. Data Digitally represented information in a form suitable for communication, interpretation, or processing by human or automatic means. Data include constants, variables, arrays, and character strings. Number System

lundy
Download Presentation

- Data and Numbering System - Conversion Between Numberings

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. - Data and Numbering System- Conversion Between Numberings Data Digitally represented information in a form suitable for communication, interpretation, or processing by human or automatic means. Data include constants, variables, arrays, and character strings. Number System A numbering system is specific notation for representing numbers. Week 3 01/27/2005 Course ISM3230 Dr. Simon Qiu

  2. - Data and Numbering System- Conversion Between Numberings System Base: The base represents the number of symbols which are used in the system: Ten-base system (Decimal): 0, 1, 2, …, 9; Two-base system (Binary): 0 and 1; Eight-base system (Octal): 0, 1, 2, …, 8; 16-base (Hex): 0, 1, 2, …, 9, A, B,…,E , F. Week 3 01/27/2005 Course ISM3230 Dr. Simon Qiu

  3. - Number System Conversion -1 Week 3 01/27/2005 Course ISM3230 Dr. Simon Qiu

  4. - Number System Conversion -2 • Converting Number to Base 2 2|283 0.5764 *2 = 1.1568  0.1 2|141 | 1 1.1568 *2  0.10 2| 70 | 1 =0.3056 *2  0.100 2|35 | 0 =0.6112 *2  0.1001 2|17 | 1 =1.2224 *2  0.10010 2| 8 | 1 = 0.4448 *2  0.100100 2| 4 | 0 = 0.8896 *2  0.1001001 2 | 2 | 0 = 1.7792 *2  0.10010011 2 | 1 | 0 = 1.5584 *2  0.10010011 2 | 0 | 1 =>100011011 =1.1168 Week 3 01/27/2005 Course ISM3230 Dr. Simon Qiu

  5. - Number System Conversion -2 • Converting Number to Base8 (or Base16) Grouping Method from Bits of Base2 into Base8 (or Base 16) 101,0010,11102 <=> 52E16; 10,100,101,1102 <=> 24568 Week 3 01/27/2005 Course ISM3230 Dr. Simon Qiu

  6. - Binary-Arithmetic Operations • Binary: Addition/multiplication/division 1011 110 1011 + 1001 101/11110 X 1001 10100 101 1001 101 101100 101 1100011 0 Week 3 01/27/2005 Course ISM3230 Dr. Simon Qiu

  7. - Binary-Arithmetic Operations • Negative Number -8 =1111,111,111,1000 = 0xFFF8 ( = - ( 4 + 2 + 1 ) OR – 32768+16384+8192+4096+1024+512+256+128+64+32+16+8 ) Week 3 01/27/2005 Course ISM3230 Dr. Simon Qiu

  8. - Binary-Arithmetic Operations • Subtraction by Complement Addition 1101-1001 => 1101 + (~(1001)) +1 = 1101 + 0110 + 1 = 0100 • Two’s Complement - Representing negative numbers. The way twos complement works is by defining the representation for the negative numbers as following: 1 byte: -X = 28 – X; 2 byte: -X = 216 – X; 4 byte: -X = 232 – X It is almost always easiest to work in Hexadecimal System: 1 byte: -X = 0X100– X; Examples: 2 byte: -X = 0X10000– X; -74 = -0x 4A (Hex) = 0x B6 4 byte: -X = 0X10000000– X -3 = -0x 03 (Hex) = 0x FD -8 = -0x 0008 (Hex) = 0x FFF8 Week 3 01/27/2005 Course ISM3230 Dr. Simon Qiu

  9. - Binary-Arithmetic Operations • Two’s Complement - Representing negative numbers. The way twos complement works is by defining the representation for the negative numbers as following: 1 byte: -X = 28 – X; 2 byte: -X = 216 – X; 4 byte: -X = 232 – X Week 3 01/27/2005 Course ISM3230 Dr. Simon Qiu

  10. - Binary-Arithmetic Operations • It is almost always easiest to work in Hexadecimal System: 1 byte: -X = 0X100– X; 2 byte: -X = 0X10000– X; 4 byte: -X = 0X10000000– X Examples: -74 = -0x 4A (Hex) = 0x B6 -3 = -0x 03 (Hex) = 0x FD -8 = -0x 0008 (Hex) = 0x FFF8 Week 3 01/27/2005 Course ISM3230 Dr. Simon Qiu

  11. Assignments2 1. What are the decimal (base ten) values of 1012 , 2547 , 4F16 , 20A12 ,20A16 2. Convert the following numbers from base 10: 25 to base 2; 103 to base 4; 435 to base 16. 3. Convert the hex number 12EFA to binary 4. Convert the binary number 11110100101101111100 to hexadecimal. 5. What are the twos complement equivalents of the following decimal numbers? -74 = - 0x_ _ (Hex) = 0x_ _ (two complement) -128 = - 0x_ _ (Hex) = 0x_ _ (two complement) -3 = - 0x_ _ _ _ (Hex) = 0x_ _ _ _ (two complement) Week 3 01/27/2005 Course ISM3230 Dr. Simon Qiu

More Related