1. The Op Code for the MIPS add instruction is 0, and the function code is 3210. Translate the assembly language statement, "add $5, $6, $7" to binary. Show all work, including the names and sizes of all the fields of the machine language instruction.

2. Draw the gates to implement a 2 x 4 decoder. Label all inputs and outputs.

3. Give the truth table for a full adder, and draw the gates to implement it. Label all inputs and outputs.

4. Draw a block diagram that shows all the inputs and outputs to the MIPS ALU designed in class and in the textbook. (Read the next question before answering this one.)

5. Show the design of cells 0, 1, and 31 of the MIPS ALU designed in class and in the textbook. Show how they are connected to each other. Label all inputs and outputs. (Read the previous question before answering this one.)

6. A) What do the terms carry generate and carry propagate mean in the design of carry-lookahead logic?

B) Give the equation for C3 using carry-lookahead logic.

C) Draw all the gates to implement C1 using carry-lookahead logic. Note the difference in subscripts between parts B and C of this question.

7. Complete this table for a four-bit implementation of the MIPS ALU. That is, position 3 in the table corresponds to position 31 of the full MIPS ALU.
RowA3 A2 A1 A0 B3 B2 B1 B0 Bneg f1 f0 CV NZ R3 R2 R1 R0
i
1
1
0
1
1
0
1
1
0
0
0
ii
1
1
0
1
1
0
1
1
0
1
0
iii
1
1
0
1
1
0
1
1
1
1
0
iv
1
1
0
1
1
0
1
1
1
1
1

Legend: Ai and Bi are data inputs. Bneg is Bnegate. fi are function selection bits. C is carry out of the ALU; V is overflow; N is Negative, Z is Zero. Ri are the result bits. Note: Show all work in your exam book to receive partial credit. Label the work in your exam book with the row numbers.


Christopher Vickery
Computer Science Department
Queens College of CUNY