3.5 data representation Flashcards
natural numbers set
- symbol N
- integer
- positive
integers set
- symbol Z
- positive and negative
- cannot be fractional
real numbers set
- symbol R
- positive and negative
- irrational, fractional
rational numbers set
- symbol Q
- can be represented as fractions
- positive and negative
irrational numbers set
- no specific symbol
- cannot be represented as fractions
ordinal numbers
- natural number that describes the numerical position of a value
- used for ordering
why hexadecimal used
- more compact when displayed
- easier for people to remember
- lower likelihood of error when typing in data
- saves programmer time writing in data
kibi, Ki
2^10 (1024) bits, kilobytes (10^3) but accurate
mebi, Mi
2^20, megabytes (10^6) but accurate
gibi, Gi
2^30, gigabytes (10^9) but accurate
tebi, Ti
2^40, terabytes (10^12) but accurate
unsigned binary
- positive integers
- min and max values for n bits are 0 and (2^n) - 1 respectively
signed binary
- negative (and positive) integers
- range of integers that can be represented by two’s complement -2^(n-1) to + (2^(n-1)-1)
practice two’s complement representation of signed integers
- most significant bit (leftmost) has a place value of -2^(n-1), where n is the number of bits
- for pos numbers, left bit has to be 0
- for neg numbers, left bit has to be 1
find negative equivalent of a positive number in two’s complement
- flip the bits and add 1 (literally 1. rightmost bit)
why was unicode introduced
- support a larger range of chars
- to facilitate communication / text in different languages
analogue data
- continuous
- no limits to values data can take
can change as freq. as required
analogue signal
consists of a continuously variable voltage
digital data
- discrete
- can only take specified range of values
- can only change value at specified intervals
digital signal
representation of discrete values over time
digital to analogue converter
- reads bit pattern representing an analogue signal
- outputs an alternating, analogue, electrical current
analogue to digital converter
- analogue signal sampled at regular time intervals
- amplitude of wave at each interval measured
- measurement coded into fixed num of bits
sampling
- taking measurements of the level of the analogue signal (amplitude) at regular time intervals
- measurements assigned a binary pattern, stored in memory
sampling rate
- number of samples taken per second, measured in Hz (1Hz equal to 1 sample p/s)
- higher sampling rate = better quality of audio recording, as well as bigger file size