Data Representation Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What are ordinal numbers?

A

Numbers used for explaining the position of a number in a well ordered set

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

What numbers are used for counting and measurement?

A
  • Natural numbers for counting
  • Real numbers for measurement
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a bit? What is a byte?

A

The most fundamental unit of information. 8 bits make up a byte

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

How can you tell how many numbers can be represented by a binary number? What is the maximum value?

A
  • 2^n where n is the number of bits used
  • 2^n - 1 is the maximum value
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Binary prefixes

A

Kibi - 2^10
Mebi - 2^20
Gibi - 2^30
Tebi - 2^40

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

Decimal prefixes

A

kilo - 10^3
mega - 10^6
giga - 10^9
tera - 10^12

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

Why is hexadecimal used?

A
  • Easy to convert from binary
  • Easily read by humans
  • More concise
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Where is hexadecimal used?

A

memory addresses, error message codes, HTML colour codes

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

What is pure binary?

A

Unsigned binary

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

How does binary shift work?

A

Shift to right is double, shift to left is half

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

Describe signed binary numbers.

A
  • Sign is represented through MSB (most significant bit)
  • 1 in sign bit represents a negative number, 0 is positive
  • Range is same as unsigned binary
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How to convert from binary to hexadecimal?

A

Consider each nibble and convert to hexadecimal equivalent 0 to F

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

How to use two’s complement to find negative binary numbers? How is a carry bit used?

A
  • write number out in binary
  • if number is positive, add a sign bit of 0 and leave it
  • if negative, change to 1’s complement (switch all 0’s and 1’s) AND add 1 (ignoring carry bit at the sign bit)
  • carry bit is used for checking overflow
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is an overflow error? What is an underflow error?

A
  • Overflow: a number is too large to represent within the number or bits available
  • Underflow: a number is too small e.g. 0.000001 to be represented in number of bits available
  • store overflow bits elsewhere to prevent error
  • set flag bit to indicate error
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How to multiply binary numbers? How to subtract binary numbers?

A

Multiplication:
- convert to 2^n and perform n shifts
- do long multiplication
Subtraction:
- convert to two’s complement
- add together

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

How do fixed point binary numbers work?

A
  • there is an imaginary radix point which separates the fractional and integer parts
  • it works same as positive, e.g. 1/2, 1/4, 1/8
  • more bits to the right of radix means more range
  • more bits to left of radix means more precision
17
Q

How do floating point binary numbers work?

A
  • 2 parts, mantissa and exponent
  • both have sign bit and then numbers to represent value
  • mantissa by default has radix point after sign bit
  • exponent tells how much we do binary shift by
18
Q

What is the mantissa?

A

The mantissa represents the significant digits of the number.

19
Q

What is the exponent?

A

The exponent represents the power of 2 by which to multiply the mantissa.

20
Q

What is the advantage of floating point binary as compared to fixed point binary?

A

Floating point binary provides a larger range for large numbers and a greater accuracy for small numbers using the same number of bits

21
Q

What is normalisation and why do we use it?

A

Normalisation is the process of maximising the precision of values that are represented in a floating point number for a given number of bits. This minimises rounding errors and increases precision.
Leading 0’s are wasteful and decrease accuracy for positives and 1’s do the same for negatives.

22
Q

What are the advantages of normalisation?

A
  • maximum accuracy
  • reduces rounding errors
  • only one representation of each number
23
Q

What is absolute and relative error?

A

Absolute: difference between number and approximate value of floating point binary.
Relative: percentage error (absolute/true x 100)

24
Q

How to do bitwise manipulation with AND, OR and XOR?

A

Compare the binary with the given mask and apply the operation for each bit.
- for AND, 2 same bits output 1 or else 0
- for OR, if either bit is 1 output 1
- for XOR, output 1 if one of the bits is 1 if both or none then 0

25
Q

What is a character set?

A

the set of all the characters that a computer can represent
it is a mapping of integers to the character that it represents
ASCII has 7 bits so 128 in the character set

26
Q

What is a character code?

A

A UNIQUE integer representation of a character that is interpreted by a computer

27
Q

What characters can be represented by ASCII?

A

Printable characters:
- upper case English characters
- lower case English characters
- numeric digits
- all punctuation symbols
Non-printable characters:
- new line
- end of file
- end of text
- end of transmission

28
Q

How to convert from lower and upper case?

A

Add 32 to go from upper to lower
all caps start with 10
all lower start with 11

29
Q

What are the limitations of ASCII?

A
  • only 128 characters
  • not useful for different languages
30
Q

Why is Unicode used?

A
  • variable between 8 and 32 bits
  • allows more characters including emojis, variable length means not many wasted bits
  • backwards compatible with ASCII
  • UTF-8 allows for the variable length as very wasteful to use all 32 bits
31
Q

Why is it important to cast?

A
  • ‘1’ takes 7 bits to represent
  • 1 takes 1 bit to represent
  • cannot operate on chars
32
Q

Why is error checking important?

A
  • checks for corruption of data to ensure that data is corrupt
33
Q

How do parity bits work?

A
  • the sender adds a parity bit to start or end of data
  • set parity bit as 1 or 0 depending on number of 1’s in data and odd or even parity
  • the receiver confirms that there is a matching even or odd, confident it isn’t corrupted
  • if it isn’t matching, the receiver can ask for the data to be resent
34
Q

What are the positives and negatives of parity?

A

Positives:
- simple to use
- use spare bit in ASCII
- very little overhead
Negatives
- even number of flipped bits cannot be detected
- don’t know where corruption has occurred

35
Q

How does majority voting work?

A
  • the sender sends 3 copies of each bit
  • the receiver checks groups of 3 bits, the most popular result among the 3 and uses that as the outcome
  • this is more effective at error checking than parity bits
  • you can locate where corruption has occurred
  • however, takes 3x more data which causes problems for large files
36
Q

How do check digits and checksums work? What does a good checksum look like?

A
  • an operation is done on the data to provide the check digit or checksum
  • the sender tells the receiver what operation it is and if result doesn’t match it can be corrupt
  • checksum is just multiple digits
  • a good checksum would produce a largely different result for even a small change in the data to make it clear that there is corruption