S4 - Data representation (Done) Flashcards

1
Q

What are the three logic gates ?

A

NOT, AND and OR.

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

What are logic gates ?

A

Special circuits built into computer chips, which receive binary data, apply a boolean operation and then output a binary result.

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

What is a NOT gate ?

A

They take and give a single output, the output being the opposite of the input.

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

What is an AND gate ?

A

They take two inputs and give one output, if both inputs are 1 the output is one, otherwise the output is 0.

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

What is an OR gate ?

A

They take two inputs and give one output, if one or more inputs are 1 then the output will be one, otherwise the output is 0.

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

What do the 1s and 0s used by computers actually represent ?

A

The flow of electricity, 1 meaning there is a flow, 0 meaning there isn’t a flow.

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

What is a bit ?

A

A single binary digit.

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

What is a nibble ?

A

4 bits.

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

What is a byte ?

A

8 bits.

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

What is a kilobyte ?

A

1000 bytes.

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

What is a megabyte ?

A

1000 kilobytes.

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

What is a gigabyte ?

A

1000 megabytes.

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

What is a terabyte ?

A

1000 gigabytes.

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

How many values can a nibble take ?

A

Made up of 4 bits so 2^n (where n equals number of bits) so 2^4 = 16 different values.

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

How many values can a byte take ?

A

Made up of 8 bits so 2^8 = 256 different values.

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

What is the standard number system called ?

A

Decimal, denary or base-10, as it uses 10 different digits.

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

What is binary called ?

A

Base-2, as it only uses 2 digits (1 and 0).

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

What are the rules for addition in binary ?

A

0 + 0 = 0, 1 + 0 = 1, 1 + 1 = 0 carry the 1, 1 + 1 + 1 = 1 carry the 1.

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

What does a left binary shift do ?

A

Multiplies the number, for every place shifted left the number is doubled. So 2^n (n = number of places shifted) to calculate what the number is multiplied by.

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

What does a right binary shift do ?

A

Divides the number, for every place shifted right the number is halved. So 2^n (n = number of places shifted) to calculate what the number is divided by.

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

What is hexadecimal ?

A

Base-16, uses 16 different digits - each hex character equates to a nibble in binary.

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

Why is hex preferred when coding ?

A

Simpler to remember large numbers in hex - they’re shorter than binary, due to this lower chance of input errors and it’s easier to convert between binary and hex than binary and decimal.

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

How do place values in hex change ?

A

Increase in powers of 16 from right to left - 4096, 256, 16, 1

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

How can you convert between hex to decimal ?

A

Write the hex digits under each ones correct place value and then multiply the hex digit by the place value and add the products together to get the decimal number.

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

How do you convert from decimal straight to hex ?

A

Check what the maximum place holder value that the decimal number can be divided by to be greater than 1 and draw out the place holder table up to this number, divide the decimal number by the first place value and then take the remainder and put this in the other place holder.

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

How can you convert from binary to hex ?

A

If each hex digit equates to a nibble in binary split the binary into 4-bit chunks and work out the decimal and then subsequent hex value for each chunk and then put the hex digits back together.

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

How do you go form a hex value to a binary value ?

A

Convert the hex digit into decimal and then from decimal into the 4-bit chunk of binary code and then put the 4-bit chunks back together to give one long string.

28
Q

What are alphanumeric characters ?

A

The characters used to make up words and strings including uppercase and lowercase letters, digits and symbols.

29
Q

What are character sets ?

A

Collections of characters that a computer recognises from their binary representation (i.e ASCII)

30
Q

What do character sets contain ?

A

All the alphanumeric characters as well as special characters which do certain commands (i.e space or delete)

31
Q

How do computers actually use character sets ?

A

When a button on a keyboard is pressed it sends a binary signal to the computer telling it what key you pressed, and it then uses the character set to translate the binary code into a particular character.

32
Q

What is ASCII ?

A

Most commonly used character set, each ASCII character given a 7 bit binary code (and 1 extra 0 on the start to make a byte) meaing it can represent 128 characters.

33
Q

What is unicode ?

A

Another character set, that tries to cover every possible letter or symbol that could be written - having multiple bytes for each character, covering all major languages. The first 128 codes in unicode are the same as ASCII.

34
Q

How are images stored ?

A

As a series of pixels, the most common type of image used is a bitmap where the colour of each pixel is represented by a binary code.

35
Q

What determines the colour range for an image ?

A

The number of colours available in an image is related to the number of bits available for each pixel, 1-bit images have two colours, 2-bit images have 4, 3-bit images have 8 etc. (2^n where n is number of bits per pixel (bpp) is how many colours)

36
Q

What is colour depth ?

A

The number of bits per pixel, the wider the range of colours in an image the more bits it will take up.

37
Q

What colour depth do most devices use ?

A

A 24-bit colour depth - representing 16 777 216 colours which covers every colour the human eye can see (10 million)

38
Q

What is image resolution ?

A

The number of pixels in an image - given as width × height, so the higher the resolution the more pixels and the better the image.

39
Q

How can you calculate how many bits an image will take up ?

A

file size (bits) = image resolution × colour depth

40
Q

How is sound stored in computers ?

A

As digital sound.

41
Q

What are analogue signals ?

A

Pieces of continually changing data that need to be change into digital sound to be read and stored by computers - done using analogue to digital converters.

42
Q

What is sampling ?

A

The process of converting sound from analogue to digital.

43
Q

How actually is analogue data converted into digital ?

A

Taking samples from the continuous analogue wave at regular intervals, once the recording has been sampled it is plotted onto a bar graph that represents the analogue wave but isn’t continuous and loses a lot of the original data.

44
Q

How can you improve the sound quality of digital data ?

A

Take samples from the analogue data more regularly.

45
Q

What is sampling rate ?

A

How many samples taken in a second (measured in Hz - hertz or kHz) - common sample rate is 44 100 Hz.

46
Q

What does sample resolution mean ?

A

It’s the number of bits available for each sample taken.

47
Q

How can you find the bit rate of an audio file ?

A

Do the sample rate × sample resolution

48
Q

How can you calculate the size of an audio file ?

A

File size (bits) = sample rate (Hz) × sample resolution × length (s)

49
Q

What affect on audio quality would increasing the sample rate have ?

A

It will improve quality and the sound will more closely match the original recording, it would however increase file size.

50
Q

What would increasing sample resolution do ?

A

It would mean the digital file picks up quieter sounds even amongst loud sounds and would leave quality closer to the original recording, it would however increase file size.

51
Q

What is data compression ?

A

The process of making file sizes smaller while trying to make the compressed file as similar to the original as possible.

52
Q

What are the two types of compression ?

A

Lossy and lossless.

53
Q

How does lossy compression work ?

A

By permanently removing data from a file, limiting the number of bits needed by the file, reducing its size - types of files include MP3 (audio), AAC (audio) and JPEG (image)

54
Q

What is lossless compression ?

A

Process of temporarily removing data to store the file and then restoring it to its original state when opened - inludes FLAC (audio), TIFF (image) and PNG (image) files.

55
Q

What are the advantages of lossy compression ?

A

Greatly reduced file size, files take up less bandwidth so can be downloaded/streamed quicker, and are commonly used so is readable by lots of software.

56
Q

What disadvantages are there of using lossy compression ?

A

It loses data from the original file and so is worse quality - but this is normally unnoticeable, and it can’t be used on text or software files (which must retain all original information).

57
Q

What are the benefits of using lossless compression ?

A

There is no reduction in quality between the original and the new file - as data is removed temporarily, lossless files can be decompressed, and it can be used on text and software files.

58
Q

What is the drawback of using lossless compression ?

A

There’s only a slight reduction in file size compared to using lossy compression (a file compressed using lossless may take up 30MB and one using lossy takes up 5MB)

59
Q

What is RLE ?

A

Run Length Encoding - a form of lossless compression.

60
Q

How does RLE work ?

A

It looks for consecutive repeating data in a file - called a run, and instead of storing each piece of repeated data separately it stores the number of times the piece of data is repeated followed by one copy of the data.

61
Q

What is bad about using RLE ?

A

If the data doesn’t have many repeats within it then the file size won’t be significantly reduced.

62
Q

When can RLE be used ?

A

It can be used for bitmap images, and in text files.

63
Q

What is Huffman coding ?

A

A form of lossless compression that does so through using frequencies of data pieces in the file.

64
Q

How does Huffman coding work ?

A

It gives each data value a unique binary code - with more frequently occurring characters having shorter codes.

65
Q

What are the steps to complete a Huffman tree ?

A

Count the frequency of each data piece and put them in ascending order, each data piece+frequency represented by a node. Combine first two nodes making a new one where frequencies added together and put back in original list in order - repeating this until there’s only one node.

66
Q

How do you get the binary codes for the characters ?

A

On this Huffman ‘tree’ each left branch is a 0 and each right branch is a 1, and to get the Huffman codes follow the branch from the final node to the characters’s node and encode the character with the binary values you passed - put together the binary values for each data piece in the order they occur in the string to get the final Huffman encoded string.

67
Q

How is Huffman coding shorter than a normal string ?

A

Text encoded in ASCII uses one byte per character, whereas in Huffman coding the binary codes given to characters are mostly smaller than 8 bits.