Lecture 2 - Number Representations Flashcards
What is counting decimals?
- 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.
What is counting binary?
- 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.
What is counting hexadecimal?
- 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.
What is counting general case radix R
- 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.
Define Polynomial representation
- Positional Number System
- Each digit is weighted according to its position
How do you do decimal to binary conversion?
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 do you do decimal to hex conversion?
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 do you do binary to hex conversion?
Four binary digits make up one hex digit (REFER TO NOTES)
How do you do decimal to binary conversion with decimal numbers ie 0.45 base 10?
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 do you do decimal to hex conversion with decimal numbers ie 0.45 base 10?
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)
What are signed numbers? (refer to slides for examples)
- Signed numbers result naturally from counting backwards
- Number representations have a certain precision and therefore a fixed number of digits
How do you negate binary numbers?
- 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)
What is the understanding of signed and unsigned numbers?
Depending on context (signed or unsigned), the same bit pattern can mean different things.
e.g.:
10112 signed = –5
10112 unsigned = +11
What is roll-over and overflow?
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)
What are some of the special cases for floating point?
Exponent = 0 and Exponent = 255
REFER TO SLIDES