Data representation and data types Flashcards

1
Q

What is a bit?

A

A bit is a single digit that can be 1 or 0 (on or off)

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

What is a nibble?

A

A nibble is an arrangement of 4 bits, with 16 possible combinations.

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

What is a byte?

A

A byte is an arrangement of 8 bits, with 128 possible combinations.

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

What is a word in computing?

A

A word is the amount of data that a CPU can process within a certain amount of time. It can be 64 or 128 bits long.

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

How many bits are in a byte

A

8 bits

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

How many bits are in a nibble

A

4 bits

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

How many bytes are in a Kilobyte (KB)

A

1024 bytes

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

How many KB are in a megabyte (MB)?

A

1024 KB

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

How many MB are in a gigabyte (GB)?

A

1024 MB

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

How many GB are in a terabyte (TB)?

A

1024 GB

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

How many TB are in a petabyte (PB)?

A

1024 TB

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

What is the difference between Mb and MB?

A

Mb stands for megabits, while MB stands for megabytes. To convert Mb to MB, divide by 8.

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

What is a character data type?

A

A single letter, digit, or punctuation mark (e.g., ‘A’, ‘4’, ‘!’).

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

What is a string

A

A sequence of characters (e.g., “computer”, “science”).

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

What is an unsigned integer?

A

A whole number that is always positive (e.g., 42, 11, 1).

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

What is a signed integer?

A

A whole number that can be positive or negative (e.g., 12, -18, 0).

17
Q

What is a real number

A

A fractional or decimal number(e.g., 15.6, -12.25)

18
Q

What is a boolean

A

A data type that represents either true or false (1 or 0)

19
Q

How do computers represent characters

A

Each character is mapped to a binary number for standardized communication between systems.

20
Q

What is ASCII

A

A character encoding system that uses 8 buts to represent 255 characters, mainly in the English language

21
Q

What is Unicode

A

A character encoding system that supports multiple languages and symbols it currently uses 21 bits (3 bytes)

22
Q

What is the amin difference between ASCII and Unicode

A

ASCII can only represent 255 characters, while Unicode supports a vast range of characters from different languages.

23
Q

Why do computers use binary instead of decimal

A

Computers store data using 1s and 0s because they represent electrical on/off states

24
Q

What is the binary representation of the number 3

25
What is an advantage of binary
It is easy for computers to understand since it represents electrical signals (on/off)
26
What is a disadvantage of binary
It is difficult for humans to interpret without conversion
27
28
What is an advantage of hexadecimal
It can store larger data efficiently since it has more digits (0-9, A-F)
29
What is a disadvantage of hexadecimal?
It can be harder to understand and convert compared to binary or decimal
30
What is sign and magnitude in binary
A way to represent positive and negative numbers using the leftmost bit as the sign bit
31
What is two's complement?
A method to represent negative numbers in binary by inverting bits and adding 1
32
What are 2 components of a floating point number
The mantissa (significant digits) and the exponent (power of 10)
33
What is truncation?
removing extra bits beyond a certain point without rounding. Truncation Example 0.1011011 and truncate it to 4 bits after the decimal point. Original number: 0.1011011 Truncated to 4 bits: 0.1011 Truncation error: The removed bits (011) represent a small lost value. If converted to decimal: Original: 0.1011011 (≈ 0.7109375 in decimal) Truncated: 0.1011 (≈ 0.6875 in decimal) Error: 0.7109375 - 0.6875 = 0.0234375
34
What is rounding in binary?
Adjusting the last digit based on the next digit (round up if 1, down if 0) Rounding example Original number: 0.1011011 Looking at the 5th bit (which is 0) Since it’s less than 1, we round down Rounded result: 0.1011 (same as truncation in this case) If the 5th bit had been 1 (e.g., 0.1011111), we would round up to 0.1100 instead.
35
Which is usually more accurate: Truncation or rounding
Rounding, because it minimizes bias