Data Types (1.4.1) Flashcards
What are the five main data types?
- Character
- String
- Boolean
- Integer
- Real
What is an integer?
A whole number with no fractional part.
e.g. 6, -12, 451 , 0
What is a real number/float?
Numbers which can have a fractional part.
e.g. 0, -71.5, 5.01
What is a character?
A single letter, digit, symbol or control code
e.g. R, g, 7, &
What is a string?
A collection of characters.
e.g. “Hello world!”, “07789”
What is a boolean data type?
Can take one of two values (TRUE or FALSE)
How are data types represented in the computer?
Using binary (0s and 1s)
What is binary?
A number system in base 2 where each step represents a value of 2x the previous place
What is a bit?
A single binary digit
What is a byte?
Eight bits
What is a nybble?
Half a byte of four bits
Binary addition:
0+0+0=
0
Binary addition:
0+0+1=
1
Binary addition:
0+1+1=
10
Binary addition:
1+1+1=
11