4.5 Fundamentals of data representation Flashcards

(89 cards)

1
Q

What are natural numbers

A

whole numbers including zero

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

what are ordinal numbers

A

they are integers which describe the numerical position of an object in relation to others eg 1st

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

what is a bit

A

it is a fundamental binary digit of either 0 or 1

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

how many values can be represented with n bits and whats the max value

A

2^n different values , 2^n - 1 is the max value

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

how to multiply two unsigned binary

A

write out the first number, and then write out the second number under each occurrence of a 1 in the first number so the least significant bit is aligned, then perform binary addition excluding the first number

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

how does two’s complement work to represent negative numbers too

A

the most significant bit is given as a negative place value

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

how to subtract numbers in binary

A

convert values to twos complement with the second number being the negative value and then add the numbers

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

what is the range when using twos complement and n bits

A

from - 2^(n-1) to 2^(n-1) - 1

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

what are the two parts of a floating point binary

A

the first part is the mantissa and the second part is the exponent

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

why both fixed point and floating point representation of decimal numbers may be inaccurate

A

for a real number to be represented by the binary number system it must be capable of being represented by a binary fraction in the given number of bits

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

how to calculate the absolute error of numerical data

A

absolute error is the actual amount by which a value is inaccurate
given value - actual value

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

how to calculate the relative error of numerical data

A

relative error is a measure of uncertainty compared to the actual value
absolute error / actual value

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

compare absolute and relative errors for large and small magnitude numbers

A

an absolute error will have different relative errors depending on the magnitude of the actual value as a big value will have a small relative error whereas a small value will have a big relative error

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

what does a large mantissa and small exponent mean for the range and precision

A

small range, good precision

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

what does a small mantissa and large exponent mean for the range and precision

A

large range, little precision

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

what does a placement of the binary point to the left in fixed point mean for the range and precision

A

small range, good precision

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

what does a placement of the binary point to the right in fixed point mean for the range and precision

A

large range, little precision

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

advantage of floating point over fixed point

A

a much wider range of numbers can be produced with the same number
of bits as the fixed point system

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

advantage of fixed point over floating point

A

The values are handled in the same way as decimal values the processing is faster as there is no processing required to move the
binary point.
The absolute error will always be the same, whereas with floating point
numbers the absolute error could vary
It is suited to applications where speed is more important that precision

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

What is the purpose of normalisation

A

ensures that numbers are
represented as precise as possible in relation to how many bits are
being used and that there is only one
representation of a number possible

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

how to normalise numbers

A

a normalised positive
floating point number must start 0.1 and a normalised negative floating
point number must start 1.0 - then adjust the exponent with the digits shifted

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

when does underflow occur

A

when the number is too small to
be represented with the number of bits allocated

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

when does overflow occur

A

when the number is too large to
be represented with the number of bits allocated

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

consequences of underflow and overflow errors

A

It could generate erroneous results or even cause the program
to crash

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
how to deal with underflow and overflow errors
use a flag to indicate where an overflow or underflow has occurred and to ‘carry’ the additional bits
26
what is a checksum in error checking
adding a value determined by the data itself so the same algorithm is used on the data to check if the data has an error - if the two don't match the sender must re-transmit data
27
what is a check digit in error checking
a type of checksum in which only a single digit is added to the transmitted data - reduces which algorithms can be used therefore reduces variety of errors which can be detected
28
what are bit patterns used to represent
numbers, graphics, sounds
29
what are ADCs used with
analogue sensors
30
what is the most common use for a DAC
convert digital audio signal to analogue signal
31
how to error check with parity bits
in even parity the value of the MSB is chosen so the total number of 1s is even, in odd parity the value of the MSB is chosen so the total number of 1s is odd, When the data is received the number of 1s is counted if the number of 1s matches the type of parity set then the value is viewed as correct otherwise the value is viewed as incorrect and the computer will request the sender to retransmit the data
32
what is the issue with parity bits
if an even number of bits are changed the error is not detected
33
What is the difference between analog and digital data?
Analogue data is continuous whereas digital data is discrete, so it can only take particular values
34
What is the difference between analog and digital signals
Analogue signals are natural sound waves so they take any value and change as frequently as required. But digital signals must take one of the specified range of values and can only change at specific intervals.
35
What is a real number
Real numbers are the set of all possible real world quantities
36
What is a rational number
A rational number are numbers which can be written as fraction where the numerator and denominator are integers
37
Why are all integers rational numbers
All integers can be written as a fraction over 1
38
Why do errors occur
They arise from interference on a network. Vast amounts of 1s and 0s are transmitted along cabling. Errors occur due to electrical noise, so the end result is some bits get corrupted
39
What are the four methods to error check
parity bits, majority voting, check digits, and checksums.
40
Explain why Caesar Cipher messages can be easily cracked whereas Vernam ciphers are considered secure
in caeser ciphers each plain text letter is always converted to the same cipher text letter so since frequencies of usage of letters in English is well known can be easily cracked - And with shift ciphers only need to map one letter to correctly deduce mapping for all letters. In a vernam cipher, the cipher text contains no useful information about plaintext as mapping is different for each letter position so too many possible keys to use brute force.
41
Describe error checking using majority voting
This works by transmitting bits multiple times, if the bits which are supposed to be the same are different, then the bit which occurs most frequently is assumed to be correct.
42
Disadvantages of majority voting
Volume of data transmitted is increased, and two consecutive errors will still output the wrong output
43
What is one advantage of majority voting over parity bit
Majority voting can correct as well as identify errors due the majority of bits being taken as the correct value.
44
What is a DAC, and how does it work
It stands for digital to analog converter. It is a device that reads bit patterns and outputs and alternating electrical current, which is then played on a speaker
45
Why do programmers prefer to write numbers in hexadecimal instead of binary
It is easier for people to read, understand, and remember. It can be displayed in fewer digits. It is more compact when displayed. and less likely to make errors while writing.
46
What is the difference between a kibibyte and a kilobyte
A kibibyte is 2^10 bytes. Whereas a kilobyte is 10^3 bytes.
47
What is meant by a character code
A character code uses a unique number to represent different characters
48
What is encryption
It converts a message into a form that is not understandable without a specific key to decrypt it
49
Describe the process of ADC recording sound
ADC takes samples of the analogue signals at regular intervals. These samples are quantised by approximating amplitude of each sample to an integer value. Each sample is then assigned a binary value.
50
Explain what a pixel is
A picture element
51
Why was Unicode introduced
ASCII can only represent 128 values, so there are no more unique values to represent different character sets for different languages. Unicode has at least 16 bits long, which enables representation of a greater range of characters. this means more languages can be represented and an improved portability of documents
52
Are the disadvantages of Unicode
It now requires twice as much space to represent each character compared to ASCII
53
how are bitmaps represented
an image is broken down into pixels each of which has a binary value assigned to it
54
in a bitmap, what is the resolution
number of pixels per inch
55
in a bitmap, what is the colour depth
the number of bits stored for each pixel
56
in a bitmap, what is the size in pixels
width of image in pixels x height of image in pixels
57
how to calculate storage requirements for bitmapped images
storage requirements = size in pixels x colour depth
58
what is typical metadata
width, height, colour depth, time and date
59
how do vectors graphics represent images
the properties of each geometric object in the vector graphic image are stored as a list
60
what are typical properties of a vector object
fill colour, fill style and dimensions
61
advantages of vector graphics
use less storage space as information is stored for each shape rather than pixel, can also be scaled without losing quality
62
disadvantages of vector graphics
can't be used for photographs
63
advantages of bitmap images
can be used for photographs
64
disadvantages of bitmap images
enlarging image results in blurry or pixelated images, uses more storage space
65
uses for bitmap and vector images
bitmaps - photos vectors - simple images that use shapes like company logos
66
how do computers represent sound
as a sequence of samples each taking a discrete digital value
67
what is sampling rate and the units
number of samples per second measured in hertz
68
what is the sample resolution
the number of bits allocated to each sample
69
what does a higher sample resolution cause
a greater audio quality but increased file size
70
how is the size of a sound sample calculated
multiplying together the duration of the sample in seconds with the sampling rate in hertz and the sample resolution
71
what is nyquist theorem
states that the sampling rate of a digital audio file must be at least twice the frequency of the sound - if the sampling rate is below this then sound may not be accurately represented
72
what is a MIDI
musical instrument digital interface - used with electronic musical instruments which can be connected to computers
73
how does a MIDI work
it stores sound as a series of event messages - events are series of instructions that could be used to recreate a piece of music
74
what information does event messages contain
duration of note, instrument used, volume of note, if note should be sustained
75
what are the advantages of using a MIDI
allows easy manipulation of music without loss of quality - instruments can be changed, notes can be transposed and duration of notes can be altered - files are often smaller in size than sampled audio files
76
what are disadvantages of using MIDI
can't be used to record speech and has less realistic sound than sampled recordings
77
why are files compressed
in order to reduce their size - smaller files can be transferred faster between storage devices or over the internet
78
what is lossy compression
some information is lost to reduce the file size such as reducing resolution of image or lowering sample resolution
79
what is lossless compression
no loss of information so size can be decreased without losing quality
80
what are the two methods of lossless compression
run length encoding and dictionary-based methods
81
how is run length encoding used to reduce file size
RLE removes repeated information and replaces it with one occurrence of the repeated information followed by the number of times it is to be repeated
82
how is dictionary based methods used to reduce file size
a dictionary containing containing repeated data is appended to the file
83
when is lossless compression most effective
on files with lots of repeated data
84
advantages and disadvantages of lossy compression
extent to which file size can be reduced is not limited but some information is lost and the quality of file is reduced
85
advantages and disadvantages of lossless compression
no loss of information or loss of quality but there is a limit to how much a file can be compressed
86
how to apply a vernam cipher
aligning characters of the plaintext and the key, convert each character to binary, apply a logical xor operation on the two bits aligned, convert result back to a character
87
what does a vernam cipher having a one-time pad mean
that each key is only ever used once
88
properties of the vernam cipher key
random and as long as the plaintext to be encrypted
89
what are ciphers with computational security and why is the vernam cipher not one
these ciphers are theoretically crackable with enough ciphertext and time but vernam ciphers are the only cipher mathematically proven to be completely secure