1.4.1 Data Types Flashcards

1
Q

What is a character set?

A
  • A defined list of characters recognised by the computer hardware and software, with each character being represented by a single number
  • Character sets are agreed standards for referring to all characters a computer uses
  • Includes upper/lower case symbols and punctuation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How many unique binary numbers does 7 bits give?

A

128

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

What is ASCII?

A
  • American Standard Code Information Interchange became the accepted standard.
  • It was then extended from 7 bit to 8 bit - Extended ASCII
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How many unique binary numbers with 8 bits?

A

256

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

An international, multilingual language character set needs to include:

A
  • Characters from every written language
  • Historical scripts
  • Emojis
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is UNICODE?

A
  • Was originally 16 bit but is now 24 bit character set providing over 16 million characters
  • Writing 24 bits is slow, so hexadecimal is used instead
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Why don’t we use UNICODE all the time?

A
  • The ASCII Character set is an 8 bit character set, meaning each unique character in a file is represented by 8 1s or 0s
  • The Unicode Character set is 8, 16 or 32 bit character set depending on version, therefore each character is either 8, 16 or 32 1s or 0s
  • Text file stored using UNICODE can take up more space than ASCII
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Exam Question: What is meant by the character set of a computer?

A
  • Normally equates to the symbols on a keyboard/ digits/ letters
  • That can be represented/ interpreted/ understood by a computer
  • May include control characters
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Exam Question: Explain how codes are used to represent a character set?

A
  • Each symbol has a (binary) code / number
  • Which is unique
  • Number of bits used for 1 character = 1 byte
  • Example code: ASCII / UNICODE
  • Uses 8 bits/ 16 bits per character
  • Use of more bits for extended character set
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Exam Question: The character A in the ASCII character set is represented by the denary value 65. Write the binary representation for the ASCII character “H”. Show your working. (2)

A
  • If A is 65, H is 72
  • 72 in binary is 01001000
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Describe what is meant by the term ASCII ?(2)

A
  • American Standard Code for Information Interchange
  • A character set
  • Maps values to characters
  • Uses 7 bits/8bits per character
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Exam Question: Explain what is meant by the term UNICODE? (3)

A
  • Unicode is a character set
  • Mapping different binary values to characters
  • Each character is represented by 1-4 bytes
  • It supports a very large number of characters
  • It is backward compatible with ASCII
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the 5 primitive data types?

A
  • Integer
  • Real/floating point
  • Character
  • String
  • Boolean
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is an integer and give an example?

A
  • A whole number
  • 23
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is a real/floating point and give an example?

A
  • A number with an integer and a fractional part
  • 12.65
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is a character and give an example?

A
  • A single alpha-numeric character
  • D
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is a string and give an example?

A
  • A sequence of alpha numeric characters
  • Hello
18
Q

What is Boolean and give an example?

A
  • Either TRUE or FALSE
  • FALSE
19
Q

How do you represent positive 11 in a 4 bit binary system?

20
Q

How do you represent 121 into binary?

21
Q

What are the 2 ways to represent negative numbers in binary

A
  • Sign and Magnitude
  • Two’s complement
22
Q

How do you use sign and magnitude to represent a negative number in binary?

A
  • The most sig fig is used to represent the sign
  • 1 means the number is negative and 0 means the number is positive
23
Q

How would you convert -4 into binary using sign and magnitude?

A
  • Write out positive 4 in binary
  • Then change the MSB to 1
  • 10000010
24
Q

Why is Sign and magnitude not used often?

A
  • Largest number that can be represented using 8 bits is 127 due to using MSB as a sign bit much less than 255
  • Also harder to do calculations as some bits mean different things; some numbers and some signs
25
How do you represent a negative number using Two's complement?
* To write it out as a positive number * Then starting from the right hand side, flip each bit and then add 1
26
Convert -86 into binary using Two's complement
* Work out + 86: 01010110 * Then flip: 10101001 * And add 1: 10101010
27
What is 1. 0+0 2. 0+1 3. 1+1 4. 1+1+1 ?
1. 0 2. 1 3. 10 4. 11
28
How do you do Binary Addition?
* Arrange them above each other * Start at Least Significant Bit and add the 1s and 0s
29
How do you do Binary subtraction?
* Same as binary addition but convert the number to be subtracted into a negative number using 2s complement
30
Binary addition: What is 42+18
00111100
31
Binary subtraction: What is 68 - 33
* 00100011
32
What are the different symbols used in hexadecimal and what do they mean?
* 0 - 9 = 0 - 9 * A=10, B = 11, C=12, D=13, E = 14, F = 15
33
How do you convert the denary number 31 into hexadecimal?
* 1F
34
What are the steps of writing a number into floating point notation?
* Convert the exponent into denary. * If the exponent is positive, move the decimal point to the right, if negative move decimal point to the left * Put column headings under and add the value
35
How do you normalise a number - if positive?
1. Convert exponent to denary 2. Move decimal point so it is before the first 1 3. Subtract the number of moves from the exponent
36
How do you add floating point numbers?
1. The exponents of the 2 numbers must be the same 2. Change the exponent of the 2nd number to the first exponent and adjust mantissa 3. Add mantissas using usual method
37
Add Mantissa: 01110, Exponent 010 and Mantissa 01000, Exponent 001 together?
* 10010 010
38
How do you subtract floating numbers?
1. Just like addition, exponents must be the same and adjust mantissa 2. Now convert the mantissa of the second number to a negative one using 2s complement 3. Add the mantissas
39
Subtract Mantissa: 01110, Exponent: 010 from Mantissa: 01000, Exponent 001
* 01010 010
40
What is Bitwise Manipulation and masks?
* Bitwise Manipulation means applying logical operators (AND, OR, NOT, XOR) to binary * Mask is simply data being used in the operation
41
How do you carry out Bitwise Manipulation?
* Apply operations to corresponding bits * A = 10111001 * B = 00111010 * AND = 00111000