{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# cp1_lect_3 - Taxonomy of Integers Integer Representat ion...

This preview shows pages 1–7. Sign up to view the full content.

5/10/10 Taxonomy of Integers Integer Representat ion Unsigne d Signed Signed Magnitud e One’s Complem ent Two’s Complem ent Mostl y used

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

View Full Document
5/10/10 Unsigned Binary Integers 3-bits 5-bits 8-bits 0 000 00000 00000000 1 001 00001 00000001 2 010 00010 00000010 3 011 00011 00000011 4 100 00100 00000100 (011)2 = 0.22 + 1.21 + 1.20 = 2+1 = 3 k = number of bits Range is: 0 to 2k-1 Problem: How do we represent negative numbers? Applications: Counting, and Memory addressing in a computer Ex: k=5, Range is 0 to +31
5/10/10 Signed Magnitude Leading bit is the sign bit -4 10100 -3 10011 -2 10010 -1 10001 -0 10000 +0 00000 +1 00001 +2 00010 +3 00011 +4 00100 k=no. of bits Range is: -(2k-1 – 1) (2k- 1 – 1) Where a, b, and c can each take on 0/1 Ex: k=5 Range is : -15……..+15 Y = “abc” = (-1)a (b.21 + c.20)

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

View Full Document
5/10/10 Signed Magnitude 41-4 Problems: Addition/Subtraction is not straightforward Try 2+(-3) 2 = 00010 -3 = 10011 -1(expected) = 10101 =-5 There are two zeroes! Application: No numbers, but for changing analog signals to digital signals
5/10/10 One’s Complement To convert -2 to +2 -4 11011 -3 11100 -2 11101 -1 11110 -0 11111 +0 00000 +1 00001 +2 00010 +3 00011 +4 00100 Range is: -(2k-1 – 1) … (2k-1 – 1) If MSB (most significant bit) is 1 then the number is negative (same as signed magnitude) Ex: k=8, Range is : -127…… +127

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

View Full Document
5/10/10
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 25

cp1_lect_3 - Taxonomy of Integers Integer Representat ion...

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

View Full Document
Ask a homework question - tutors are online