Docsity

Comp 411 Problem Set #5 - Computer Organization - Prof. Montek Singh, Assignments of Computer Architecture and Organization

Toggle sidebar
bg1
Comp 411 - Spring 2008 - 1 - Problem Set #5
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
Comp 411 Computer Organization
Spring 2008
Problem Set #5
Issued Tuesday, 3/18/08; Due Tuesday, 3/25/08
Homework Information: Some of the problems are probably too time consuming to be done the
night before the due date, so plan accordingly. Late homework will not be accepted. Feel free to get
help from others, but the work you hand in should be your own.
Problem 1. Mux Madness (20 points)
During a particularly boring Comp 411 lecture about the universality of NAND and NOR gates,
Chris suddenly realizes that multiplexers are also universal, i.e., any Boolean function can be
implemented by using only multiplexers. At the close of lecture he awakes and jots the following
diagram on the back of his lecture notes:
Help explain Chris’s insight:
a) [15 points] Give binary values for I0, I1, I2, and I3 which implement the following functions
on the two inputs A and B:
(i) Y = XNOR(A,B)
(ii) Y = (A != B)
(iii) Y = (A > B)
b) [5 points] Can every 2-input Boolean function be implemented using the above structure?
If so, explain how; if not explain why not.
0
1
S
0
1
S
0
1
S
A
B
Y
I0
I1
I2
I3
pf3
pf4

Partial preview of the text

Download Comp 411 Problem Set #5 - Computer Organization - Prof. Montek Singh and more Assignments Computer Architecture and Organization in PDF only on Docsity!

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Comp 411 Computer Organization Spring 2008

Problem Set # Issued Tuesday, 3/18/08; Due Tuesday, 3/25/

Homework Information : Some of the problems are probably too time consuming to be done the night before the due date, so plan accordingly. Late homework will not be accepted. Feel free to get help from others, but the work you hand in should be your own.

Problem 1. Mux Madness (20 points)

During a particularly boring Comp 411 lecture about the universality of NAND and NOR gates, Chris suddenly realizes that multiplexers are also universal, i.e., any Boolean function can be implemented by using only multiplexers. At the close of lecture he awakes and jots the following diagram on the back of his lecture notes:

Help explain Chris’s insight: a) [15 points] Give binary values for I 0 , I 1 , I 2 , and I 3 which implement the following functions on the two inputs A and B: (i) Y = XNOR(A,B) (ii) Y = (A != B) (iii) Y = (A > B)

b) [5 points] Can every 2-input Boolean function be implemented using the above structure? If so, explain how; if not explain why not.

0

1 S

0

1 S

0

1 S

A B

Y

I 0

I 1

I 2

I 3

Problem 2. “Go Forth and Multiply” (40 points)

a) [10 points] Design logic to perform the multiplication of two 2-bit unsigned integers, producing a 4-bit result. ( Hint: First write a truth table for each output bit.) Draw a gate- level circuit diagram, i.e., show an implementation using Boolean gates (AND, OR, NOT, XOR, etc.), not using transistors. How many Boolean gates did you use?

b) [10 points] Assume that the 2-bit multiplier that you designed in part a) is represented as the following function block:

(i) Use this function block and single-bit full-adder blocks to build a 4-bit multiplier (a multiplier that takes two 4-bit inputs, and generates an 8-bit result). Note: Do not build the 4-bit multiplier from scratch using basic Boolean gates; you must build it using 2-bit multiplier blocks and full-adder blocks!

(ii) Make a symbol for your 4-bit multiplier showing all the inputs and outputs and call it Mult4, similar to the symbol for Mult2 above.

(iii) How many Boolean gates did your design need in all?

c) [10 points] Design a 4-input 2-bit multiplier using Mult2, Mult4, and full-adder blocks. That is, this unit should take four inputs: A, B, C, and D. Each of these four inputs is a 2- bit number (e.g., A 1 A 0 , etc.).

d) [10 points] Suppose you wanted to compute the fourth power of a 2-bit number. You could do this in two different ways:

(i) You could use your design from part c) above, and feed it the same 2-bit number into all four of its inputs. How many Boolean gates would this need in all?

(ii) Alternatively, you could build a fourth-power circuit from scratch. Write a truth table in which in the input column contains the 2-bit input, and the output column is the 8-bit result. For each of the 8 output bits, give the Boolean equation (circuit not needed). How many Boolean gates are needed for this implementation?

Mult

A 1 A 0 B 1 B 0

P 3 P 2 P 1 P 0

Occasionally you will come across a CMOS circuit where the complementary nature of the n- channel pull-downs and p-channel pull-ups are not obvious, as in the circuit shown below:

d) Construct a table that gives the on-off status of each transistor in the circuit above for all combinations of inputs A and B. e) Compute the output, Y, for each input combination and describe the function of the above circuit.

Vdd

A

B

Y

T1 T

T

T

T2 T

T

T

T Note: When two wires cross they are connected if a dark circle is shown at the intersection. Otherwise, they are not connected.