1/28
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
signed magnitude pros
simple and intuitive representation
easy to convert unsigned values to signed positive numbers (just add 0 as sign bit)
signed magnitude cons
sign bit makes it difficult to do arithmetic
2 representations of 0, makes no sense
ones complement pros
easy to perform addition so simple circuits
ones complement cons
2 representations of 0
twos complement pros
no special bits so simple circuits
single representation of 0
2 reasons why computers use binary
computers use transistors which only have 2 states
efficient for boolean computational logic
decimal to ones complement method
decimal to unsigned binary
extend bits if needed
flip bits
ones complement to decimal method
if MSB if 1, flip bits
unsigned binary to (negative) decimal
decimal to twos complement method
decimal to unsigned binary
if decimal was negative, flip bits + add 1
twos complement to decimal method
if MSB = 1, flip bits + add 1
unsigned binary to decimal
maximum/minimum for unsigned binary
minimum = 00000000 = 0
maximum = 11111111 = 255
maximum/minimum for signed binary
minimum = 11111111 = -127
maximum = 01111111 = 127
maximum/minimum for ones complement
minimum = 1 0000000 = -127
maximum = 0 1111111 = 127
maximum/minimum for twos complement
minimum = 10000000 = -128
maximum = 01111111 = 127
signed magnitude addition method
if operands have same sign, add magnitudes and keep bit
else large operand - small operand and choose sign bit of larger magnitude operand
signed magnitude subtraction method
rearrange -b to +b by changing sign bit
if operands have same sign post change, add
else large operand - small operand with final answer sign same as large operand
signed multiplication/division method
perform as unsigned, if operands have same signs then keep, else pick from larger operand
ones complement addition overflow
end carry around
twos complement addition overflow
discard excess carry bits
if final carry bit is not same as last answer bit, overflow is detected
ones/twos complement multiplication/division method
convert both operands to be positive
perform as unsigned
convert to negative is operands had different signs
IEEE-754 single precision format
32 bits
sign bit + 8 bit exponent + 23 bit significand
127 bias
IEEE-754 double precision format
64 bits
sign bit + 11 bit exponent + 52 bit significand
1023 bias
IEEE-754 single precision to decimal method
calculate exponent by exponent - bias
add leading 1 to significand (1.significand)
move floating point as per exponent, calculate and add sign
decimal to IEEE-754 single precision method
convert to unsigned binary
normalise and find exponent
set sign bit
0, infinity and not a number special values for IEEE-754
0: 0/1 00000000 000…
infinity: 0/1 11111111 000…
not a number: 0 11111111 any significand
IEEE-754 addition method
adjust floating point so significands have same exponent (2^0)
if different signs, add significands else subtract
renormalise if needed and pick sign
IEEE-754 multiplication method
add decimal exponents
multiply significands
renormalise and set exponent
select sign
IEEE-754 division method
subtract decimal exponents
divide significands
renormalise and set exponent
select sign
overflow/underflow in IEEE-754
overflow: exponent > 128
underflow: magnitude too close to 0 to be distinguished from it