Topic 2 - Data Flashcards

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

What is binary used for?

A

To represent data and program instructions.

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

How is data represented in a computer system?

A

As patterns of bits.

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

What is a nibble?

A

A group of four bits.

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

What is a byte?

A

A group of eight bits.

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

The formula for calculating how many unique binary patterns can be generated by n bits is 2^n, where n is the number of bits.

A

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

What is a denary number?

A

A decimal number.

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

What are the place values in a binary system?

A

128 64 32 16 8 4 2 1

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

What method is used to represent a signed number?

A

Two’s compliment.

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

In two’s compliment what makes a number negative?

A

If the most significant bit (MSB; the leftmost bit) is 1.

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

In two’s compliment what makes a number positive?

A

If the most significant bit (MSB; the leftmost bit) is 0.

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

Describe how two’s compliment works when converting a negative binary number to its positive binary equivalent.

A

1) Write it out
2) Flip all the bits
3) Add 1

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

Describe how to find a negative number using two’s compliment notation.

A

1) Write it out in binary
2) Flip all the bits
3) Add 1

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

How would you calculate a subtraction of denary numbers in binary?

A

1) Convert the first number to binary
2) Convert the negative number to binary using two’s compliment
2) Carry out the rules of addition

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

How does logical shift left work?

A
  1. Move each binary digit n positions left.
  2. Discard the leftmost n bits.
  3. Fill up the empty spaces on the right with 0’s.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How does a logic shift right work?

A
  1. Shift each binary digit n positions right.
  2. Discard the rightmost n bits.
  3. Fill up the empty spaces on the left with 0’s.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How is an arithmetic shift right different to a logic shift right?

A

The vacant spaces on the left are filled with the value of the original most significant bit.

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

What is an overflow?

A

When an operation produces a result that requires more bits to store it than are available in the computer.

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

How do you respond to an overflow?

A

A 9th bit is required. The programmer must make allowances for this to prevent serious errors or disasters.

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

What are the consequences of an overflow error?

A
  • the program may crash
  • the program may produce unreliable or incorrect results
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What is hexadecimal?

A

Hexadecimal numbers represent long binary numbers using fewer digits. Every eight digits of a binary number can be represented by two hexadecimal digits.

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

How do you convert binary to hexadecimal?

A
  1. Split the 8-bit byte into two 4-bit nibbles
  2. Convert the bits in each nibble into denary numbers using the place values
  3. Add these together to give the hexadecimal
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

How do you convert the hexadecimal to binary?

A
  1. Each hexadecimal digit is converted to denary
  2. Each denary number is converted into a nibble
  3. The nibbles are combined to give the binary number
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What are the three uses of hexadecimal?

A
  • To help humans cope with long strings of binary digits - they’re much shorter in hex.
  • When a computer malfunctions, error code numbers are usually given in hexadecimal.
  • Hexadecimal is also used to represent numerical values in assembly language.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What are the three uses of hexadecimal?

A
  • To help humans cope with long strings of binary digits - they’re much shorter in hex.
  • When a computer malfunctions, error code numbers are usually given in hexadecimal.
  • Hexadecimal is also used to represent numerical values in assembly language.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

What is ASCII code?

A

A 7-bit code there are 128 (2^7) code sequences representing English characters and control actions such as SPACE and SHIFT.

26
Q

How do computers represent text characters, numbers and symbols?

A

In binary as strings of 1’s and 0’s.

27
Q

What is a character set?

A

The list of binary codes that can be recognised by the computer hardware and software.

28
Q

In Python what does the function ord() do?

A

Returns the ASCII code (in denary) for a character.

code = ord(“c”) — returns 99

29
Q

In Python what does the function chr() do?

A

Returns the character for a denary code.

char = chr(100) — returns “d”

30
Q

How are images represented in a computer?

A

As strings of 1’s and 0’s.

31
Q

What is colour depth?

A

The number of bits used to encode the colour of each pixel.

32
Q

What makes an image more detailed?

A

The more bit’s there are to encode the colour.

33
Q

What is resolution?

A

The number of pixels per inch when the image is displayed.

34
Q

What are analogue recordings?

A

Sound recordings convert the changes in air pressure into voltage changes.

35
Q

What is the sample interval?

A

Samples of sound wave are taken at regular fixed intervals.

36
Q

Define sample rate.

A

The number of samples over a given time period.

37
Q

What does a high sample rate do?

A

Gives a more accurate reproduction of the sound’s analogue waveform.

38
Q

Define sample.

A

Transistors are either on or off, and cannot continuously reproduce analogue changes. Instead, digital recordings use snapshots of the sound at regular fixed intervals and then play them back one after the other.

39
Q

Equation for the size of an audio file.

A

file size (bits) = sample rate x bit depth x recording length (seconds)

40
Q

What can be represented with unsigned integers?

A

4 bits can represent the numbers 0 to 15 and 8 bits can represent the numbers 0 to 255.

41
Q

What can be represented with signed integers?

A

4 bits can represent the numbers -7 to 8 and 8 bits can represent the numbers -127 to 128.

42
Q

How many characters does the 7-bit ASCII character set give?

A

128 (2^7)

43
Q

Define bit depth.

A

The number of bits used to represent a single sample of audio.

44
Q

Define colour depth.

A

The number of bits used to represent the colour of each pixel in an image.

45
Q

1 byte = …

A

2^0 bytes

46
Q

1 kibibyte (KiB) = …

A

2^10 bytes = 1024 bytes

47
Q

1 mebibyte (MiB) = …

A

2^20 bytes = 1024 kibibytes

48
Q

1 gibibyte (GiB) = …

A

2^30 bytes = 1024 mebibytes

49
Q

1 tebibyte (TiB) = …

A

2^40 bytes = 1024 gibibytes

50
Q

How can the size of large files be reduced?

A

Using compression algorithms that repackage the data or remove some of it.

51
Q

What does lossless compression do?

A
  • reduces file size without deleting any data
  • nothing is lost
52
Q

What does lossy compression do?

A
  • reduces file size by deleting some data
  • the original can never be reconstructed - it has been irreversibly changed
53
Q

How does lossless compression compress?

A

Looks for redundancy where the same data is stored many times and groups data into one reference.

54
Q

How does lossy compression compress?

A
  • In image files, algorithms analyse the image and find areas where there are only slight differences. These are given the same value and the file can be rewritten using fewer bits.
  • In digital sound recordings very small variations in frequency, tone and volume are removed to reduce the file size as the human ear cannot detect these small differences.
55
Q

When is lossless used?

A
  • text files
  • graphic files with a low colour depth
56
Q

What is lossless bad at compressing?

A
  • audio files
  • 24-bit colour files
57
Q

When is lossy used?

A
  • image files
  • digital sound recordings
58
Q

What is lossy bad at compressing?

A
  • text files
  • executable software
59
Q

What does compression help with?

A

Smaller file sizes make file transfer more efficient and reduce the requirements for storage space.

60
Q

What are the advantages of file compression?

A
  • less internet bandwidth is used when files are downloaded/ uploaded
  • transfer time is faster
  • less storage space is needed
  • smaller files reduce congestion on the internet
  • audio and video files can be streamed