Unit 6 : Data Types Flashcards

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

What is an integer

A

● A whole number
● Zero is an integer
● Negative numbers are integers
● Can’t have a fractional part
● Useful for counting things

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

What is a real

A

● Positive or negative numbers
● Can, but do not necessarily, have a fractional part
● Useful for measuring things
● All integers are real numbers

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

What is a character

A

● A single symbol used by a computer
● The letters A to Z
● The numbers 0 to 9
● Symbols like %, £, and,

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

What is a string

A

● A collection of characters
● Can be used to store a single character
● Can also be used to store many characters in succession
● Useful for storing text
● Don’t cut off leading 0s like numeric types

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

What is boolean alegbra

A

● Restricted to True and False
● Useful for recording data that can only take two value

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

how would you represent positive integers in binary

A

● A single binary digit is called a bit
● Eight binary digits can be combined to form a byte
● Half a byte (four bits) is called a nybble
● The least significant bit of a binary number is the one furthest to the right
● The most significant bit is furthest to the left

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

What are the 4 simple rules to binary addition

A
  1. 0 + 0 + 0 = 0
  2. 0 + 0 + 1 = 1
  3. 0 + 1 + 1 = 10
  4. 1 + 1 + 1 = 11
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is sign magnitude when talking about representing negative numbers in binary

A

● The equivalent of adding a + or - sign in front of a number
● A leading 1 is added for a negative number
● A leading 0 is added for a positive number

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

What is a two’s compliment when talking about representing negative numbers in binary

A

● Has the added advantage of making binary arithmetic with negative numbers much more simple
● Works by making the most significant bit negative
● Converting to two’s complement is as simple as flipping all of the bits in the positive version of a binary number and adding one

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

What is normalisation

A

● Maximises precision in a given number of bits
● To normalise a binary number:
○ Adjust the mantissa so that it starts 01 for a positive number of 10 for a negative number

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

What is a character set

A

● A published collection of codes and corresponding characters
● Can be used by computers for representing text
● Two widely used character sets are ASCII and Unicode

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

What is ASCII

A

● American Standard Code for Information Interchange
● The leading character set before Unicode
● Uses 7 bits to represent 27
= 128 different characters
● ASCII soon came into trouble when computers needed to represent other languages with different characters

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

What is Unicode

A

● Solves the problem of ASCII’s limited character set
● Uses a varying number of bits allowing for over 1 million different characters
● Many characters have yet to be allocated
● Enough capacity to represent a wealth of different languages, symbols, and emoji

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