Data representation and data types Flashcards
paper 2
what is a word
number of bits that can be simultaneously be processed or stored in a single register - typically 32 or 64 bits
order of the byte groups
byte (2^0 bits)
kilobyte (2^10)
megabyte (2^20)
gigabyte
terabyte
petabyte
what does a character set do?
maps each character to a unique binary number
eg ascii and unicode
what is shifting used for?
multiplication and division
logical shift
shifts digits either left or right not considering sign
used with positive unsigned integers
overflows ignored
arithmetic shift
shifts digits either left or right while maintaining the MSB to keep the sign AND the sign is passed on to 2nd MSB
sign and magnitude
MSB represents the sign
1 for negative and 0 for positive
rest of the digits are used as normal
can represent between -127 and +127
two’s complement
MSB represents -128 and the other values are added to it (if it is set to 1)
can represent between -128 and +127
make a negative number by making a positive number and flipping all the digits up until the leftmost 1
what does the number of bits representing the mantissa influence?
the precision of the floating point
what to do with a negative exponent
convert it to denary
move the decimal LEFT by that many spaces
calculate the denary value
pro of floating point
greater range of positive and negative numbers can be stored in the same bits
floating point cons
numbers not always stored accurately
requires more complex processing
no exact representation of 0
truncation
simply ignoring the bits after the cut off point
method of dealing with overflows by the processor
rounding
approximates a number to the nearest integer, half, quarter etc
absolute error fomula
original number - truncated (or rounded) number