Section 6, 7, 8 Data Types Flashcards

1
Q

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

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

Character

A

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

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

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 0​s like numeric type

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

Boolean

A

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

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

Least significant bit

A

furthest to right

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

most significant bit

A

furthest to left

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

-ve number sign and magnitude

A

Leading 1 is like adding a - sign
0 is a + sign

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

Two’s Complement

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

Two’s complement, subtraction in binary

A

● Two’s complement makes subtraction in binary easy
● Subtracting a number from another is the same as adding a negative number
● To subtract in binary, use binary addition with a negative two’s complement number

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

Floating point numbers can be split into two parts:

A

○ Mantissa
○ Exponent

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

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
13
Q

Character Sets for Representing Text

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
14
Q

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
15
Q

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
16
Q

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

17
Q

Arrays

A

An array is an ordered, finite set of elements of a single type.
● A 1D (one- dimensional) array is a linear array.
● A 2D (two-dimensional) array can be visualised as a table/spreadsheet.
● When searching an array, first go down the rows and then across the columns.
● A 3D (three-dimensional) array can be visualised as a multi-page spreadsheet
○ An element in a 3D array using: threeDimensionalArray[z,y,x]
z = array number, y = row number, x = column number.

18
Q

Records

A

● More commonly referred to as a row in a file,
● A record is made up of fields, and is widely used in database

19
Q

lists

A

● Consists of a number of items, where items can occur more than once.
● Data can be stored in non-contiguous locations and be of more than one data type.

20
Q

Tuples

A

● An ordered set of values of any data type .
● Cannot be changed: elements cannot be added, edited or removed once initialised.
● Initialised with regular brackets rather than square brackets

21
Q

Stacks

A

● Last in first out (LIFO) data structure:
○ Items can only be added to/ removed from the top of the stack.
● Used to reverse actions, eg. back buttons and undo buttons use stacks
● Can be implemented as a static or dynamic structure.

22
Q

Queues

A

● First in first out (FIFO) data structure:
○ Items are added to the end and are removed from the front of the queue.
● Used in printers, keyboards and simulators.
● Linear queue: items are added into the next available space, starting from the front.
○ Items are removed from the front of the queue
○ Uses two pointers: pointing to the front and back of the queue.
○ Use space inefficiently, as positions from which data has been removed
cannot be reused

Circular queues have a rear pointer that can loop back to the front of the queue and
utilise empty space at the front.
○ Are harder to implement.

23
Q

6 stack operations

A

isEmpty() Checks if the stack is empty
push(value) Adds a new value to the top of the stack
peek() Returns the top value of the stack without removing it
pop() Returns and removes the top value of the stack
size() Returns the size of the stack
isFull() Checks if the stack if full

24
Q

4 queue operations

A

enQueue(value) Adds a new item to the end of the queue
deQueue() Removes the item from the end of the queue
isEmpty() Checks if the queue if empty
isFull() Checks if the queue is full

25
Q

Inputs to truth tables are called

A

literals

26
Q

Karnaugh maps headings

A

00
01
11
10

27
Q

Karnaugh map usage

A