Starting from:

$30

CS2110-Timed Lab 1 Arithmetic Logic Units Solved

In this timed lab, you will be creating an ALU. This ALU will take in two 8-bit inputs and one 2-bit select bit. It will output one 8-bit output.

When building this ALU, you may only use basic logic gates (AND, OR, NAND, NOR, NOT), decoders, multiplexers, adders, splitters, wires, tunnels, constants, input pins, and output pins. YOU DO NOT

NEED TO BUILD THE GATES OUT OF TRANSISTORS. PLEASE, FOR YOUR OWN SAKE, DON’T DO IT.

IMPORTANT NOTE: You probably did not really read the paragraph above, but it says you’re allowed to use CircuitSim’s default adders (in the Arithmetic tab). So please don’t try to make your own adders, just use that one. You’re not allowed to use anything else from the Arithmetic tab (don’t try to be smart and use a subtractor).

Some operations will also have additional banned operations.

1         Instructions
Please make sure that you have CircuitSim 1.7.4 or 1.8.0 installed on your computer. All changes should be made in the tl1.sim file. Do not move or rename any or the input or output pins.

You will create an 8-bit ALU with the following operations, using any of the gates listed above. All numbers should be interpreted as 2’s complement.

00. Is Multiple of 16
[A % 16 == 0]
01. 4A-B
[4A - B] you may only use one adder
10. !A && B
[!A && B] Note: this is a logical AND! Clarification below.
11. Multiply by 12
[A * 12] you may only use one adder
Notice that Is Multiple of 16, and Multiply by 12 only operate on the A input. They should NOT rely on B being a particular value.

Notice that opcode 10 applies a logical AND. This operation is equivalent to the following ternary expression:

(A == 0 && B != 0) ? 1 : 0. That is, your circuit should output 00000001 if A is zero and B is not zero. Otherwise, it should output 00000000. Hint: You can check if a number is zero by NORing its bits.

This ALU has two 8-bit inputs for A and B and one 2-bit input for OP, the op-code for the operation in the list above. It has one 8-bit output named OUT.

The provided autograder will check the op-codes according to the order listed above (Is Multiple of 16 (000), 4A-B (001), etc.) and thus it is important that the operations are in this exact order.

More products