1.4.1 Data types - Suprit Flashcards
Define Real Numbers
Positive or negative numbers that typically have a decimal point
Define Integer
A whole number
Define Characters
Any symbol used by the computer
Define String
A collection of characters stored in succession
Define Boolean
Represents True or False
How do computers store whole numbers?
Computers store whole numbers as binary
How many bits make up a nibble?
4 bits
How many nibbles make up a byte?
2 nibbles
Convert binary number 1101 to denary
13
How many bits in a kilobyte?
8000
Convert 47 into binary
101111
What is 1011 + 1110?
(1)1001
(1) is an overflow
What does 0 and 1 at the start of a binary number represent in Sign Magnitude?
0 = Positive Number
1 = Negative Number
If 10101101 = 173, what does Sign Magnitude number 010101101 mean in denary?
It’s also 173
Convert -105 to a Sign Magnitude number
101101001
What is another way to represent positive and negative numbers in binary?
Two’s Complement
How do you convert a binary number into Two’s Complement?
Flip all of the individual bits and add 1
Example - 00000111 (7) becomes 11111000 when its initially flipped, and becomes 11111001 (-7) once 1 has been added on.
How does subtraction work in Two’s Complement?
It works by adding a negative number to a positive number
Subtract 10100 from 01000 in Two’s Complement.
11100 (-4)
What base is Hexadecimal?
Base 16
What numbers and characters are used in hexadecimal?
Numbers 0-9 and Characters A-F
How do you convert Hexadecimal to Binary?
- Split the Hexadecimal number into individual digits
- Convert each digit into denary
- Convert the denary into binary nibbles (4 bits)
- Combine the nibbles together to get the answer.
Convert F1A2 to binary
Answer = 1111000110100010
Explanation -
1. Split F, 1, A, and 2
2. Convert each digit -
F = 15
1 = 1
A = 10
2 = 2
3. Convert the denary into binary nibbles -
15 = 1111
1 = 0001
10 = 1010
2 = 0010
4. Combine them -
1111000110100010
How do you convert hexadecimal to denary?
- Split the Hexadecimal number into individual digits
- Convert each digit into denary
- Convert the denary into binary nibbles (4 bits)
- Combine the nibbles together to get the answer.
- Convert the binary number into denary