CSE 12 Lecture Notes - Lecture 8: Signed Number Representations, Additive Inverse
CSE 12 verified notes
8/20View all
Document Summary
Data in a computer is just high and low voltages. high voltage = 1 low voltage = 0. We interpret this data based on its encoding. Computers encode all sorts of data: numbers integers unsigned signed signed magnitude, two"s complement, bias notation fraction fixed point floating point. These are interpreted as unsigned numbers (positive). n = # of bits. The most significant bit is the sign bit: 0 = positive, 1 = negative. Other bits are treated as a magnitude n = # of bits. Range: -(2^(n-1) - 1) -> 2^(n-1) - 1. How many distinct values can we represent? minimum: 1111 -> -8 maximum: 0111 -> 7. Two"s complement is how modern computers store signed integers. The most significant bit is the signed bit: 0 = positive, 1 = negative. Positive #s are encoded the same as unsigned with the exception that you have one less bit (msb). n = # bits.