midterm 1 - diff file types Flashcards

lect 7

1
Q

How does binary store numbers vs text file?

A

text file –> each digit is stored as indiv ascii char –> 1 byte per char

binary –> digit is stored as corresponding binary

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

pro/con of binary number storage over txt files?

A

pros of binary storage: uses as little bits per number because it doesnt use 1 whole byte per digit

cons of binary storage: more complicated method of differentiating separate number values (text file can use an ascii char to separate them)

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

how does a binary file know how to differentiate separate numbers

A

binary file sets max # of bits used per number value –> therefore every X bits, the system knows to read as start of new number

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

binary file number limits explained

A

since binary files allocate x bits per value –> sets max value that can be stroed

typical limit is 32 bits per #

sci notation representation may be used for larger values –> but introduces limit precision

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

example of binary number limits and their impact on systems

A

32 bit systems –> max of 32bits of unique usable values

2^32 bits of ram = 4gb

therefore 32bit systems can only use up to 4 gb of ram

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

how is txt file encoded and interpreted

A

NO HEADER for file identification

all code used is for a character

no standard txt encoding exists –> usually UTF8 but variations exist –> leads to txt files being incorrectly read depending on program limitations

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

data compression - broad definition

A

reducing the number of bits required to store encoded information –> reducing overall file byte size

when uncompressed –> encoded data is reconstructed to remake the original file

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

types of data compression

A

lossless - the original file is recinstructed with the exact same bits sequence

lossy - reconstructed bit sequence has mismatches –> causes data encoding errors. usually associated with multimedia files being transferred –> errors manifest as aliasing errors and artifacts

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

list the methods of compression encoding (6)

A

DP - SQRT

dictionary encode
predictive encode
symbol freq
quantization + modelling human perception
run length encode
transformations

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

symbol frequency compression

A

aka variable length coding

use algorithm to determine optimal bit pattern per symbol based on how frequently each symbol appears

more frequent = less bits –> compression

where a symbol = characters, values, etc

eg Huffman code

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

run length encoding compression

A

used for data that is repeated several times
(eg sampled data that doesn’t change often) –> temperature every minute

encodes the data point –> paired with a value of X repetitions

therefore compresses repeat sequences

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

dictionary encoding compression

A

substitute patterns with shorter symbol codes

analogous to saying “let X = (equation)”

a portion of the compressed file is required to provide meaning of these shorter symbol codes so that decompression software knows what the original code meant

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

predictive compression

A

uses current data to predict next data point –> calculate diff btw predicted and actual data pts

compression by only encoding failed predictions –> “predict the next data pt, but know it is not X”

OR

encode difference btw predict vs actual (decompress by predicting next value then adding back the difference)

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

transformation encoding compression

A

use math algorithm to transform raw data into other formats which are then more easily compressed

decompress the file –> transform BACK into original data format

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

quantization

A

used in multimedia –> decrease bit depth/resolution/hz

reduce quality to compress the file

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