Lecture 3 Flashcards
Hexadecimal is shorthand for binary. How so?
It replaces 4 bits with one hex number. A-F hex digits represent 10 to 15.
How do you convert from decimal to binary?
Divide each decimal number by 2. Remainders = binary.
How do you convert from decimal to hex?
Repeatedly divide by 16. Remainders = hex.
How do you convert decimal fraction to binary?
Repeatedly multiply by 2 until reaching exactly 1. Extract number to left of decimal.
How do you convert decimal fraction to hex?
Repeatedly multiply fraction by 16 until reaching 1. Extract number to left of decimal.
How is sign-magnitude binary done?
Leftmost bit tells us of number is negative or positive.
How does two’s complement work?
Take positive number, flip all ones and zeros, add one.
What are the two special cases with two’s complement?
Largest number equates to itself. Zero only works if overflow is ignored.
What are two’s complement addition rules?
When adding two 1’s, write 0 and carry 1. When adding three 1’s, write 1 and carry 1.
How is addition with two’s complement performed?
Write negative number using two’s complement method and add to other number.
What are floating pt numbers?
32 bits: 1st bit signed, 8 bits exponent, 23 bits significand.
What base is Hex?
16.