Topic 2: Data Flashcards

1
Q

Explain how computers use binary to represent data
(numbers, text, sound, graphics) and program instructions.

A
  • Computers use binary to represent data and program instructions.
  • Binary is a base-2 number system that uses two distinct digits, 0 and 1, to represent all possible values. This means that each bit (binary digit) can represent either a 0 or a 1.
  • Combining multiple bits together, computers can represent larger numbers, text, sound, and graphics. For example, 8 bits can represent a single character, such as a letter or number, while 32 bits can represent a single color.
  • Binary instructions are written in a language called ‘machine code’, which is a set of instructions that the computer can understand and execute.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is maximum and minimum number of states
that can be represented by a binary pattern of a given
length any given length?

A

The maximum number of states that can be represented by a binary pattern of a given length is 2^n, where n is the length of the binary pattern.

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

How do computers represent and manipulate
unsigned integers and two’s complement signed integers?

A

Unsigned integers are represented in binary form, with each bit representing a power of two. For example, the number 10 would be represented as 1010 in binary.

Two’s complement signed integers (negative numbers) are also represented in binary form, but with the most significant bit representing the sign of the number. For example, the number -10 would be represented as 1111 0110 in binary. To manipulate two’s complement signed integers, the computer first converts the number to its absolute value, then performs the desired operation, and finally applies the sign bit to the result.

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

Convert these denary integers to 8-bit binary:

0
255
-128
127

A

0 = 00000000
255 = 11111111
-128 = 10000000
127 = 01111111

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

Add the following two positive binary patterns, apply correct logical gate (and) then perform arithmetic binary shifts of +1

Positive Binary Pattern 1: 10101
Positive Binary Pattern 2: 11011

A

Example:

Positive Binary Pattern 1: 10101
Positive Binary Pattern 2: 11011

Adding the two binary patterns together:

10101
+11011
——
101000

Applying a logical shift to the result:

101000&raquo_space; 1

Result:

110100

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

What is overflow in relation to the
number of bits available to store a value? Can you give an example of this?

A

Overflow is when the number of bits available to store a value is not enough to represent the value. This can cause the value to wrap around to a negative number or an incorrect value.

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

Convert hexadecimal to binary and binary to hexadecimal give an example of both (Make up your own example)

A

Hexadecimal to Binary:

Example:
Hexadecimal: A3

Binary: 10100011

Binary to Hexadecimal:

Example:
Binary: 11010101

Hexadecimal: D5

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

How do computers encode characters using 7-bit
ASCII ?

A
  • ASCII is a character encoding standard that assigns a numerical value to each character on your keyboard.
  • Each character is represented by a 7-bit binary number, with the most significant bit (MSB) being the left-most bit and the least significant bit (LSB) being the right-most bit.

-The numerical values range from 0 to 127 and each character is assigned a unique numerical value. For example, the letter “A” is represented by the binary number 01000001, which is equal to the decimal number 65.

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

How are bitmap images are represented in binary
(pixels, resolution, colour depth)?

A
  • Bitmap images can be represented in binary by a series of pixels, each of which is assigned a numerical value that corresponds to a specific color.
  • The resolution of the image is determined by the number of pixels in the image, and the color depth is determined by the number of bits used to represent each pixel.

Example, a 24-bit image uses 8 bits to represent each of the red, green, and blue components of each pixel, allowing for up to 16.7 million colors.

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

Give two examples of how computers use hexadecimal numbers.

A
  1. Hexadecimal numbers are used to represent colors in HTML and CSS. For example, the hexadecimal code #FF0000 represents the color red.
  2. Hexadecimal numbers are also used to represent memory addresses in computers. For example, the hexadecimal address 0xFF00 represents the memory address of a specific byte in a computer’s memory.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Can analogue sound be represented in binary data?

A
  • Yes, analogue sound can be represented in binary data. The amplitude, sample rate, bit depth, and sample interval of the sound can all be represented in binary data. (1)
  • The amplitude of the sound is represented by the amplitude of the digital signal, the sample rate is represented by the number of samples taken per second, the bit depth is represented by the number of bits used to represent each sample, and the sample interval is represented by the time between each sample.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are some limitations of binary representation?

A
  1. Limited precision: Binary representation of data is limited by the number of available bits, which means that the precision of the data is limited.
  2. Limited range: The range of values that can be represented in binary is limited by the number of available bits.
  3. Overflow: If the number of bits available is not enough to represent the data, then an overflow can occur, resulting in incorrect data.
  4. Inaccurate representation: Binary representation of data can be inaccurate due to rounding errors.
  5. Difficulty of interpretation: Binary data can be difficult to interpret, as it is not in a human-readable format.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

In Binary what is a bit, nibble, byte, kilobyte, megabyte, gigabyte?

A

They are types of data storage, measured in binary multiples (bit, nibble, byte, kilobyte, magabyte, gigabyte,
terabyte) this is used for
file sizes and data capacity requirements.

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

What is data compression? Give two methods for compressing data.

A

Data compression is the process of reducing the size of a file or data set by encoding information using fewer bits than the original representation.

There are two methods for compressing data:

  • Lossless compression involves encoding data in such a way that the original data can be reconstructed exactly from the compressed version.
  • Lossy compression involves discarding some of the data in order to reduce the size of the file.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly