1.4.1 Data Representation Flashcards
Way’s to represent negative numbers
Sign and Magnitude : First bit sign, rest magnitude
- Two Values for 0, Hard to do addition / subtraction, wasted bit - decreased range of values
- Easy to read
One’s Complement : Flip bits
- Two Values for 0
Two’s Complement : Flip Bits and add one
- increased range of values
- Single value for 0
- Calculations more easily performed (no additional hardware needed)
Mantissa, Exponent and Normalisation
Mantissa : The value
- Increasing Mantissa bits increases accuracy
Exponent : How much you shift the decimal point
- Increasing Exponent bits increases range
Normalisation : Floating point numbers start with 01 or 10
- Ensures unique representation of numbers
- Increases precision and accuracy
Character set and examples
Character set : Equates to all the symbols that can be represented / interpreted by a computer
- Each symbol has unique binary value to represent
- Maps values to characters
ASCII : 7 bits (256), Used for English language but not enough for more
UNICODE : 2 - 4 bytes, Can be used to represent all characters from all languages and emojis etc
Shifts and Masks
Shifts : Moving bits to the left or the right - equivalent to putting to power of 2 or 1/2 (x2 or /2)
Masks : Applies logic gate to two binary numbers
Hexadecimal, Binary and Denary
Hexadecimal : Faster to Input, Shorter than Binary
Binary : Computer can understand - in two states - 1 and 0 represent on and off - computers use transistors
Denary : Humans easier to understand, less likely to input wrong