Lecture 2 - Number Representations Flashcards

1
Q

What is counting decimals?

A
  • Base 10
  • Digits 0..9 (=10-1)
  • Keep incrementing rightmost digit until highest digit is reached, then apply same mechanism to increment digit to the left and reset current digit to 0.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is counting binary?

A
  • Base 2
  • Digits 0..1 (=2-1)
  • Keep incrementing rightmost digit until highest digit is reached, then apply same mechanism to increment digit to the left and
    reset current digit to 0.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is counting hexadecimal?

A
  • Base 16
  • Digits 0..9, A..F (15=16-1)
  • Keep incrementing rightmost digit until highest digit is reached, then apply same mechanism to increment digit to the left and reset current digit to 0.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is counting general case radix R

A
  • Base R
  • Digits 0..R-1
  • Keep incrementing rightmost digit until highest digit is reached, then apply same mechanism to increment digit to the left and reset current digit to 0.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Define Polynomial representation

A
  • Positional Number System
  • Each digit is weighted according to its position
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do you do decimal to binary conversion?

A

Given a number to base 10, divide the number by 2 and write down the remainder until said number is not divisible. Once done then read the numbers from bottom to top to get the binary number, then right the base next to it, in this case it would be base 2.

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

How do you do decimal to hex conversion?

A

Given a number to base 10, divide the number by 16 and write down the remainder until said number is not divisible. Once done then read the numbers from bottom to top to get the binary number, then right the base next to it, in this case it would be base 16. Note that if there is remainder of 10, 11, 12, 13, 14, 15 or 16 this is represented by A, B, C, D, E or F respectively

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

How do you do binary to hex conversion?

A

Four binary digits make up one hex digit (REFER TO NOTES)

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

How do you do decimal to binary conversion with decimal numbers ie 0.45 base 10?

A

Given a number to base 10, divide the number by 2 and the number before the decimal ie for 0.45/2 is 0.9 so you right down 0. Once done then read the numbers from top to bottom to get the binary number, then right the base next to it, in this case it would be base 2. This is done to a specfic precision which is typically given and this tells you how far to do (how m any numbers need to be recorded)

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

How do you do decimal to hex conversion with decimal numbers ie 0.45 base 10?

A

Given a number to base 10, divide the number by 16 and the number before the decimal ie for 0.45/16 is 0.029 (rounded) so you right down 0. Once done then read the numbers from top to bottom to get the binary number, then right the base next to it, in this case it would be base 16. This is done to a specfic precision which is typically given and this tells you how far to do (how m any numbers need to be recorded)

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

What are signed numbers? (refer to slides for examples)

A
  • Signed numbers result naturally from counting backwards
  • Number representations have a certain precision and therefore a fixed number of digits
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How do you negate binary numbers?

A
  • Negation: Convert a positive number to a negative or vice versa
  • Algorithm for negating binary numbers:
    Two’s Complement:
    1. NOT (One’s complement)
    2. Increment (lowest bit)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the understanding of signed and unsigned numbers?

A

Depending on context (signed or unsigned), the same bit pattern can mean different things.
e.g.:
10112 signed = –5
10112 unsigned = +11

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

What is roll-over and overflow?

A

Correct transition between negative and positive range
(or vice versa) is called a roll-over.
Incorrect transition between negative and positive range
(or vice versa) is called an overflow.

REFER TO SLIDES (LECTURE 2 - SLIDE 24)

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

What are some of the special cases for floating point?

A

Exponent = 0 and Exponent = 255
REFER TO SLIDES

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

What are floating point numbers?

A
  • We use the IEEE standard for FP numbers
  • 32 bits, single precision: 1 bit sign, 8 bits exponent, 23 bits fraction
    FORMULA: Number to base 10 = ((-1)^sign) * (2^(exponent-127)) * (1.fraction to base 2)
    REFER TO SLIDES FOR EXAMPLE