Data Types and Binary Flashcards

(15 cards)

1
Q

What is an integer?

A

A whole number e.g. 1,5 or -16.

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

What is a float?

A

Also known as a real it is a decimal number like 3.5 or -0.123.

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

What is a boolean?

A

A variable that can only take the value true or false.

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

What is a char?

A

A single character, e.g. ‘A’.

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

What is a string?

A

An array of chars, a string of letters, e.g. “hello world”.

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

Why do we use hex?

A

Because it’s easier to write and understand than binary but is very easy to convert (as each digit is 4 binary digits).

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

What is ASCII?

A

American Standard Code for Information Interchange, it is a list of 128 different characters or values like NULL used to convert readable strings into integers the computer can use.

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

What is unicode?

A

A universal character set that allows computers from countries with different character sets to communicate.

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

What is an overflow error?

A

Where two binary numbers are added together and create a number larger than the largest number the datatype can store, this digit is then lost.

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

What are the two methods for representing negative numbers?

A

Sign and magnitude or two’s complement.

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

How do you convert a two’s complement number to a sign and magnitude one?

A

Flip the digits, add one and stick a 1 in front.

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

Uses of floating point?

A

Allows very small and large numbers to be stored in much smaller space but with a low accuracy.

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

What is the form of a normalised floating point number and why do we do it?

A

The first two digits must either be 1.0 or 0.1 giving maximum precision.

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

What is a logical shift right on a binary number?

A

All numbers are moved right with a 0 (or 1 if negative) added to the front of the number, equivalent to dividing by 2.

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

What does an arithmetic shift left do?

A

Moves all digits left ignoring the first digit (shifting should not make a positive number negative!), add a 0 on the end.

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