Data storage Flashcards
Name 5 different data types
Numbers, text, audio, images, and video
What is a bit pattern
A string of bits
What representation is used to store an integer
fixed-point representation (no decimals only float)
What is an unsigned integer
An integer that can never be negative and only has 0 to positive values. Its range is between 0 and +ve infinity.
What is the largest constant unsigned integer called
maximum unsigned integer
What is the formula to work out the maximum unsigned integer
2^n-1, where n is the number of bits
How does the storing of unsigned integers work
- The integer is changed to binary
- If the number of bits is less than n, 0s are added to the left of the binary value but if the number of bits is greater than n, the integer can not be stored and the condition overflow will occur.
Will the integer 258 store in a 16-bit memory allocation
256= (100000010), therefore yes as there are 7 spaces for 0 and 1s left so we will add 7 0s to the left which will equal (0000000100000010)
what is overflow
When the data that is being stored is greater than the amount of space provided so data is lost
e.g. storing 15 in a 4-bit memory location 15=(10100) and it will only store (0100) so the value will change because of overflow and now it equals 4 and not 15.
How doe sign-and-magnitude representation work
- find the range( 0-2^n -1)
- if it’s positive it will end with0 on the left and if it’s negative it will end with a 1.
- see how big the bit location is and minus 1
How do you store an integer in twos complement format
- Integer is changed to binary
- If the integer is positive or zero, it stores as it is however if its negative the computer stores the two’s complement of the integer
How does retrieving an integer in twos complement format work
- If the leftmost bit is 1; twos complement is applied; if zero no operation is applied
- The computer changes the integer to decimal
What are the three parts of floating-point representation
[sign][shifter][Fixed-pointer number)
e.g.
+7 425 000 000 000. 000
sign[+]shifter[12]fixed-point part[7.425]
what the number(1011 000 000.00) in floating-point format
1.011 x 2^12