4. Representing Data Flashcards
How do you convert from denary to binary?
Keep subtracting number by biggest base 2 that goes into it. Base 2’s that go in are 1’s in binary column.
Eg. 12 - 8 = 4
4-4 = 0
1’s in 8 and 4 column
How do you add binary?
1+1 = 10 (carry the 1) 0+1 = 1 0+0 = 0
What is it called when result of addition exceeds available space?
Overflow
Why is hexadecimal used?
What does it look like
Represents 16 values instead of 2 of binary, so easier to remember for programmers
0-9 and then A to F
How do you convert between hexadecimal and denary?
Put each digit in base 16 columns
Multiply digit by the base 16
Eg. 27 = 216 + 71
How do you convert denary to hexadecimal?
Keep dividing by 16 and record remainders
Eg. 45/16 = 2 remainder 13
2/16 = 0 remainder 2
=2D (last to first)
How do you convert from binary to hexadecimal?
Split split into nibbles
Value of each nibble is one digit of hexadecimal
How do you convert from hexadecimal to binary?
Replace each hex digit with binary nibble
Work out denary then binary
What is difference between ASCII and Unicode character set?
ASCII 7 bit (128 characters) or extended 8 bit (252 char)
Unicode 16 bit (65 000 char) or 32 (4 billion)
Unicode can include specialist symbols and multiple languages, keep 128 characters of ASCII so ASCII is subset of Unicode
What is a character set?
List of codes that match characters
What happens if you sort the list ‘Gorilla’, ‘bear’, ‘Elephant’, ‘Cat’ and ‘dog’ in a program using ASCII (or Unicode) as character set?
Cat Elephant Gorilla bear dog (as A first and z last)
What is metadata?
Data about the data eg. Of image
How many colours can 1-16 bits represent
1 bit- two (2^1) 2 bits- four(2^2) 4 bits- sixteen (2^4)etc. 8 bits- 256 16 bits- 65 536
What is the colour depth? Units?
Names?
Number of bits in a pixel (bpp)
16 bpp = high colour
24 bpp = true colour
32 bpp = deep colour
What is the resolution? Units?
Number of pixels in a unit (dpi)