Database representation Flashcards
What is the key defining feature of two’s complement
The most significant bit (leftmost bit) is negative
What are the three steps to Logical shifts (left or right)
- Move each bit the designated number of bits
- Discard any bits beyond the scope of data
- Insert zeros into vacant positions
What does the new number represent from logical left and right shifts
Left the original number being multiplied by 2
Right the original number being divided by 2
What is the difference between left arithmetic shifts and left logical shifts
In the arithmetic shifts very left bit is negative, whereas in logical shifts it is positive
What is the difference between right arithmetic shifts and left logical shifts
In arithmetic shifts the very left bit is signed and, instead of replacing the vacant spots with a zero they are replaced with a one
Truncating
Removes the least significant bits from the number
What kind of bias does truncating introduce
A downwards bias i.e. Numbers are smaller
Rounding
Approximates the number to the nearest whole number/tenth/hundredth etc.
What might truncation be used to do
Ensure that a value doesn’t exceed a limited length
What industries may have regulations and standards related to truncating and rounding
Financial reporting