Data Flashcards
What is the ASCII number for a? A?
a: 97 (0110 0001)
A: 65 (0100 0001)
What is the ASCII number for 0?
48 (0011 0000)
What is the ASCII code for backspace?
0000 1000
What is the range of values represented by 1s complement signed binary?
-(2^(n-1))+1 to (2^(n-1))-1
What is the range of values represented by 2s complement signed binary?
-(2^(n-1)) to (2^(n-1))-1
Why might we use 1s complement instead of 2s?
It can represent negative zero. This can be useful in computing when representing very small numbers, so we can tell if it is a number approaching zero from above or below (a rounded negative or a rounded positive)
Describe how to represent a negative number using 2s complement:
Write the number as a positive with an extra zero on the left.
Flip the bits (1s to 0s, 0s to 1s).
Add one.
Positive numbers start with a 0, negatives start with 1.
You can check your number by taking the negative value of the leftmost 1 and adding all of the values of the following 1s - it will be your number.