Data Types / Binary Flashcards
primitive data type
a basic data type provided by the programming language as a basic building block
types of primitive data types (5)
integer
real/float
boolean
character
string
denary
base 10 number. uses the combination of ten symbols to represent any number
binary
base 2 number. uses the combination of 2 symbols (0 or 1) to represent every number
hexadecimals
based 16 number. uses the combination of 16 symbols (10 numbers and 6 letters) to represent every number
why use hexadecimal?
easier to read/ remember
quicker to write/type
less chance of making an error
easy to convert
uses of hex
define colours
in MAC addresses
in assembly language and machine code
integer
any positive or negative whole number e.g. 3, 0, -14
real (floating point)
a positive or negative number with a fractional component e.g. 0.002 or -1.98
character
Any single letter, symbol, number, character or control character
string
any combination of letters, symbols, numbers, characters or control characters e.g. Hello, £4.56
Boolean
Any true/ false data types which often represent logical situations
Sign magnitude most significant bit
represents + or -
+ = negative
- = positive
0.1
positive
1.0
Negative