Homework 1 Information, ECS50 Summer 2007

  • Homework due by 10:00 AM on Tuesday, August 14th

    Assignment:

    1.  Outline briefly what is meant by the following terms:
    	(a)  ASCII			(b)  Cell
    	(c)  hidden 1			(d)  overflow
    	(e)  mantissa 			(f)  normalized
    	(g)  Self-modifying code 	(h)  Instruction decoding
    	(i)  Opcode 			(j)  Addressing mode
    	(k)  Set a flag
    
    2.  Convert the following decimal numbers into octal.  You must show your work 
        in order to receive any credit.
    	(a)  33
    	(c)  15
    
    3.  Convert the following decimal numbers into hexadecimal.  You must show 
        your work in order to receive any credit.
    	(a)  259
    	(e)  2047
    
    4.  Convert the following octal numbers into their decimal equivalents.  You
        must show your work in order to receive any credit.
    	(b)  35
    	(c)  125
    
    5.  Convert the following hexadecimal numbers into their decimal equivalents.
        You must show your work in order to receive any credit.
    	(a)  2B3
    	(c)  E4
    
    6.  Show the hexadecimal representations of the following binary numbers:
    	(a)  110101011
    	(b)  0101101011001
    	(c)  11011111010101101
    	(d)  00101001011100101001
    	(e)  01110101101011010100100111101010
    
    7.  Show the octal representations of the following binary numbers:
    	(a)  110101101
    	(b)  1100101001101
    	(c)  10010111110011001
    	(d)  00111001101110001001
    	(e)  00110101001010111111101001001110
    
    8.  Show the binary representation of the following hexadecimal numbers:
    	(a) 0xA65D
    	(b) 0xBADBED
    	(c) 0x987
    	(d) 0x20C3A0
    	(e) 0xD23B9E
    
    9.  Show the binary representation of the following octal numbers:
    	(a) 0o567
    	(b) 0o1234
    	(c) 0o1357
    	(d) 0o26
    	(e) 0o7524767
    
    10. Assuming a 16-bit word size, represent the following decimal numbers in
        two's complement form.  Express your result using hexadecimal.
    	(a) -78
    	(b)  1201
    	(c) -9
    	(d)  32767
    
    11. Assuming the following hexadecimal numbers represent 16-bit 2's complement
        decimal values, determine the actual decimal values.
    	(a) 0xA98D
    	(b) 0xBED
    	(c) 0x8000
    	(d) 0x7FFF
    
    12. What is the range of integer numbers that can be represented using a
        18-bit word size if:
    	(a) You assume unsigned numbers?
    	(b) You assume Sign-Magnitude numbers?
    	(c) You assume two's complement numbers?
    
    13. Determine the ASCII character sequence defined by the following 
        hexadecimal patterns:
    	(a) 0x4f6c796d70696320476f6c6421
    	(b) 0x46616365506c616e74
    
    14. Determine the hexadecimal values that define the following ASCII 
        character sequences.  Ignore the leading and trailing quotation marks.
    	(a)  "It's Dolomite, Baby!"
    
    15. Assuming a 16-bit floating point format where the most significant bit of 
        the word is the sign bit for the mantissa, the next 5 bits are the exponent 
        stored in Excess-N format, and the remaining 10 bits are the magnitude of 
        the mantissa, write down the bit pattern for the following decimal numbers
        (Assume the format does use hidden one's):
    	(a)  -1.625x10
    	(b)  7.375
    	(c)  -.125
    
    16. Assuming the 24-bit floating point format described in the book, write 
        down the decimal number that corresponds to the following bit patterns:
    	(a) 0x871AD0
    	(b) 0x7FB800
    
    17.  Suppose that a computer system uses a 40-bit wordsize and a 28-bit address 
         space.  
         a.  How many bytes of memory are there?
         b.  What is the hexadecimal value of the highest address?
    
    18.  Why do the address registers use unsigned arithmetic while the accumulator
         uses signed two's complement arithmetic?
     
    19.  Why is the Instruction register a different size than the PC in CUSP?
    
    20.  Explain in detail the Fetch Decode Execute cycle, and the roles of the 
         IR and the PC in this.
    
    21.  How does the CPU tell whether a given memory location contains an
         instruction or a data word?
    
    22.  The instruction $042045 causes the contents of the ACC to be stored in
         memory location $045.
         a.  Describe this using the register transfer language shorthand.
         b.  If location $045 contains the value $FF0AB0 and the ACC contains
    	 $71A7EF, what are the contents of the ACC and location $045 after the
    	 execution of the instruction?
    
    23.  Problem 3.4 (b,d)
    
    24.  Write a program that reads from the keyboard and echoes what is typed to
         the screen incremented by 1 (for example, if an "n" is pressed, the 
         screen should show an "o".)  Continue to take input and echo until the 
         user hits the "\" key.
    
    25.  Problem 3.5 (program)