Data representation Flashcards

1
Q

What are logic gates?

A

Special circuits built into computer systems, they receive binary information and apply a Boolean operation, then output a result.

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

What does a not gate do?

A
  • Outputs the opposite of the input,

- It looks like a triangle with a circle on the end.

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

What does an and gate do?

A
  • Needs both inputs to be true in order for the output to be true, otherwise the output is false,
  • Looks like a letter ‘D’
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does an or gate do?

A
  • Needs at least one of the inputs to be true in order for the output to be true,
  • Looks like a rocket ship/ sideways shield.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a truth table?

A

A table that shows the individual inputs and outputs of each logic gate in a logic circuit.

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

How do you figure out how many rows are needed in a logic table?

A

2^n

‘n’ being the number of inputs

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

What are the different units of data and their sizes?

A
bit = 1 binary digit (1 or 0)
nibble = 4 bits
byte = 8 bits/ 2 nibble
Kilobytes = 1,000 bytes/ 8,000 bits
Megabytes = 1,000 kilobytes/ 8 mil bits
Gigabytes = 1,000 Megabytes/ 8 bil bits
Terabytes = 1,000 Gigabytes/ 8 tril bits
Petabytes = 1,000 Terabytes/ 8 quadril bits
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How do you convert bits to to bytes?

A

Divide by 8

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

What is ‘base 10’ also known as?

A

Denary/ decimal

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

What is ‘Base 2’ also known as?

A

Binary

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

What is ‘Base 8’ also known as?

A

Octal

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

What is ‘Base 16’ also known as?

A

Hexadecimal

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

What is the formula for number of possible binary combinations?

A

(2^n)
Where ‘n’ is number of bits,
- So in 8 bit binary, there are 256 combinations,
- You could also add up all the denary numbers in the columns.

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

How do you convert binary into denary?

A
  • Put the binary values in an 8 bit table, one digit each column,
  • The furthest right column represents the denary number 1,
  • The next column (moving left) is doubled, so the second column is the denary number 2,
  • Then add all the digits up that are represented by a binary 1.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How do you convert denary to binary?

A
  • Draw an 8 bit table,
  • Move along the column (left to right) subtracting the denary number in each column from your running total f it gives a positive number,
  • Put a 1 where the column gives a positive number and a 0 in the rest.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How do you add binary?

A
  • Either convert to denary and add then convert back to binary.
  • Or:
    1+1 = 10
    1+0 = 1
    1+1+1 = 11
    When two 1s add together, it makes a 0 and carries a 1 over to the next columns.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is a left shift?

A
  • Where the binary code digits all move along to the left by the specified shift,
  • 0s will place hold on the right side,
  • This multiplies the entire number by 2^n
    ‘n’ being the number of shifts
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What is a right shift?

A
  • Where the binary code digits all move along to the right by the specified shift,
  • 0s will place hold on the left side,
  • This divides the entire number by 2^n
    ‘n’ being the number of shifts
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

How do you convert Binary to Hex?

A
  • Draw 2 binary tables of 4 columns (8,4,2,1)
  • Split the binary code in two and fill the columns,
  • Then work out the denary values of the 2 separate 4 bit binary codes ,
  • If the denary value is over 10 then replace them with:
    10 = A
    11 = B
    12 = C
    13 = D
    14 = E
    15 = F
  • The put the two values next to each other (e.g. f4 is hex for 11110100)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

How do you convert hex to denary?

A
  • Draw a table with 2 columns (16,1) it is different because it is a table for base 16 not base 2, so each column is multiplied by 16 instead of 2,
  • Put one hex value in each column,
  • Multiply the first hex value by 16, and the second by 1,
  • Then add these two numbers together (e.g. 87 is 135 in denary).
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

How do you convert denary to hex?

A
  • Denary > binary > hex
  • Or divide the value by 16 and hold onto the remainder,
  • Put the value in the first column of the hex table (if it is over 10 then it has t be changed to A-F respectively),
  • Then put the remainder in the second column (again convert if necessary)
  • Then put the two hex values together (e.g. 106 is 6A in Hex)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Why do we change characters into binary?

A

Computers cannot process characters, they identify characters by their binary representation.

23
Q

What is a character set?

A

Collections of characters that a computer recognises from their binary representation.

24
Q

What are the 2 main character sets?

A
  • ASCII (7 bits)

- Unicode (16 bits)

25
Q

What effect does bit length have on character sets?

A

An increased bit length also increases the number of possible characters in the character set, as every bit will double the number of binary combinations.

26
Q

How are bitmap images stored?

A
  • On a pixel grid, every colour has its own binary value and each pixel has a colour.
  • So an image is just a long string of binary values, representing each pixel.
27
Q

What is colour depth?

A
  • The number of bits used in an image, it controls the number of colours in an image,
  • 2^n is the number of colours, where n is colour depth,
  • A higher colour depth means a greater range in colours.
28
Q

What colour depth do most images use?

A
  • 24 bit,

- 8 bits per red, green and blue

29
Q

What is image resolution?

A

The number of pixels in an image, can be found from the area of the image in pixels.

30
Q

How do you calculate the file size of an image?

A

File size (bits) = image resolution (bit) x colour depth (biit)

31
Q

What is the correlation between image quality and file size?

A

As image quality increases so does file size because more bits need to be stored.

32
Q

How is analogue sound converted into digital?

A
  • Analogue sound is inputted through a microphone,
  • Then samples are used, these are points of data on the analogue sound wave that occur in regular intervals,
  • A star case is made using these samples, this is the analogue wave,
  • The data is no longer continuous but now discrete, there is a lot of lost data in the new digital wave.
  • The digital wave is then stored as binary in a file.
33
Q

What is analogue sound?

A

A continuous wave of raw audio.

34
Q

What is digital sound?

A

A binary representation of analogue sound that is produced by sampling the analogue sound and converting it into binary for the computer to be able to process.
It is discrete data.

35
Q

How do you improve the sound quality of a digital sound wave?

A
  • Increased sample rate/ frequency,
  • Greater sample resolution (it allows more bits to be available per sample so more data can be stored and quieter background sounds can be picked up),
  • Both of these lose less data and sounds more like the original.
36
Q

How do you calculate the file size of a sound file?

A

Files size (bits) = sample rate(Hz) x sample resolution (bits) x length (sec)

37
Q

What is compression?

A

Reducing the size of a file whilst trying to keep it as true to its original as possible.

38
Q

Why do we compress files?

A
  • Take up less storage on devices,
  • Streaming and downloading files from the internet is quicker with smaller files,
  • It allows web pages to load quickly in browsers,
  • Allows files to be emailed, as most email services have a file size limit.
39
Q

What are the two file compression types?

A
  • Lossy,

- Lossless

40
Q

What are the advantages of using Lossy compression?

A
  • Greatly reduces files size,
  • Take up less bandwidth so streaming and downloading is easier,
  • Lots of software can read lossy compressed files.
41
Q

What are the disadvantages of Lossy compression?

A
  • Permanently loses data from the original file so the file cannot be uncompressed to its original form,
  • Cannot be used on text/ software files as it removes data,
  • Worse quality than the original file, but usually unnoticeable.
42
Q

What are examples of lossy compression file types?

A
  • MP3
  • AAC
  • JPEG
43
Q

What are the advantages of using lossless compression?

A
  • Data is only removed temporarily so their is no reduction in quality,
  • File can be decompressed to its original form,
  • Can be used on text and software files.
44
Q

What are the disadvantages of using lossless compression?

A
  • Only a slight reduction in file size, so still takes up a lot of space.
45
Q

What are exmplaes of lossless compression file types?

A
  • FLAC
  • TIFF
  • PNG
46
Q

What are the 2 types of lossless compression?

A
  • Run length encoding (RLE)

- Huffman coding

47
Q

How does RLE work?

A

It looks for consecutive repeated data (called a run), it stores this character once, with the number of repetitions beside it. This stores what could be a lot of data in one place.

48
Q

How is RLE coding written?

A

(number of repetitions, character)

e.g. (7, W)

49
Q

Is RLE coding always an effective compression?

A

No, if there are not many runs, the compression is not very effective.

50
Q

Why does the most frequent character have a shorter binary code than others in Huffman code compression?

A

Because it is most used so must be stored the most amount of times, and bits required for each character = frequency x number of bits per character.

51
Q

Why is Huffman coding used?

A

IN order to compress text files.

52
Q

How do you calculate the number of bits needed for a Huffman compressed file?

A

File size = (frequency*code length)

Add them all up after to get bits required for the whole code instead of just one character.

53
Q

What happens when you have an overflow over 8 bits after a shift?

A

Get rid of the overflow.

54
Q

How much does a data pair of RLE store?

A

2 bytes.