Chapter 2: Coding numbers into binary Flashcards
What are unsigned integers?
unsigned because we do not let these have a sign (either negative or positive). With 4 bits, there are 16 different unique combinations. Therefore 4 bits can represent unsigned integers from 0 to 15.
What is ones compliment?
This is when all the bits in a binary number are inverted
How to determine the binary code of a negative integer?
In order to determine the binary code of a negative integer in the two’s complement system you first need to take the one’s complement by inverting all the bits, and then add 1 to the result.
Example of using two’s compliment to convert 8510 to -8510 ?
Example: with 8 bits the decimal number 8510 = 0101 01012
The one’s complement is therefore 101010102, and the two’s complement, and thus -8510 = 1010 10112.
How are binary numbers coded with the BCD system?
Example: The code 1001 0001 can be used to represent 91. 8 bits can span the range between 0-99.