1.4 Data Representation and data types Flashcards
What are the 4 rules of binary subtraction?
0 - 0 = 0
1 - 1 = 0
1 - 0 = 1
0 - 1 = 1 (After Borrowing)
The bit turns into two
What is 1110 - 1101 ?
1 1 1 0
- 1 1 0 1
= 0001 or just 1
What are the parts of a parts of floating point stored number?
Mantissa
- Sign bit
- Decimal Point
- Value
Exponent
- Sign bit
- Value
What is truncation?
When there is not enough bits to represent all numbers stored and extra bits are missed out
e.g. 0.100101 could be cut down to 0.1001
What are the types of error measurements for truncation, rounding and floating points?
Absolute error- Original number -Altered Number
Relative error- Absolute error/ Original Number
What is rounding?
This is when there are not enough bits to represent all numbers and the bit before the cut off is increased by 1 if the bit after the cut off is 1
e.g. 0.0101101 -> 0.011
What is normalization in floating point numbers?
This is when a floating point number (exponent and mantissa) is changed so that the first digit of the mantissa is a significant figure.
Why do we normalize a floating point number?
To allow for the maximum possible precision with a given number of bits
What is the order of prefixes for storing bytes?
Byte - B - 8 bits
Kilobyte- KB - 1024B
Megabyte - MB - 1024KB
Gigabyte - GB - 1024MB
Terabyte - TB - 1024GB
Petabyte - PB - 1024TB
Exabyte - EB - 1024PB
Zettabyte - ZB - 1024EB
Yottabyte - YB - 1024ZB
How many bits is an ASCII character and how many characters can be represented?
7-bits and 128 characters
What does ASCII stand for?
American Standard Code for Information Interchange
How many bytes does UNICODE use to store characters?
up to 4 bytes/ 28 bits
But usually 2 bytes
What is the storage requirements for each data type?
Character - 1 byte for ASCII or 4 bytes for UNICODE
String - number of characters multiplied by 1 byte or 4 bytes
Boolean - 1 bit
Integer- 2 bytes
Real- Whatever the word length of a system (64 bit -> 8 bytes but depends on the mantissa and exponent size