1.4 Data Representation and Data Types Flashcards

1
Q

What is a bit? (2)

A
  1. A single “1” or “0”
  2. Is the smallest unit of data.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a byte?

A

A sequence of 8 bits.

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

What is a word? (2)

A
  1. The number of bits that can be simultaneously processed or stored in a single register.
  2. Different for different computers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How many bits are there in a word?

A

It is usually 32 or 64 bit.

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

What is the binary number system?

A
  1. It stores data via an arrangement of 1 and 0.
  2. It is a base 2 system.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is hexadecimal? (2)

A
  1. A way of writing binary using letters and numbers.
  2. It is a base 16 system.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How can hexadecimal be used as shorthand?

A

The binary number can be split into groups containing 4 digits/bits and represented by a number.

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

What are the advantages of using
hexadecimal?

A

Fewer errors will occur as it is easy to read a large binary number.

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

What are character sets?

A

A list of characters alongside corresponding binary codes.

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

How do character sets work?

A

When a computer stores text, it stores a sequence of binary codes, and two computers that use the same character set can communicate with one another.

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

Give 2 character sets.

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

How does ASCII store characters?

A

It stores characters that can be found on standard UK keyboards using 7bits per character.

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

How does Unicode store characters?

A

It stores a huge range of characters from many languages, as well as emoticons and other symbols, using 16 bits per character.

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

Give an advantage for ASCII.

A

Very little storage space required per character.

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

Give a disadvantage for ASCII.

A

Limited to using western characters only.

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

Give 2 advantages for Unicode.

A
  1. Many more characters can be used.
  2. Possibility to store more in the future.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Give a disadvantage for Unicode.

A

Requires more than double the storage space per character of ASCII.

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

What is a primitive data type? (2)

A
  1. A primitive data type is a data type that cannot be broken down into smaller data types.
  2. A variables data type determines what can be stored in that variable.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What is a variable?

A

A named space in memory that can contain one piece of data of a specified data type.

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

State 5 data types.

A
  1. Boolean
  2. Character
  3. String
  4. Integer
  5. Real
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What is a Boolean?

A

Can only be True or False.

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

What are the storage requirements of a Boolean?

A

1 bit

23
Q

What is a Character?

A

Stores content of a single keystroke.

24
Q

What are the storage requirements of a
Character? (2)

A
  1. For ASCII : 7 bit
  2. For Unicode : 16 bit
25
Q

What is a String?

A

A sequence of characters.

26
Q

What are the storage requirements of a
string?

A

Number of characters in string, 7 (if ASCII) or 16 (if Unicode).

27
Q

What is an Integer?

A

Whole numbers including positives, negatives and zero.

28
Q

What are the storage requirements of an Integer?

A

Variable - longer it is the more bits needed.

29
Q

What is a Real?

A

Numbers that can contain fractions and decimal points.

30
Q

What are the storage requirements of a
Real?

A

Variable - More bits allow storage of larger numbers and more precise fractions.

31
Q

What is an arithmetic shift to the right of n places?

A

Equivalent of dividing by 2^n.

32
Q

What is the difference between an arithmetic shift and a logical shift?

A

An arithmetic shift maintains details with the sign bit. A logical shift does not.

33
Q

What are the two ways an integer
can be stored in fixed length?

A
  1. Sign and Magnitude
  2. Two’s Compliment
34
Q

What is sign and magnitude? (2)

A
  1. The first bit in the sequence is a sign bit and has no numerical value.
  2. 0 : positive, 1 : negative
35
Q

What does the placeholder for sign and magnitude look like?

A

(-) 64 32 16 8 4 2 1

36
Q

What is Two’s Compliment?

A

The left most bit is negative.

37
Q

What does the placeholder for Two’s Compliment look like?

A

-128 64 32 16 8 4 2 1

38
Q

What is a way to store an unfixed length?

A

Unsigned fixed points.

39
Q

What is the placeholder for an unsigned
fixed point with the point after 4 bits?

A

8 4 2 1 .5 .25 .125 .0625

40
Q

What is another way in which a computer stores numbers?

A

Floating point form

41
Q

What is floating point form? (2)

A
  1. It is the binary equivalent to standard form.
  2. It consists of a Mantissa and an Exponent (M x 2ᴱ).
42
Q

State 2 advantages of using integer form to store numbers.

A
  1. For small values, data stored in this format required less storage space.
  2. There is no overhead - no need to calculate the values before processing it.
43
Q

State 2 disadvantages of using integer form to store numbers.

A
  1. Fractions can not be stored.
  2. For an extremely large number (eg Trillion) an integer would require far more storage space than floating point.
44
Q

State 3 advantages of using floating point form to store numbers.

A
  1. Fractions can be stored.
  2. Extremely large numbers require fewer bits to store compared to integer form.
  3. Can store numbers completely precisely/ accurately
45
Q

State 2 disadvantages of using floating point form to store numbers.

A
  1. For small integer values (eg 32) more bits are used than would be in integer form
  2. There is an overhead – processor time is needed to calculate the value stored before it can be processed.
46
Q

State 2 ways to approximate numeric data.

A
  1. Truncation
  2. Rounding
47
Q

What does rounding do?

A

It takes a number to the nearest integer or (in binary) the nearest half, quarter, eighth.

48
Q

Give an example of rounding.

A

7.8 —-> 8

49
Q

What does truncation do?

A

It disregards values after a certain number of digits relative to the binary (or decimal) point.

50
Q

Give an example of truncation.

A

7.8 —-> 7

51
Q

Why is rounding generally more appropriate than truncation?

A

Rounding tends to give answers nearer to the original number.

52
Q

State 3 errors caused by rounding and truncation.

A
  1. A continued use in further calculation increases inaccuracy.
  2. A test for equality might fail if a minor difference is caused by rounding.
  3. In some applications a high accuracy is vital and rounding may reduce this accuracy.
53
Q

When does an underflow occur?

A

When a number is very close to zero to be stored by the computer.

54
Q

When does an overflow occur?

A

When a number is too large to be stored by a computer.