Class Notes (836,866)
Canada (509,937)
York University (35,329)
ITEC 1000 (85)
all (19)


4 Pages
Unlock Document

Information Technology
ITEC 1000
All Professors

Introduction to Information Technology ITEC 1000 – Winter 2010 – Peter Khaiter Lecture 4 – Representing Integer Data – Jan 25 Number Representation - An integer is a number which has no fraction part. - Numbers can be represented as a combination of o Value or magnitude o Sign (plus or minus) Conventional Binary vs. BCD - Binary representation generally preferred o Greater range of value for given number of bits o Calculations easier - BCD is still used o In business applications to maintain decimal rounding and decimal precision o In applications with a lot of input and output, but limited calculations Signed-Integer Representation - No obvious direct way to represent the sign in binary notation - Options: o Sign-and-magnitude representation o 1’s complement o 2’s complement (most common) Calculation Algorithms - Sign-and-magnitude algorithms complex and difficult to implement in hardware o Must test for 2 values of 0 o Useful with BCD o Order of signed number and carry/borrow makes a difference - Example: Decimal addition algorithm Complementary Representation - Sign of the number does not have to be handled separately - Consistent for all different signed combinations of input numbers - Two methods o Radix: value used is the base number o Diminished radix: value used is the base number minus 1  9’s complement: base 10 diminished radix  1’s complement: base 2 diminished radix 9’s Decimal Complement - Complement representation: (1) positive number: remains itself; (2) negative number: subtracting its absolute value from a standard basis value - Decimal (base 10) system: diminished radix complement o Radix minus 1 = 10 – 1 9 as the basis o 3-digit example: base value = 999 o Range of possible values 0 to 999 arbitrarily split at 500 - Necessary to specify number of digits or word size - Conversion to sign-and-magnitude value for 9’s complement representation(3 digits) Addition: Counting Upwards - Counting upward on scale corresponds to addition - Example in 9’s complement: does not cross the modulus Addition with Wraparound - Count to the right to add a negative number to the representation (since the complement 699 represents the value of -300) - Wraparound scale used to extend the range for the negative result o Counting left would cross the modulus and give incorrect answer because there are 2 values for 0 (+0 and -0) Addition with End-around Carry - Count to the right crosses the modulus - End-around carry: o Add 2 numbers in 9’s complementa
More Less

Related notes for ITEC 1000

Log In


Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.