Department of Computer Science Panjab University, Chandigarh
Department of Computer Science Panjab University, Chandigarh
Question 1
Multiple Choice and Short Answer
For each multiple choice question, circle your answer. For the short answer problems, please
justify your answers. Responses of ‘yes’ or ‘no’ without an explanation will be worth 0
points.
ii. You are given the 8-bit binary number 1101 0011. Which of the following
matches the proper binary formats to the corresponding decimal translation?
iii. When reducing Boolean expressions, we have used both Boolean algebra and
Karnaugh Maps.
Solution: K-maps are simpler and easier to use than Boolean algrebra, they often require
less time, and they are less prone to errors.
Solution: It is difficult to find some gates (like XOR) in K-maps. Boolean algebra can
find a different form of solution (minimum literals instead of MSP). Boolean algebra
scales more easily for > 4 variables.
2
Name: _____________________
iv. Look at the following groupings of the same function with don’t cares:
y y
0 0 0 0 0 0 0 0
X X 1 1 X X 1 1
x x
0 X X X 0 X X X
w w
0 1 1 0 0 1 1 0
z z
i. ii.
A) Derive the two MSP equations based on the groupings in i. and ii.
Solution:
i. w’x + wz
ii. xy + wz
B) Are the two equations from A) logically equivalent? Justify your answer.
Solution: The equations x’w + wz and xy + wz are NOT logically equivalent. The
easiest way to show this is to look at the input (w,x,y,z) = 0100. In i., this gives 11 + 00
= 1. In ii., it gives 10 + 00 = 0. Since the equations give different outputs for the same
input, they are not logically equivalent.
You can also show this by constructing truth tables for each equation.
3
Name: _____________________
Question 2
Circuit Analysis
d
g
e
a. Derive the truth table for the function H(A,B,C). You may opt to use the
intermediate steps (d,e,f,g), but doing so is not required.
b. Express H(A,B,C) as a sum of minterms, based on your truth table from a).
4
Name: _____________________
Question 2 (Cont’d.)
Solution:
B
1 0 1 1
A 1 0 0 1
C
H(A,B,C) = A’B + C’
5
Name: _____________________
Question 3
Signed 2’s Complement and Subtraction
a. Assume that the 3-bit numbers listed below are in signed magnitude
format. Translate them to signed two’s complement form.
b. For 3-bit binary numbers, what value can be represented in signed two’s
complement form that can’t be represented in signed magnitude form? Explain the
reason for this briefly.
Solution: (-4) can be represented in signed two’s complement, but it can’t be represented
in signed magnitude form. Here are some of the acceptable explanations:
· The range of 3-bit signed two’s complement numbers is –4 to 3, while the
range for signed magnitude is –3 to 3.
· Signed magnitude has two forms for 0, 000 (0) and 100 (-0). Because of this,
it can’t represent the value represented by 100 in signed 2’s complement,
which equals -4.
· In 3-bit signed magnitude, the first bit is used only for the sign, while the
remaining two bits determine the value. Three bits are needed to represent the
magnitude of –4, which is 4. This is why –4 can’t be represented in 3-bit
signed magnitude.
6
Name: _____________________
This implementation is incorrect, however. For both possible values of S, state what
value G is, in terms of an arithmetic operation on X, assuming that there is no
overflow.
c. There are two ways that this circuit could be fixed by only changing one of the
adder inputs. Briefly state what inputs should be changed, and to what. (6 points
for one solution, 4 points for the second)
Solution:
· A0 could be changed to permanently be 1. So when S = 0, A = 0001,
while when S = 1, A = 1111 = -1, which produces the effect we want.
· CI could be changed to S. When S = 0, G = X + 0001 + 0 = X + 1. When
S = 1, G = X + 1110 (-2) + 1 = X + 1111 (-1) = X – 1.
7
Name: _____________________
Question 4
Demultiplexer
Your task is to design a 1-to-8 demultiplexer from scratch. You are permitted to use any
gates that we have used and any larger parts we have studied, such as decoders and
multiplexers. You can use block symbols for decoders or multiplexers, but make sure inputs
and outputs are clearly labeled. Output lines on the demultiplexer should be labeled D0-D7,
and selection inputs should be labeled S0-S2. The data input should be labeled as X.
Show all your work, and explain why your circuit implements a demultiplexer.
Solution: The two key parts to solving this were, first, to see that the demultiplexer functions
in a similar fashion to a decoder, which only transmits a 1 to the selected output and 0 to
every other output, and second, to make it so that the input X was transmitted to the
appropriate output instead of a 1. Two possible solutions are shown below.