Assignment 1 Solutions

Part of the homework for 22C:122/55:132, Spring 2003
by Douglas W. Jones
THE UNIVERSITY OF IOWA Department of Computer Science

  1. What is your E-mail address?

    No solution given

    Survey Questions

  2. What programming languages have you used to write even small programs?
    C19
    C++15
    Java15
    Assembly12
    Basic9
    Pascal6
    Fortran6
    VHDL6 -- but is this a programming language?
    Perl6
    Visual Basic5
    Prolog4
    PHP4 -- is this a programming language?
    Ada3
    Matlab2 -- we could argue about this too!

  3. What programming languages have you used to write programs that you considered large?
    C14
    Java11
    C++9
    Assembly4
    VHDL4
    Ada3
    Perl3
    Pascal2

  4. What machine architectures have you studied -- at the level of the machine's assembly language or instruction set?
    Motorola 68000 Series10
    MIPS5
    Intel5
    VAX1
    PDP-111

    Here, I am concerned that so few claim any exposure to more than one architecture!

  5. What processor implementations have you studied -- at levels below the instruction set (for example, at the level of gates and flipflops, the level of microcode, or the level of register-transfer logic)?
    Motorola 68000 Series7
    MIPS2

    Here, I am concerned that this covers fewer students than are enrolled in the class. It would be nice if the students in this class all had some exposure to implementation issues.

    Questions covering Prerequisites for the Course

  6. A, B and C are three one-bit binary numbers. S is the two-bit binary sum, where S1 is the most significant bit and S0 is the least significant bit. Give the truth table for an adder that computes S = A + B + C.
    ABCS1S0
    00000
    00101
    01001
    01110
    10001
    10110
    11010
    11111

  7. The tripflop is a logic device with 3 outputs, Qa, Qb, and Qc and 3 inputs, Ta Tb, and Tc. There are three 3-input nand gates in a tripflop, one per output:

    There was an error in the definition of Qc given in the assignment! It is corrected above; in summary, this device was supposed to be symmetrical, with each output depending on the two other outputs plus one of the inputs. The answers below are for the corrected circuit.

    a) With all inputs high, what are the stable states of a tripflop?

    stable states
    QaQbQc
    011
    101
    110

    b) What do you do to the inputs of a tripflop to flip it into one of its stable states?

    Make one of the inputs high and the others low. The output will then be the negation of the input. If all of the outputs are then made high, the output will remain in that state until some other input is pulled low.

  8. To what does the term fetch-execute cycle refer? Give a short answer.

    Durring the fetch part of the instruction cycle, the opcode (and possibly other fields) of the next instruction is loaded into the IR and the address portion may be loaded into the MAR. Durring the execute part of the instruction cycle, control circuitry interprets the opcode and executes the instruction.

  9. The steriotypical function call and return instructions save and restore the program counter on the stack. What additional work is done by the steriotypical interrupt and return from interrupt mechanism?

    The state of the CPU must be saved. This might involve saving such things as condition codes, the interrupt enable bit or bits, processor privilege level, and other information.

  10. The fictional TurboFlam computer has a 13-bit word. The parallel port option on this machine has 13 input pins and 13 output pins (separate from each other), along with strobe and acnkowledge pins for each transfer direction. Explain the likely contents of the 3 input-output device interface registers in the TurboFlam parallel port interface.

    One register will hold the data sent to the output pins so that they remain constant between output operations. One register will hold data presented to the input pins, although this may be a pseudo-register that looks, to software like a register, but involves no flipflops. Finally, there will be a control and status register that allows the output strobe and input acknowledge bits to be set and allows the input strobe and output acknowledge bits to be set.