Unit 6 - Data Types Flashcards
binary addition rules
- 0 + 0 = 0
- 0 + 1 = 1
- 1 + 1 = 0 carry 1
- 1 + 1 + 1 = 1 carry 1
what is an overflow
when the arithmetic result exceeds the available number of bits
what does one shift to the left do
x 2
what does one shift to the right do
/2
how does twos complement work
-128, 64, 32, 16, 8, 4, 2, 1
how to work out if the denary value will be positive or negative in twos complement
starts with 0 = positive
starts with 1 = negative
how convert a negative denary number to binary
- flip all of the bits
- add 1
how to convert a negative twos complement binary number to denary
- flip the bits
- add one
- negative sign in-front of byte
- convert
how to do binary subtraction using twos complement
- convert negative binary number into twos complement
- add positive binary value and twos complement value
why are fixed point binary number useful
- represent fractions in binary
- increased performance
what is limited by fixed point binary
- range
advantages of floating point binary
- greater range
- greater accuracy
what does moving the point to the right in floating point binary do
increase range
reduces precision
what does moving the point to the left in floating point binary do
reduces range
increases precision
what is the mantissa
the coefficient
what is the exponent
the order of magnitude
positive exponent means
decimal point moves right
negative exponent means
decimal point moves left
how to handle negative exponents
- twos complement of exponent
- move the binary point of the mantissa by exponent to the left
- translate to denary
how to handle negative mantissas
- find twos complement of mantissa
- translate exponent to denary
- move binary point by exponent to the right
- translate this to binary
what does the sign bit show
positive or negative value of mantissa
- 0. = positive
- 1. = negative
what is normalisation
process of moving the binary point of a floating point number to provide the maximum level of precision for a given number of bits. this is achieved by ensuring that the first digit after the binary pin t is a significant digit
how to normalise a positive binary number
a positive number has a sign but if 0 and the next digit is always 1. this means the mantissa of a positive number in normalised for always lies between 1/2 and 1
normalising a negative binary number
a normalised negative number has a sign but of 1 and the next bit is always 0