Name _________________________

CSC001- Worksheet 2: Number Systems and
Internal Representation, Storage Requirements

ublkline620.GIF (83 bytes)

D. Joseph
Fall 1998

Due: October 14 at beginning of lecture period
Total Points: 10

 

Part 1 - Convert the following binary (base 2) numbers to decimal (base 10) numbers.

1. 1111 =  

 

2. 1011 =  

 

3. 00001 =  

 

4. 10111 =  

 

5. 11101011 =  

 

6. 0101 =  

 

 

Part II - Convert the following decimal (base 10) numbers to binary (base 2) numbers.

7. 27 =  

 

8. 131 =  

 

9. 381 =  

 

10. 2014 =  

 

11. 7 =  

 

12. 157 =  

 

 

Part III - Storage Requirements

13. How many bytes of memory are needed to store the decimal number 12?

________________ bytes
14. How many bytes of memory are needed to store the decimal number 412?

________________ bytes
15. How many bytes of memory are needed to store the letter 'A' (not including the quotation marks ' ').

________________ bytes
16. How many bytes of memory are needed to store 'Happy Halloween'? (not including the quotation marks ' ').

________________ bytes

 

Part III - Representation Limitations.

17. Given the following:

A = 2 / 3

B = 1 - A

C = B * 3

What does C equal (hand calculation)? C = ________________

18. Now use the equations in #17 above to write a simple QBASIC program that calculates the value of C and run your program.

What does C equal (QBASIC calculation)?  C = ________________

Why?

 

Be sure to turn in a copy of your program and output for credit.

 

 

ublkline620.GIF (83 bytes)

Return to:  CSUS | Computer Science

October 5, 1998
Comments to:  josephd@csus.edu