1.4.1 Data Types Flashcards
Convert this binary to denary in two’s complement: 01000011
67
Convert this binary to denary in two’s complement: 10111100
-68
Convert this denary to binary in two’s complement: -47
1101 0000
Convert this denary to binary in two’s complement: 86
0101 0110
How many available values are there for each digit in hexadecimal?
16
Convert the unsigned binary number 11110000 to hexadecimal
F0
Common Data Types (5)
Character. Real (float). Integer. Boolean. String.
What is a pointer? (2)
A pointer is a built-in data type in some low-level languages. It will hold the address of a value or object located in computer memory.
Memory requirements of each data type (5)
Character (4 bytes), String (4 bytes for each character), Boolean (1 bit), Integer (4 bytes), Real (4 bytes).
What are the rules of binary addition?
0+0=0. 1+0=1. 0+1=1. 1+1=0 and carry 1. 1+1+1=1 and carry 1.
How do we represent signed binary integers?
The most significant bit becomes a sign digit. 0 represents positive. 1 represents negative.
How do we represent binary integers in two’s complement?
The most significant bit becomes the neative of that number.
How do you add 2 floating point numbers? [3]
- Normalise both numbers 2. Equalise the exponents by increasing the smaller one to match the larger one 3. Add the mantissas
How do you subtract 2 floating point numbers? [5]
- Normalise both numbers 2. Equalise the exponents by increasing the smaller one to match the larger one 3. Find the two’s complement negative value of second number 4. Subtract by adding the two mantissas 5. Normalise the result
What happens during a left shift? [3]
All the bits in the number are shifted to the left by a specified number of places [1] For every 1-bit shift: The most significant bit is discarded [1] A 0 is put into the empty space on the right [1]