Section 3 - Fundamentals of data representation Flashcards

1
Q

What are the three number bases?

A
  • – Decimal (base 10)
  • – Binary (base 2)
  • – Hexadecimal (base 16)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Why is hexadecimal often used in computer science?

A
  • – Uses less storage as larger values can be stored using fewer digits
  • – Easier to understand
  • – Easier to write
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do you convert between binary and decimal?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do you convert between binary and hexadecimal?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How do you convert between decimal and hexadecimal?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the names, units and conversions of the different units of memory size?

p.s. byte, kilobyte etc.

A
8 bits = 1 byte
1000 bytes = 1 kilobyte (kB)
1000 kB = 1 megabyte (MB)
1000 MB = 1 gigabyte (GB)
1000 GB = 1 terabyte (TB)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the rules for when adding binary numbers and how do you add three binary numbers together?

A
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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the effect of binary shifting a number left or right?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the difference between ASCII and extended ASCII?

A

ASCII uses 7 bits whereas extended ASCII uses 8 bits so it can store 128 more characters.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the purpose of unicode and what are the advantages of unicode as opposed to ASCII?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What does the term ‘pixel’ stand for and what is the definition of a pixel?

A

‘Pixel’ is short for picture element. A pixel is a single point in an image.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the colour depth on an image?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How do you calculate the size of an image?

A

Image size = width (in pixels) * height (in pixels)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the effect of image size and colour depth on file size?

A

If image size or colour depth increases then file size will also increase.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How do you calculate file size in bits and bytes?

A
file size (in bits) = width * height * colour depth
file size (in bytes) = (width * height * colour depth) / 8
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Is sound analogue or digital and in what format must it be stored on a computer?

A

Sound is analogue and must be converted into a digital format as a series of binary numbers using an Analogue-to-Digital Converter.

17
Q

How do you convert sound waves into a digital version?

A

To convert:

  • – Analogue sound is received by microphone
  • – Converted into electrical analogue signal
  • – Amplitude is sampled (measured at regular intervals)
  • – Values are rounded to a level
  • – Values stored as series of binary numbers
18
Q

What is sampling rate and sample resolution?

A

Sampling rate:
— Number of samples taken per second measured in hertz

Sample resolution:
— Number of bits used to store each sample.

19
Q

How do you calculate the sound file size?

A

Sound file size = sample rate * resolution * number of seconds

20
Q

What is data compression and what are some reasons data may be compressed?

A

Data compression is making files smaller. Some reasons why data may be compessed is:

  • – to reduce the amount of storage
  • – allow files to be transmitted quicker
  • – allow large files to be sent as an email attachment.
21
Q

How can data be compressed using Huffman coding?

A

Huffman coding helps to compress data by reducing the number of bits used to represent each letter.

22
Q

How do you calculate the number of bits required to store a word or phrase with huffman coding as opposed to ASCII?

A

For Huffman coding:
— Add the number of bits required for each character in the word or phrase

For a 7-bit ASCII:
— The number of characters in the word or phrase * 7

NOTE: refer to another source for a more detailed understanding

23
Q

Compare lossy and lossless compression.

A

Lossy:
— Files are compressed by removing some details

Lossless:
— No data is lost when files are compressed

24
Q

What is run length encoding (RLE)?

e.g How would 0000011100000011 be represented using RLE?

A

Run length encoding:
— A form of lossless compression where runs of data are stored using frequency/data pairs.

0000011100000011 would become 5 0 3 1 6 0 2 1