4new - Representation and Manipulation Information(3 1...

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

View Full Document Right Arrow Icon
1 Representation and Manipulation Information (3)
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 Outline Encodings Unsigned and two’s complement Conversions Signed vs. unsigned Long vs. short Suggested reading Chap 2.2
Background image of page 2
3 Unsigned Representation Binary (physical) – Bit vector [x w-1 ,x w-2 ,x w-3 , x 0 ] Binary to Unsigned (logical) B 2 U ( X ) = x i 2 i i = 0 w - 1
Background image of page 3

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

View Full DocumentRight Arrow Icon
4 Two’s Complement Binary (physical) – Bit vector [x w-1 ,x w-2 ,x w-3 , x 0 ] Binary to Signed (logical) 2’s complement B 2 T ( X ) = - x w - 1 2 w - 1 + x i 2 i i = 0 w - 2 Sign Bit
Background image of page 4
5 From Two’s Complement to Binary If nonnegative Nothing changes If negative, its binary representation is  - = - + = 2 0 1 1 2 2 w i i w 2 2 1 1 1 w 1 0 0 0 2 2 (2 2 ) ( (1 )2 1) w w w w i w i i i i i i i i x x x x - - - - - - = = = - + = - - = - - + 0 1 2 1 x x x w -
Background image of page 5

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

View Full DocumentRight Arrow Icon
6 Two’s Complement What does it mean? Logical value = -(~Binary + 1) ~Binary = -Logical value – 1 Binary = ~(-Logical value – 1) Binary = ~(-Logical value ) + 1 (be proved later) 2 1 1 w 1 0 0 2 2 ( (1 )2 1) w w w i i i i i i x x x - - - - = = - + = - - + ∑ ∑
Background image of page 6
7 From a Number to Two’s Complement -5 5 0101 (binary for 5) 1010  (after complement) 1011 (add 1)
Background image of page 7

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

View Full DocumentRight Arrow Icon
8 Two’s Complement Encoding Examples Binary/Hexadecimal Representation for -12345 Binary:  0011 0000 0011 1001 (12345) Hex:           3       0      3      9 Binary:  1100 1111 1100 0110 (after complement) Hex:           C     F     C      6 Binary:  1100 1111 1100 0111 (add 1) Hex:           C     F     C      7
Background image of page 8
Numeric Range Unsigned Values
Background image of page 9

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

View Full DocumentRight Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/19/2011 for the course CS 000 taught by Professor Jing during the Fall '10 term at Fudan University.

Page1 / 36

4new - Representation and Manipulation Information(3 1...

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

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