Exercises on binary numbers

advertisement
Introduction to programming
"Number systems"
Goal: The objective of this handout is to give students initial practice with binary
numbers as well as hexadecimal and octal number systems.
In the following exercises, use the table to convert binary number to decimal number and
vise verse:
... 27 26 25 2 4 23 2 2 21 20
… 128 64 32 16 8
4
2
1
1. What is the decimal value for the binary number 1010 ?
2. What is the binary representation for the number 98?
3. What is the maximum number that can be represented by using 8 bits? Hint: write it
down in binary representation first and then covert to decimal.
4. How many different numbers in total can be represented by 8 bits?
5. What is the size of the memory with 2 bytes address space?
6. What is the octal representation of the binary number 11110000?
7. What is the hexadecimal representation of the binary number 11110000?
8. Add two numbers: 1100 and 1101 in binary
9. Subtract number 111 from the number 11001 in binary.
10. Convert number 1A (base 16) to octal number with the use of binary system.
Download