1.4.1 Data Types Flashcards

1
Q

What is a bit?

A

Either a 1 or 0
We use bits to represent the two electronic states: on and off.

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

How many bits are in a byte?

A

8 bits in a byte

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

How many bits are in a nibble?

A

4 bits in a nibble

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

How many values can be represented with n bits?

A

2^n

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

How many bytes are in a kibibyte?

A

1024

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

What is the power of kibi?

A

2^10

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

What is the power of mebi?

A

2^20

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

What is the power of gibi?

A

2^30

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

What is the power of tebi?

A

2^40

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

What is the power of pebi?

A

2^50

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

What is the power of exbi?

A

2^60

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

What is the power of zebi?

A

2^70

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

What is the power of yobi?

A

2^80

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

What is a character set?

A

A collection of characters, each assigned a unique binary value

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

How many bits does ASCII use per character?

A

7

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

How many bits does extended ASCII use per character?

A

8

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

How many bits does UNICODE use to represent a character?

18
Q

What’s the difference between UNICODE and ASCII?

A

ASCII only represents english characters whereas UNICODE represents all symbols even from other languages

19
Q

What is a real/float?

A

Used to store decimal numbers and to store very large/small values

20
Q

What is a character/char?

A

A single letter, number or special characters typically represented in ASCII

21
Q

What is a string?

A

A collection of characters. Anything enclosed in quotation marks is a string

22
Q

What is boolean/bool?

A

A boolean variable can only take the value TRUE or FALSE

23
Q

What is an integer?

A

A whole number

24
Q

What is casting?

A

The process of changing one data type into another

25
What are the bases of denary, binary and hex?
Denary - 10 Binary - 2 Hex - 16
26
Why use hex over binary?
More likely to make mistakes when writing in binary than hex Easier to work with
27
How does hex represent numbers?
Uses 0-9 to represent 0-9 Uses letters A-F to represent 10-15 Each part is represented by a nibble ( 4 bits )
28
Convert 229 to hex
1110 0101 14 5 E5
29
Convert F3 to denary
1111 0011 243
30
How does sign and magintude work in binary?
The most signifcant bit represents whether the number is positive or negative 1 is negative 0 is positive
31
What are 2 problems with sign and magnitude?
Addition of numbers is trickier for the computer Reduced number of bits avaible for represent our number Max number that we can make with 8 bits is 127
32
What is two's complement?
A way of storing positive and negative numbers by the most significant bit taking the negative value of itself.
33
What are the 2 methods of writing in twos complement?
1 - write the positive version of the number, flip the bits and add one 2 - add the numbers, usually using the MSB as a negative version of itself ( for example -128 ), and keep adding positive numbers until its the correct number
34
What is a left shift?
All the bits are shifted to the left For every place value shifted, the value is doubled
35
What is a right shift?
All the bits are shifted to the right For every place value shifted, the value is halved.
36
Why are floating-point numbers normalised?
To ensure that they are as precise as possible in a given number of bits
37
How do you normalise a binary number? Example: 00101 000
Remove extra zeros from the front (only 1 is allowed) and buff the back of the mantissa. Decrease the exponent by 1 01010 111
38
How would you convert 1.75 to floating point binary?
Write out the fixed point: 01.11 Move the decimal point: 0.111 The mantissa: 01110 The exponent: 0001 All together: 011100001
39
What happens when you increase the size of the exponent?
Increases the size of the number that can stored
40
What happens when you increase the size of the mantissa?
Increases the precision of the number that can be stored