# CS61C Fall 2012 HW6

TA: Alan Christopher

Due Sunday, Nov 4, 2012 @ 23:59:59

## Goals

This assignment is designed to give you some practice with boolean logic and circuit design

## Submission

There is no skeleton for this assignment, so instead of pulling the skeleton, just run mkdir hw6 from the base of your working directory. It is important that you place your submission for hw6 inside this directory and not somewhere else, as when we pull submissions, we will look for your submission there. To submit, run these commands from inside the hw6 directory:

```git add −A
git commit −m “hw6 submission”
git tag −f hw6
git push --tags origin master
```

## Problem 1

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 highly composite number and 0 otherwise. We will be counting 1 as a highly composite number. Your circuit should be constructed using NOT, OR, and AND gates, and should use no more than 8 total (our solution uses 5). Additionally, you may not provide more than 2 inputs to any single gate. 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

## Problem 2

Write a formula in Boolean algebra to define the logical function that takes as input 32 bits x0,...,x31, and evalutes to 1 if and only those bits DO NOT 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.

## Problem 3

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 named hw6.txt