Section 3 - Fundamentals of data representation Flashcards
What are the three number bases?
- – Decimal (base 10)
- – Binary (base 2)
- – Hexadecimal (base 16)
Why is hexadecimal often used in computer science?
- – Uses less storage as larger values can be stored using fewer digits
- – Easier to understand
- – Easier to write
How do you convert between binary and decimal?
Binary to decimal:
— Add the column values where a ‘1’ appears.
Decimal to binary:
— Look for the largest number that can be subtracted from the decimal number and continue from there.
NOTE: if you need extra help on this then refer to another source.
How do you convert between binary and hexadecimal?
Binary to hex:
— Split the binary into two lots of four bits and convert each set of four into a hex digit.
Hex to binary:
— Covert each hex digit into a group of 4 binary digits.
NOTE: if extra help is needed then refer to another source
How do you convert between decimal and hexadecimal?
Decimal to hex:
— Divide the decimal number by 16 then work out the remainder. Work out what the quotient is in hex and then work out the hex digit for the remainder
Hex to decimal:
— Multiply the first hex digit by 16 then add the value of the second hex digit
NOTE: if extra help is needed then refer to another source
What are the names, units and conversions of the different units of memory size?
p.s. byte, kilobyte etc.
8 bits = 1 byte 1000 bytes = 1 kilobyte (kB) 1000 kB = 1 megabyte (MB) 1000 MB = 1 gigabyte (GB) 1000 GB = 1 terabyte (TB)
What are the rules for when adding binary numbers and how do you add three binary numbers together?
Rules: 0 + 0 = 0 0 + 1 = 1 1 + 1 = 0 carry 1 1 + 1 + 1 = 1 carry 1
— To add three numbers, you need to add the first two numbers then add the third number to the result.
What is the effect of binary shifting a number left or right?
Binary shift left:
— Multiplies the number by two for each time it is shifted e.g a binary shift left three places multiplies the original binary number by 8
Binary shift right:
— Divides the number by two for each time it it shifted e.g a binary shift right two places will divide the binary number by 4
What is the difference between ASCII and extended ASCII?
ASCII uses 7 bits whereas extended ASCII uses 8 bits so it can store 128 more characters.
What is the purpose of unicode and what are the advantages of unicode as opposed to ASCII?
The purpose of unicode is to be able to represent different characters from all languages of the world. It uses 8, 16 or 32 bits per character.
The advantage unicode has over ASCII is that it can represent more unique charcters than ASCII so allows for multilingual text in any language.
NOTE: unicode uses the same codes as ASCII up to 127.
What does the term ‘pixel’ stand for and what is the definition of a pixel?
‘Pixel’ is short for picture element. A pixel is a single point in an image.
What is the colour depth on an image?
Colour depth:
— The number of bits used to represent each pixel
e.g. to represent 256 possible colours on an image, you would require 8 bits per pixel so 2^8 therefore the colour depth is 8 bits
How do you calculate the size of an image?
Image size = width (in pixels) * height (in pixels)
What is the effect of image size and colour depth on file size?
If image size or colour depth increases then file size will also increase.
How do you calculate file size in bits and bytes?
file size (in bits) = width * height * colour depth file size (in bytes) = (width * height * colour depth) / 8