Tutorial 2
Tutorial 2
̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅
5. Write Y = (𝐴 + 𝐵̅ + 𝐶̅ ). (𝐴̅ + 𝐵 + 𝐶̅ ) as a sum-of-products.
6. Write a sum-of-products representation of the output Y of the following circuit, in
terms of the input variables A, B, C. The four gates below are NAND, XOR, OR, and
AND.
Explain how this circuit could be considered as a “read only memory”.
Page 1 of 6
COMPUTER ARCHITECTURE
multiplexor. Instead, merely label the inputs and outputs of this decoder as part of
the multiplexor.]
8. Consider the low order four bits of the adder/subtractor circuit shown below. Label
all wires (inputs, outputs) in the circuit by their value (0 or 1), assuming the circuit
is computing A - B where A = 98 and B = -25. [Do not draw the entire circuit. Only
consider the four lowest order bits for this question.]
9. For the circuit in the previous question, give the values of (S3, S2, S1, S0) in the case
that:
(a) A = -25; B = -39; Binvert = 1
(b) A = 25; B = 39; Binvert = 0
10. Draw a combinational logic circuit of a four input multiplexor where the inputs (X3;
X2; X1; X0) are each one bit variables. Label the values of inputs and outputs of each
gate of the circuit, assuming the four inputs have the values (X3; X2; X1; X0) = (1; 0; 0;
1) and assuming X1 is selected. [Do not draw the decoder circuit which is part of the
multiplexor.],
11. An example of an encoder that you should be familiar with is an output device (an
LCD) that displays a digit from f0; 1; :::; 8; 9g. The digit is defined by \turning on" a
subset of the following line segments. For example, when all seven of the line
segments are on, the output digit is 8, whereas when all lines except L2 are turned
on, the output digit is 0.
Suppose that a user chooses a digit by pressing one of ten buttons. Construct a truth
table from which you could build a combinational circuit. (Don’t build the circuit.
Just build the truth table.)
12. If we add two signed numbers using our n-bit adder circuit, then the result might
give an error in the following sense: it could happen that we add two positive
numbers and the result is a negative number, or we add two negative numbers and
Page 2 of 6
COMPUTER ARCHITECTURE
EXERCISE 2:
1. Define combinational logic.
2. Write the design procedure for combinational circuits?
3. What is Half adder?
4. Draw the logic diagram of half adder using NAND gate.
5. What is Full adder? Draw the truth table of full adder.
6. Draw the Logic diagram of full adder.
7. What is Half subtractor?
8. Draw Full adder using Two half adder.
9. What is Full subtractor? Write the truth table of full subtractor.
10. Draw Full subtractor using two half subtractor.
11. What is Parallel Binary Adder (Ripple Carry Adder)?
12. Draw the logic diagram for four bit binary parallel adder.
13. What is 1’s complement of a number?
14. What is 2’s complement of a number?
15. How Subtraction of binary numbers perform using 2’s complement addition?
16. Given the two binary numbers X = 1010100 and Y = 1000011, perform the
subtraction
(a) X - Y and (b) Y - X by using 2’s complements.
17. Draw the logic diagram of Parallel Binary Subtractor.
18. Draw 1:8 Demux using two 1:4 demux.
19. Draw the logic diagram of 2’s complement adder/subtractor.
20. What is Magnitude Comparator?
21. Design a 1-bit Magnitude Comparator.
22. What is Decoder? What are binary decoders?
Page 3 of 6
COMPUTER ARCHITECTURE
Page 4 of 6
COMPUTER ARCHITECTURE
EXERCISE 5:
1. Two binary numbers A and B are each represented using two bits: A1 A0 for A and B1
B0 for B.
Provide a synthesis of a combinational system designed to determine whether: A=B;
A<B, or A>B.
a) Solve this problem considering the system as a 4-input combinational system with 3
outputs S1, S2, and S3.
b) Solve the same problem by determining S1, S2, and S3 from the result of the
subtraction: A-B
2. A reservoir is supplied by two valves, V1 and V2.
There are three levels: Safety (s), Low (l), and High (h).
When the level is below (s), both valves V1 and V2 are opened.
When the level is between (s) and (l), only valve V1 is opened.
When the level is between (l) and (h), only valve V2 is opened.
When the level is detected by (h), both valves are closed.
QUESTION:
Determine the logical equations for opening the two valves, V1 and V2, according to the
level detected by the 3 sensors (s), (b), and (h).
Note: When the level is detected by a sensor, its state is = 1.
3. A beverage dispenser allows delivering to the consumer:
Page 5 of 6
COMPUTER ARCHITECTURE
- Water
- Grenadine mixed with water
- Mint mixed with water
But it must not allow obtaining:
- Pure grenadine
- Pure mint
- Both grenadine and mint.
The front panel of the dispenser has 3 buttons:
- W (water)
- G (grenadine)
- M (mint)
1) Determine the equation for controlling the opening of the distributor valve.
2) Deduce the corresponding logic diagram.
4. We are interested in an intersection between a main road and a secondary road, for which
we give the operational principle as well as an extract from the functional specifications.
Presence sensors for cars are placed along lanes a and b for the main road, and lanes c
and d for the secondary road. The outputs of these sensors are set to 1 when cars are
detected.
✓ Traffic light F1 is green when there are cars in a and b at the same time.
✓ Traffic light F1 is green when there are cars on either lane a or b and there are no
cars on lanes c or d.
✓ Traffic light F2 is green when there are cars on both lanes c and d, and there are
no cars on lanes a or b.
✓ Traffic light F2 is green when there are cars on either lane c or d, and there are
neither in a nor in b.
✓ Traffic light F1 is green when there are no cars at all.
The variable corresponding to a traffic light is set to 1 when the light is green.
a. Create the truth table that allows translating this problem, with inputs being a,
b, c, and d, and outputs being F1 and F2.
b. Determine the logical equation expressions for F1 and F2 in the form of sum
of products.
c. Graphically simplify the expressions of F1 and F2
Page 6 of 6