Data representation Flashcards
Character code:
A binary representation of a letter, character or number
ASCII
A standard binary coding system for characters and number.
First was 7 bits (128 permutations), now extended to 8 bits (256 characters).
BUT 256 not enough, doesn’t cover all languages or platforms. Due to the widespread use of the web, increasing need for this. HENCE UNICODE
Unicode:
A standard binary coding system that has superseded ASCII. It includes characters from over 20 countries.
16 bits, constantly updated as aims to cover every language and platform(HW and SW) and every program
Parity bit:
Method of checking binary codes by counting the number of 1s and 0s. Even = even num 1’s. Odd = odd num 1’s
Majority voting:
Produces same data several times and checks the same both time EG 101 - 111000111
Check digits
Digit added onto end to check data is accurate, used in bar code scanners
Worked out by:
- Adding up numbers, add up that answer to get one digit BUT if digits swapped around in transmission, still get same check digit
- Modulo - 11 each num given weighting (scaling factor), times by this, add together, mod 11, remainder is check digit. ( rem = 10 ,X and rem = 11, 0)
Why is hexadecimal preferred?
Useful to represent large numbers with as fewer digits as possible - 2 hex digits represent 1 byte.
USED —> identify memory addresses as less digits than binary representation
Number Systems
Natural N - (0,1,2,3)
Integer Z - (-3,-2,-1,0,2)
Rational Q - (-1/2, 2.5, 3)
Irrational - (Pi, root2, root3)
Real R - EVERYTHING
Ordinal - (1st, 2nd, 3rd) used with size of lists often eg 3rd out of 30
Counting + measurement
- Natural for counting (counter used to keep track how many times looped)
- Real for measurement (microwaves control - both time and temp measured)
Bit
A fundamental unit of info, either a 1 or 0
Why comps use binary?
Processor only handles electricity in a simple way, flowing or not. Hence 2 states 0 (off) and 1 (on)
How many different values can be represented with 5 bits?
2^5 = 32
KMGT
BINARY DECIMAL
Kibi - 2^10 bytes Kila - 10^3
Mebi - 2^20 bytes Mega - 10^6
Gibi - 2^30 bytes Giga - 10^9
Tebi - 2^40 bytes Teba - 10^12
Unsigned binary
Represent positive numbers
Signed binary
Represent positive and negative numbers
Two’s compliment
Max number in binary
2^(n)-1