CS61c Hw 6

Due 4/08 @23:59:59

Q1: Draw a diagram of a circuit that takes three input bits, corresponding to an integer between 0 and 7. Your circuit should output 1 if the integer is a member of the fibonacci sequence and 0 otherwise. Your circuit should be constructed using NOT, OR, and AND gates, and should use no more than 5 total. Zero is the first member of the fibonnaci Sequence. We encourage you to use Logisim to lay out and test your circuit.

On your answer, label each input as 1s place, 2s place, or 4s place so we’re clear what you intend.

Submit this part as a PNG file named hw6.png.  

Q2:        Write a formula in Boolean algebra to define the logical function that takes as input 32 bits x0 to x31, and evalutes to 1 if and only those bits correspond to one of the J-type MIPS instructions on the MIPS Green Card.  (Either J or JAL)  Assume that x0  is the (most significant) bit of the instruction. Note that this is a different convention from the one on the Green Card.

Your formula need not involve all the input bits.

Q3.        Some versions of MIPS have a conditional move instruction called movz.  A movz $a,$b,$c will copy $b to $a if $c is zero. If $c is nonzero, it is a no-op. See page 383 of the text for more details on conditional move instructions.

Describe how you would modify the MIPS datapath in Figure 4.51 to support this instruction. Do you need new control signals? If so, specify what they are and what values they should have.

Submit parts 2 and 3 as a text file names hw6.txt