There are no homework assignments available at this time.
  1. Write a Java program (if you feel more comfortable in C or C++ you may use one of those languages also).
    1. Read in a String str representing a floating point value (no E component) consisting of an optional sign, digits, and a decimal point.
    2. Parse the string into three integer variables representing the sign, the integer part, and the fraction part.
    3. Merge the integer and fraction part into a single binary fixed-point value.
    4. Normalize this value so that it has the form 1.fract x 2exp.
    5. Use the values sign, exp, and fract to form a binary int i value in the form of a 32-bit IEEE 754 standard floating point value.
    6. Convert this int i to a float f using float f = Float.intBitsToFloat(i).
    7. Compare this float value (f) with that obtained by float g = Float.parseFloat(str).
    You can also work backwards by computing g right away, mapping it to integer bits using int i = Float.floatToIntBits(g), and then operating on the bits to eventually get back to a String strout which you comapre with the original str.

    This assignment will be due on: Thursday, 28 February 2008.

  2. In class we discussed building digital electronic circuits using AND, OR, and NOT gates. For this assignment we will be designing and implementing (using the MMLogic, LogicSim, or CircuitMaker circuit design and simulation tools) a circuit for converting from a Binary Coded Decimal (BCD) value in 4 bits into the signals for a seven-segment display device.

    Your task are:

    1. Create the truth table for all of the seven segments (defining all seven of the conversion functions).
    2. Using Karnaugh maps, simplify the seven conversion functions thus generating another seven simpler functions.
    3. Build, using one of the circuit simulator programs, the conversion circuits from the simplified functions (you may find it useful to share some circuit components between the functions.
    4. Use the "Select" object (lower right portion of the palette, it's red with a circle and arrow in the middle) to represent the BCD inputs to your circuit.
    5. Use two "7 Segment LED" objects for output.
      1. The first one (default, 5 inputs) will be connected directly to the outputs of the "Select" object (you may ignore the decimal point input line).
      2. The second one (select the Properties drop down menu item and then select the 8 input version) will be connected to the outputs of the circuit you developed to represent the 7 segment signals.
    6. Save you work in a file called converter.lgi/
    7. Run the circuit to test it. Cycle through the "Select" object by clicking the selector. This will change the outputs for each click. Verify that the two display devices show exactly the same segments being lit and not lit. If there are difference that fix your conversion circuit.
    8. Submit (via floppy, CD-R, e-mail) the saved converter.lgi file. Make sure that your name is on the submission (either written or in electronic form) so that you will get credit for your work.

    This assignment will be due on: Thursday, 6 March 2008.

  3. You will write a program (Dot.asm) using the ARCTools discussed in class.
    The plus program we did in class is availabe here. You can use this as a reference for writing this code.
    The program you write will emulate the DotTest Java program here. If you run the DotTest program it will print out a single result. Your assembler program should produce the same result. You may use whatever tricks you can think of to make the program work in a functionally similar way (i.e., I tell you "what" to do, but you can figure out "how" to do it).

    Notes on register usage:

    I was able to develop the Pmul function and the mul macro. They are in the file multiply.asm. The mul macro takes source register 1 (rs1) as the first argument, either source register 2 (rs2) or a (simm13) value as the second argument, and the destination register (rd) as the third argument. This is the same usage as the rest of the arithmetic instructions.
    Note that the Pmul function uses register %r8 to pass the multiplicand and register %r9 to pass the multiplier to the function. The low order part of the product is returned in register %r8. The use of only the low order part of the product matches the behavior of C, C++, and Java. These registers are set by the caller (and read by the caller on return) and therefore do not need to be saved/restored by the function.
    The function uses the local registers %r16 - %r20 to perform the calculations. Since these are in the local registers group it is assumed that they do not need to be saved/restored within the function code.
    I modified my version of Dot.asm to include the mul macro and Pmul function and tested it out. The results match those of the updated (to change the + to a *) DotTest.java program.

    This assignment will be due on: Thursday, 8 May 2008.