CS 370 - Autumn 2002
Introduction to Digital Design
Instructor: Carl Ebeling

Homework Set 4
DUE: Monday, Nov. 4 , 2002, Start of class
 

Collaboration Policy:

Unless otherwise noted, you may collaborate with other CSE370 students on the homework assignments. Do not look at homework or exam solutions from previous years. You must spend at least 15 minutes working on a problem before seeking assistance. Collaboration means that you may discuss the problems and make notes during the discussion, but you may not look at other student’s work when writing up your homework. Your homework represents your own work—the homework must show that you understand the material and have worked as an individual on every problem. You may not divide up the task of doing the problem sets in the interpretation of collaboration. You may discuss lecture material with anyone.

Late Homework Policy:

The weekly assignments are due at the beginning of class. Assignments handed in during or immediately after class will incur a 10% penalty. We will penalize your assignment 10% per day for each additional day late.

Please show all of your work.Your solutions must be legible…we will not spend time trying to decipher poorly written assignments.

Corrections made after the assignment was handed out are highlighted in red.


You may use the ROM, PLA and PAL worksheets handed out in class, or print this worksheet which has all three on one page.

1.  (25 points)  Use the accompanying worksheets to implement the following set of functions using a ROM, a PLA and a PAL.  That is, use a ROM to implement all three functions, then a PLA to implement all three, and finally a PAL.  For the PLA, try to reduce the number of AND gates you have to program.
Make sure you identify your solutions.

f1 = y'z + w'z
f2 = w'xy' + wy'z + wx'y + x'yz'
f3 = xyz' + wx'z

2.  (25 points)  Use the ROM, PLA and PAL worksheets to implement the following set of functions, represented using the SOP shorthand.  Again for the PLA, try to reduce the number of AND gates you program.  Use the same ROM worksheet as you used in #1.  Why can't you use the same PLA and PAL worksheets?

f1 = SUM m(1, 4, 5, 7, 13) + d(3, 6)
f2 = SUM m(3, 5, 7) + d(6)
f3 = SUM m(3, 4, 11, 13, 15) + d(9, 14)

3. (25 points)  In this problem, you are to implement a function that looks at 4 consecutive bits and detects whether it contains an unbroken string of 1's.  There are 7 cases: 0001, 0011, 0111, 1111, 1110, 1100, 1000.

a) Design this function using a ROM worksheet.  Share the ROM from problems 1 and 2.
b) The PAL worksheet has 6 inputs.  Generate 3 outputs, one for the first group of 4 bits, one for the second 4 bits and one for the last group of 4 bits.
c) The PLA worksheet also has 6 inputs.  Generate 3 outputs as you did for part (b).  Try to minimize the number of AND gates that you program.
4. (25 points) Using Active-HDL, design and test an 8-bit shifter circuit that implements the C/Java >> (arithmetic shift right) operation.  The circuit has two inputs: an 8-bit data input and a 3-bit shift amount input.  The output value is the input, shifted right by the shift amount.  (This also implements divide by a power of 2.)  Make sure your circuit works for both positive and negative numbers (2's complement) .  You will find a test fixture in the class hw4 directory.

5.  [Extra credit - 25 points]  (This is a challenge for those who have extra time.)
Use Active-HDL to design and test a Logic Unit that computes an arbitrary bit-wise logic function, as indicated by a 4-bit op-code, on two 8-bit numbers.  Each bit of the result is formed by applying the logic function to the corresponding pair of bits of the inputs.  Implement this Logic Unit using eight 4-1 multiplexors.  The following table defines the functions you are to implement and gives an example of each using 4-bit numbers.  Part of the design procedure is to assign the op-code values.  You will find a test fixture in the class hw4 directory, but you will have to modify it based on the op-codes you have chosen.
(Hint:  Don't use any other components except the eight 4-1 multiplexors!)

Function
C assignment
If A = 1100, B = 0110, then C =
Zero
C = 0
0000
One
C = 255
1111
OR
C = A | B
1110
AND
C = A & B
0100
XOR
C = A ^ B
1010
EQUAL
C = ~(A ^ B)
0100
A
C = A
1100
B
C = B
0110
NOT A
C = ~A
0011
NOT B
C = ~B
1001
NOR
C = ~(A | B)
0001
NAND
C = ~(A & B)
1011
B mask A
C = ~A & B
1000
A mask B
C = A & ~B
0010
B --> A
C = A | ~B
1101
A --> B
C = ~A | B
0111