Data Rep (Number Systems + Bases) Flashcards

1
Q

Fraction Definition

A
  • The ratio between two integers (numerator : denominator)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Whole Numbers Definition

A
  • A number with no fractional part, meaning there are no fractions or decimal place values after the number.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Natural Numbers (Definition, uses and Symbol)

A
  • Positive whole numbers of the base 10 number system, ranging from 0 to infinity.
  • Uses for everyday counting and ordering.
  • Mathematical Symbol: ℕ = {0, 1, 2, 3, 4, 5, 6…}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Integer Numbers (Definition, Use in Programming, Symbol)

A
  • Whole numbers that can hold a positive or negative value, including zero.
  • Integers are one of the standard data types used when defining variables.
  • Mathematical Symbol: ℤ = {…, -3, -2, -1, 0, 1, 2, 3…}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Rational Numbers (Definition, Symbol)

A
  • A number which can be expressed as a fraction/quotient.
  • Mathematical Symbol: ℚ
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Irrational Numbers (Definition and Implication in Programming)

A
  • A number that cannot be represented as a ratio of integers because their decimal expansions are non-terminating (infinite) and non-repeating (values after the decimal places never repeat in a pattern).
  • As they have infinite decimal places, the programmer has to decide on the level of precision required and allocate a set amount of memory to storing the value.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Real Numbers (Definition, sub-catergories, and Implication in Programming)

A
  • Any positive or negative value, that can include a fractional part.
  • Integers, rational numbers, and irrational numbers are all real numbers.
  • As they have infinite decimal places, the programmer has to decide on the level of precision required and allocate a set amount of memory to storing the value.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Ordinal & Cardinal Numbers (Definitions)

A
  • Ordinal numbers identify the position of something within a list (first, second, third)
  • Cardinal numbers indicate an amount, how much of something we have (0, 1, 2, 3)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Well-ordered list

A
  • A group of related numbers with a set and defined order.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Note: To calculate the max number of permutations for bits, 2^n.

A
  • If 8 bits are being used, we have 2^8 = 256 permutations (remember, this often includes zero, so 0-255).
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Binary Prefixes

A

Kibi-byte: Ki, 2^10 bits
Mebi-byte: Mi, 2^20 bits
Gibi-byte: Gi, 2^30 bits
Tebi-byte: Ti, 2^40 bits

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

Decimal Prefixes

A

Kilo-byte: KB, 10^3 bits
Mega-byte: MB, 10^6 bits
Giga-byte: GB, 10^9 bits
Tera-byte: TBM 10^12 bits

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

Number Bases

A
  • A number base indicates how many different digits are available when using a particular number system.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Is an unsigned integer positive or negative?

A
  • A positive integer (it does not have a sign, which in this case is the ‘-‘ sign).
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Two’s Complement

A
  • A way of representing negative integers in binary.
  • The MSB (most significant bit) is -128, not 128.
  • A total of 256 numbers, from -128 to 127 can be represented.

-128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |

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

Converting from denary to binary using two’s complement

A
  • Make the number positive, and write the number out normally in the binary table.
  • Then, flip every digit (1s become 0s, vice versa)
  • Add 1 to the number (00000001)
  • The denary number is now in two’s complement

-128 | 64 | 32 | 16 | 8 | 4 | 2 | 1|

17
Q

Fixed Point Numbers

A
  • Fixed point numbers are used to represent numbers with decimal places or fractional parts.
  • A decimal point is added to a binary number (although it is not stored in the 8-bit code).
  • A fixed point may look like: 1000.1100
  • After the fixed point, the table looks like this:
    8 4 2 1 . 1/2 1/4 1/8 1/16
  • The smallest numbers you can represent is 0000.0001 (1/16) and the largest is 1111.1111 (15.9375)
  • Moving the fixed point around means we can either have more accurate decimals with a smaller range of whole numbers, or larger whole numbers with less accurate decimals.

1 | 0 | 0 | 1 | 1 | 1 | 0 | 0 |

18
Q

How many combinations does a 16 & 24-bit code allow?

A
  • 65,536
  • 16,777,216
19
Q

What range of whole numbers does a 16 -bit code allow with two’s complement?

A

-32,768 to 32767