1.4.1 - data types Flashcards
6
primitive data type
One which is provided by a programming language.
e.g., integer, real, string
overflow error
occurs where a carry from the most significant bit requires a
ninth bit
2 methods to represent negative numbers in binary
- sign and magnitude
- two’s complement
bit
The fundamental unit of information in the form of either a single 1 or 0.
kibibyte (KiB)
1024 bytes
full form of ASCII
American standard code for information interchange
ASCII
- originally 7 bits
- now 8 bits
What do the first 32 codes of ASCII represent?
non-printing characters used for control such as backspace
unicode
- originally (UTF-16)
- now, (UTF-32)
How was compatibility retained between Unicode and ASCII?
The first 128 codes in Unicode were the same as ASCII.
0+0
0
0+1
1
1+1
0 carry 1
1+1+1
1 carry 1
overflow errors
Where a carry from the most significant bit requires a
ninth bit.
sign and magnitude
- change the MSB to 0 if positive
- change the MSB TO 1 if negative
MSB
most significant bit
two’s complement
- copy out positive binary upto and including the first 1
- flip the rest
normalisation
The process of moving the binary point of a floating point number to provide the
maximum level of precision for a given number of bits.
How can we identify a normalised number?
- positive number start with 01
- negative numbers start with 10
arithmetic shift
It takes into account the sign bit, which always remains the same.
NOT
flip all the bits
AND
both have to be 1
OR
atleast one has to be 1