CS-343 Assignment 4

This assignment is due in class on March 2

  1. Use CircuitMaker to implement a four-bit version of the ALU developed in Appendix B and and in class. Use a hex key to input the function code, two hex keys to enter the values of A and B,a hex display to show the result. Use logic indicators to show the values of Carry, Overflow, and Zero.
  2. (Bonus) What function code produces A NOR B?

How to Submit

You may submit this assignment electronically by sending me a copy of your .ckt file as an attachment to an email message. Be sure to put "CS-343 Assignment 4" in the Subject line of your message. Send it to vickery at babbage.cs.qc.edu. Alternatively, you may give me a printed copy of your circuit, preferably in color and showing an "interesting" set of input values.

CircuitMaker Help For This Assignment

The student edition of CircuitMaker places a limit of 50 devices on your design. You could not complete this assignment within this limit if you used just AND, OR, and Invert gates. However, you can implement all four full adders and all four 4x1 multiplexors using just three devices! The trick is that CircuitMaker provides you with some packaged devices that implement common functions like adders and multiplexers. For example device number 74LS283 contains four full adders with the internal carries already connected appropriately.

Another useful device for this assignment is device number 74LS153, which includes two 4x1 multiplexors in a single package; with two of them you get all four multiplexors for your design. The control inputs to these multiplexors are labeled S0 and S1, which should be connected to pins 1 and 2 of the hex key used for entering the 4-bit function code. The inputs are labeled I0a through I3a for one multiplexer in a package and I0b through I3b for the other multiplexer; the outputs are Ya and Yb. The two pins marked Ea and Eb with bubbles next to them are actually inputs that are used to "Enable" the outputs. We'll talk about what that means when we cover tristate gates in the course. For now it's enough to know that these inputs should all be connected to ground (logic 0) so that the outputs will be "enabled".

The only problem with this set up is that by using the 74LS283 you won't have access to the internal carries of the adder, which is how we implemented the overflow detection logic in class. Instead, you will have to compare the signs of the two operands with the sign of the output. If both inputs are positive and the result is negative or if both inputs are negative and the result is positive, overflow is true. You'll need to use inverters, AND gates, and an OR gate to compute the value of the expression (A4*B4S4') + (A4'*B4'*S4). [The 74LS283 pins are numbered 1-4 instead of 0-3 as we have been doing in class.)

We noted that pins 1 and 2 of the function hex key are used for F0 and F1 of the ALU function code. Again, the pin numbers start at 1 instead of 0 for these devices. Use pin 3 for Bnegate and pin 4 for Ainvert to be consistent with the book. Only the following five functions need to be tested carefully for this assignment:

Hex Function Binary Function
00000A AND B
10001A OR B
20010A + B
60110A - B
70111A < B (SLT)
?????A NOR B

The bonus question for the assignment is to figure out what values the question marks represent.