Lecture 2 - Th The University of Texas at Dallas Erik...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
Erik Jonsson School of Engineering and h U i it f T t D ll Computer Science The University of Texas at Dallas Easier Ways to Express Binary Numbers Unfortunately, we were not born with 4 (or 8!) fingers per hand. The reason is that it is relatively difficult to convert binary numbers to decimal, and vice-versa. , However, converting hexadecimal (base-16) numbers back and forth to binary is very easy (the octal, or base-8, number system was also used at one time). Since 16 = 2 4 , it is very easy to convert a binary number of any length into hexadecimal form, and vice-versa: 0 16 = 0 10 = 0000 2 4 16 = 4 10 = 0100 2 8 16 = 8 10 = 1000 2 C 16 = 12 10 = 1100 2 1 16 = 1 10 = 0001 2 5 16 = 5 10 = 0101 2 9 16 = 9 10 = 1001 2 D 16 = 13 10 = 1101 2 2 16 = 2 10 = 0010 2 6 16 = 6 10 = 0110 2 A 16 = 10 10 = 1010 2 E 16 = 14 10 = 1110 2 3 16 = 3 10 = 0011 2 7 16 = 7 10 = 0111 2 B 16 = 11 10 = 1011 2 F 16 = 15 10 = 1111 2 he letters that stand for hexadecimal numbers above 9 can be upper © N. B. Dodge 9/09 1 Lecture #2: Signed Binary Numbers and Binary Codes The letters that stand for hexadecimal numbers above 9 can be upper or lower case – both are used. Note that one nibble = one hex digit.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Erik Jonsson School of Engineering and h U i it f T t D ll Computer Science The University of Texas at Dallas Binary-Hexadecimal Since 2 4 = 16, each hex digit effectively represents the same numeric count as four binary digits. Another way to say this is that one column in a hex number is the same as four columns of a binary number. 00101011011 01111010 16 0 16 1 16 2 16 -1 16 -2 = x 5B 7A* 100101011011.01111010 2 5 2 4 2 6 7 2 9 2 8 2 10 2 11 2 1 2 0 2 2 3 2 -3 2 -4 2 -2 2 -1 2 -7 2 -8 2 -6 -5 0x 95B.7A *Note: The “0x” prefix before a number signifies hexadecimal © N. B. Dodge 9/09 2 Lecture #2: Signed Binary Numbers and Binary Codes 2 2 2 “hexadecimal .”
Background image of page 2
Erik Jonsson School of Engineering and h U i it f T t D ll Computer Science The University of Texas at Dallas Hexadecimal-Binary Conversion Most computers process 32 or 64 bits at a time. In a 32-bit computer such as we will study, each data element in the mputer memory (or “word”)is32bits . computer memory (or word ) is 32 bits. Example: 01111000101001011010111110111110 Separate into 4-bit groups, starting at the right: 0111 1000 1010 0101 1010 1111 1011 1110 Converting: 0111 2 =7 16 , 1000 2 =8 16 , 1010 2 =A 16 , 0101 2 =5 16 , 1010 2 =A 16 , 1111 2 =F 16 , 1011 2 =B 16 , 1110 2 =E 16 Or, 01111000101001011010111110111110 = 0x 78A5AFBE Another example: Grouping: 1001011100.11110011 2 = 10 0101 1100 . 1111 0011 = (00)10 0101 1100 . 1111 0011 2 5 C F 3 = 0x 25C F3 © N. B. Dodge 9/09 3 Lecture #2: Signed Binary Numbers and Binary Codes = 2 5 C . F 3 = 0x 25C.F3
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Erik Jonsson School of Engineering and h U i it f T t D ll Computer Science The University of Texas at Dallas Binary-Hex and Hex-Binary Examples More binary-hex conversions*: 101110100010 = 1011 1010 0010 = 0x BA2. 101101110.01010011 = (000)1 0110 1110 . 0101 0011 = 0x 16E.53. 1111111101.10000111 = (00)11 1111 1101 . 1000 0111 = 0x 3FD.87. To convert hex-binary, just go the other direction! 0x 2375 = (00)10 0011 0111 0101 = 10001101110101. 0x CD.89 = 1100 1101.1000 1001 = 11001101.10001001. 0x 37AC.6 = (00)11 0111 1010 1100.011(0) = 11011110101100.011. 0x 3.DCAB = (00)11.1101 1100 1010 1011 = 11.1101110010101011.
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/16/2009 for the course EE 2310 taught by Professor Dodge during the Spring '09 term at University of Texas at Dallas, Richardson.

Page1 / 56

Lecture 2 - Th The University of Texas at Dallas Erik...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online