Sei sulla pagina 1di 17

Chapter 4: Combinational Logic

Q no 1:
Design a Combinational circuit that adds one to a 4-bit binary number, A 3 A2 A1 A0. For
example, If the input of the circuit is A3 A2 A1 A0=1101, the output is 1110. The circuit can
be designed using four Half-adders (HA).

Answer:
Let A3 A2 A1 A0 + 1 = S4 S3 S2 S1 S0

Q no 2:
Design a Combinational logic circuit produces the binary sum of two 2-bit numbers, x 1 x0
and y1 y0. The outputs are C, S1 and S0.

X1 X0 Y1 Y0 c S1 S0
0 0 0 0 0 0 0
0 0 0 1 0 0 1
0 0 1 0 0 1 0
0 0 1 1 0 1 1

0 1 0 0 0 0 1
0 1 0 1 0 1 0
0 1 1 0 0 1 1
0 1 1 1 1 0 0

1 0 0 0 0 1 0
1 1 0 1 1
1 0 0 0 1 0 0
1 0 1 1 1 0 1
0 1

1 1 0 0 0 1 1
1 1 0 1 1 0 0
1 1 1 0 1 0 1
1 1 1 1 1 1 0

Q no 3:
Re-design the combinational circuit stated in Q no 2, using only two full adders.

Q no 5:
Design a combinational circuit that accepts a three-bit number and generates an output
binary number equal to the square of the input number.
Q no 6:
Design a combinational circuit with four input lines that represent a decimal digit in BCD
and for output lines that generate the 9’s compliment of the input digit.
Q no 7:
Design a combinational circuit whose input is a four-bit number and whose output is the 2’s
compliment of the input number.
Q no 8:
Design a combinational circuit that multiplies an input decimal digit represented in BCD by
5. The output is also in BCD. Show that the outputs can be obtained from the input pines
without using any logic gates.
Q no 9:
Design a combinational circuit that detects an error in the representation of a decimal digit
in BCD. In other words, obtain the logic diagram whose output is logic-1 when the inputs
contain an unused combination in the code.
Q no 10:
Implement a full-subtractor with two half-subtractor and an OR gate.
Q no 11:
Show how a full-adder can be converted to a full-subtractor with the addition of one
inverter circuit.
                    Now let us assume to add two number 12 + 7.

                              Number A = 12
                              Number B = 7

                          Binary representation of 12 is 1100


                          Binary representation of 7   is 0111

                                  Let us add both these numbers

                                                   1   1   0   0


                                               + 0   1    1   1
                                              ---------------
                                               1  0  0    1   1     = 19
                                              ----------------

                        So   A + B = 19.

               Subtraction is nothing but addition of 2's compliment.

                         So A - B =  A + (2's complement of B)


                  
                          2' complement of B =  1's complement of B + 1
                          1's complement of B = Inversion of B.

                            B = 0111
                            1's complement of B = 1000
                            2's complement of B = 1001

                           So A + (2' complement of B) =

                                                      1  1  0  0
                                                  + 1  0  0  1
                                                   ------------
                                                   1  0  1  0  1
                                                   ------------
                            Inverting the Carry bit the answer will 0 0 1 0 1 = 5.
                                         So A - B  ; 12 - 7  = 5.

                            Now let us take the case 7 - 12

                                          So A = 7   =  0111


                                                B = 12 =  1100

                                  1's complement of B = 0011


                                  2's complement of B = 0100

                                  A + (2'complement of B) =

                                                       0  1  1  1
                                                 +    0 1  0  0
                                                  --------------
                                                     0  1 0 1  1
                                                   --------------
                                Since the carry bit is 0 inversion of 0 is 1, So the answer is
                                                     1  1  0 1 1

                                Since the sign bit is 1 this number need to be understood as follows.

                                                    1          1 0 1 1
                                               Sign bit    number

                                     In binary whenever sign bit is set the value of the number is 2's
complement of the remaining digits. In this case the value is
                                         2's complement of 1011 =  1's complement 1011 + 1.
                                                                                      =  0100 + 1 = 5.

                                      Since the sign bit is 1 the answer is -5.

                                                  So 7 - 12 = -5

             Now let see how to implement the above logic in digital circuit.
Q no 12:
Design a combinational circuit that converts a decimal digit from

a) The 8, 4, -2, -1 code to BCD.


b) the 2, 4, 2, 1 code to the 8, 4, -2, -1 code
c) The 8, 4, -2, -1 code to Gray code

a) Answer :
d) the 2, 4, 2, 1 code to the 8, 4, -2, -1 code
C ) The 8, 4, -2, -1 code to Gray code
8 4 -2 -1 G3 G2 G1 G0
B3 B2 B1 Bo

0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 1
0 0 1 0 0 0 1 1
0 0 1 1 0 0 1 0
0 1 0 0 0 1 1 0
0 1 0 1 0 1 1 1
0 1 1 0 0 1 0 1
0 1 1 1 0 1 0 0
1 0 0 0 1 1 0 0
1 0 0 1 1 1 0 1
1 0 1 0 1 1 1 1
1 0 1 1 1 1 1 0
1 1 0 0 1 0 1 0
1 1 0 1 1 0 1 1
1 1 1 0 1 0 0 1
1 1 1 1 1 0 0 0

K-Map for G3:


K-Map for G2:

K-Map for G1:

K-Map for G0:


Q no 13:
Design a combinational circuit that converts a four-digit binary number to a decimal
number in BCD.
s

Potrebbero piacerti anche