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?

A

16

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
Q

What are the bases of denary, binary and hex?

A

Denary - 10
Binary - 2
Hex - 16

26
Q

Why use hex over binary?

A

More likely to make mistakes when writing in binary than hex
Easier to work with

27
Q

How does hex represent numbers?

A

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
Q

Convert 229 to hex

A

1110 0101
14 5
E5

29
Q

Convert F3 to denary

A

1111 0011
243

30
Q

How does sign and magintude work in binary?

A

The most signifcant bit represents whether the number is positive or negative
1 is negative
0 is positive

31
Q

What are 2 problems with sign and magnitude?

A

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
Q

What is two’s complement?

A

A way of storing positive and negative numbers by the most significant bit taking the negative value of itself.

33
Q

What are the 2 methods of writing in twos complement?

A

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
Q

What is a left shift?

A

All the bits are shifted to the left
For every place value shifted, the value is doubled

35
Q

What is a right shift?

A

All the bits are shifted to the right
For every place value shifted, the value is halved.

36
Q

Why are floating-point numbers normalised?

A

To ensure that they are as precise as possible in a given number of bits

37
Q

How do you normalise a binary number?
Example:
00101 000

A

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
Q

How would you convert 1.75 to floating point binary?

A

Write out the fixed point: 01.11
Move the decimal point: 0.111
The mantissa: 01110
The exponent: 0001
All together: 011100001

39
Q

What happens when you increase the size of the exponent?

A

Increases the size of the number that can stored

40
Q

What happens when you increase the size of the mantissa?

A

Increases the precision of the number that can be stored