CSE 115 Lecture Notes - Lecture 37: Negative Number

77 views3 pages

Document Summary

What is the value of 1012? answer: 5. Given n bits, there are 2n distinct bit patterns (so 2n distinct values can be represented) Using a 4-bit wide representation, find the representation of -3: start with the representation of +3: 0011 compute its one"s complement: 1100 compute its two"s complement: 1101. Keep in mind: representation has a fixed width! Since -0 = 0, there is one leftover negative bit string. For example, let that represent a negative number, -8 in the case of a 4-bit wide representation. In general, the range of values for a k-bit wide two"s complement representation is from -2(k-1) to +2(k-1)-1 so for a 4-bit wide representation, the range is: -8 to +7. Adding one to the largest magnitude positive number yields the largest magnitude negative number. The negative of the largest magnitude negative number is itself. In the 4-bit wide scheme, -(-8) is -8.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Questions