SLR 13 Flashcards

Data Types

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

What are different data types used for?

A

Different data types takes up different amounts of memory,, so the correct data types must be used to optimise program performance

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

What is an integer?

A

A whole number

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

What is a Real/Float?

A

Any non-integer number

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

What is a Boolean?

A

True or False

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

What is a character?

A

Represents any alphanumerical symbols

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

What is a string?

A

Represents a collection of characters

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

What is a primitive data type?

A

Any basic data type provided by a language as a foundational building block

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

What does casting mean?

A

Changing a data type into another

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

How is data represented in RAM

A

Through 0s and 1s

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

How is data stored in a hard disk?

A

Through magnetism. 1 represents South and 0 represents North

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

How is data stored in optical media?

A

On a disk which is read using a laser

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

How is data stored in an SSD?

A

Uses electricity and electrons. 0s and 1s represent if electrons are trapped or not

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

What is Base 2?

A

Binary

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

What is base 10?

A

Denary

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

What is base 16?

A

Hexadecimal

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

What do positive numbers start with in sign and magnitude?

A

0

16
Q

What do negative numbers start with in sign and magnitude?

A

1

17
Q

How does Sign and Magnitude work?

A

The last number in a binary sequence (usually 128) is replaced by a -/+ to make a number a positive or a negative

18
Q

How does Hexadecimal work?

A

10 = A
11 = B
12 = C
etc….

19
Q

What is hex used for in CS?

A

To turn larger digits into smaller and simpler ones to save space and to make the numbers MUCH easier to read

20
Q

What is floating binary point?

A

Storing numbers using a fractional component such as 6.5 to extend the number line from left to right

21
Q

How can floating binary point numbers be made more accurate?

A

Moving the binary point up and down the number line

22
Q

What are the benefits of floating binary points?

A

With less fractions larger numbers can be stored but at the cost of reduced accuracy

With more fractions numbers can be stored with more precision with a reduced size

23
Q

What is the Mantissa?

A

The number itself

24
Q

What is the Exponent?

A

The position of the binary point in the number

25
Q

How does the Exponent work?

A

For example, if the exponent was 2, the binary point would be 2 points to the right

26
Q

What is the benefit of normalising a number?

A

Allows it to be represented, and assures that numbers can be stored with the highest possible decree of accuracy

27
Q

What do positive normalised numbers begin with?

A

01

28
Q

What do negative normalised numbers begin with?

A

10

29
Q

How does a computer store fractions?

A

They are converted into decimal form, then stored using binary numbers

30
Q

What does a normalised floating point binary number mean?

A

A number changed to be able to be represented by binary digits

31
Q

How do you add two normalised floating point numbers?

A
  1. Work out where the binary point should be in each number using its exponent
  2. Line both numbers up on the normal binary number so that the binary points are in the same position
  3. Add the numbers up in the normal way, following the rules of binary addition
32
Q

What is a character set?

A

A collection of characters recognised by a computer used by their binary codes

33
Q

Why are 7 bits needed for a characters code?

A

To store uppercase, lowercase numbers, including symbols and punctuation

34
Q

What are some examples of character sets?

A

ASCII
Extended ASCII
Unicode

35
Q

What is a multilingual character set?

A

A character set which includes alphanumerical symbols for a very large range of languages

36
Q

How do Bitwise Masks work?

A

They can be AND, OR or XOR and you need to apply those logic gates to two given 8 bit binary sequences

37
Q

How does binary subtraction work?

A

1 - 0 = 1
1 - 1 = 0
0 - 0 = 0
0 -1 = 1