Assignment 5


 

P1. A 2-bit comparator circuit receives two 2-bit unsigned numbers P = P1P0 and Q = Q1Q0.  Write the truth table for a design that produces an output 1 if P ≤ Q.  (If necessary, refer to text section 6.5 (p. 320) on arithmetic comparison)

 

P1 P0 Q1 Q0

C

0     0    0    0

 

0    0    0    1

 

0    0    1    0

 

0    0    1    1

 

0    1    0    0

 

0    1    0    1

 

0    1    1    0

 

0    1    1    1

 

1    0    0    0

 

1    0    0    1

 

1    0    1    0

 

1    0    1    1

 

1    1    0    0

 

1    1    0    1

 

1    1    1    0

 

1    1    1    1

 

 

 

(b)   Minimize the expression for function C using Karnaugh map in sum of products form. A K-map blank is provided for your convenience,.  (Refer to text section 4.1 (pp. 150-158) on Karnaugh maps)

 

     P1 P0  Q1 Q0

0  0

0  1

1   1

1  0

       0  0

 

 

 

 

       0  1

 

 

 

 

       1  1

 

 

 

 

       1  0

 

 

 

 

 

            C =

           

(c)    Minimize the expression for function C in products of sums form.

 

C =

 

(d) Draw the circuit for the expression in (c) using NOR gates only.

 


P2. The circuit as shown consists of four 2-position switches, lamp and a power source. Write a truth table of all the possible combinations of switch positions; assign a 1 for the condition of a switch being closed and for the condition of lamp being lit.

 

 

 

 

 


 

 

 

 

 

 

A    B   C   D

L

0     0    0    0

 

0    0    0    1

 

0    0    1    0

 

0    0    1    1

 

0    1    0    0

 

0    1    0    1

 

0    1    1    0

     

0    1    1    1

 

1    0    0    0

 

1    0    0    1

 

1    0    1    0

 

1    0    1    1

 

1    1    0    0

 

1    1    0    1

 

1    1    1    0

 

1    1    1    1

 

 

(b) Write a logic equation for function L in the simplest form possible by inspection.

 

            L =

 

(c) Implement the above circuit using one 4-to-1 multiplexer and one 2-input OR gate.

 


P3. A safety feature in a car does not allow the engine to start when ignition switch is turned on if either

 

-         The doors (D) are closed and seat belt (S) is unbuckled

-         Seat belt (S) is buckled and parking brake (B) is on

-         Parking brake (B) is off and doors (D) are not closed.

 

Use a truth table to write a sum-of-products expression allowing the car to start when the switch is turned on. Draw the circuit.


P4. Write a truth table for a full adder circuit that adds 3 1-bit inputs, A, B, and CI, and produces two bit outputs Sum and CO. Notice that a carry is always generated by this stage if A= B = 1, and a carry is propagated (CO = CI) if either A = 1 or B =1 (both being 1 need not be considered as in that carry is always generated).  Refer to text section 5.4.1 (pp. 255-262) for information on Carry-Lookahead adders.

 

(a)    Write logic expressions for carry generate (g) and carry propagate (p).

 

(b)   Write the equation for sum using propagate and CI inputs.

 

(c)    Implement carry out function using a single 2-to-1 multiplexer. Draw a complete one-bit full adder using an AND gate, two XOR gates, and one 2-to-1 multiplexers.