0% found this document useful (0 votes)
9 views9 pages

Digital Logic and Design Mid Term Question Q1. 1'S & 2'S Compliment of

The document contains a mid-term exam on digital logic and design, including questions on 1's and 2's complements, Boolean function simplifications, and logic diagram constructions. It covers various topics such as converting binary, hexadecimal, octal, and base-5 numbers to decimal, as well as implementing Boolean functions using NAND and NOR gates. Additionally, it includes Karnaugh map simplifications and detailed logic diagram descriptions for given Boolean functions.

Uploaded by

hammadnaeem437
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views9 pages

Digital Logic and Design Mid Term Question Q1. 1'S & 2'S Compliment of

The document contains a mid-term exam on digital logic and design, including questions on 1's and 2's complements, Boolean function simplifications, and logic diagram constructions. It covers various topics such as converting binary, hexadecimal, octal, and base-5 numbers to decimal, as well as implementing Boolean functions using NAND and NOR gates. Additionally, it includes Karnaugh map simplifications and detailed logic diagram descriptions for given Boolean functions.

Uploaded by

hammadnaeem437
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

DIGITAL LOGIC AND DESIGN MID TERM QUESTION

Q1. 1’S & 2’S COMPLIMENT OF


i) 100 100 00
ii) 110 110 10
iii) 11 11 11 11
ANS: 1's and 2's Complements
1's Complement:
Invert all the bits (change 0s to 1s and 1s to 0s).
2's Complement:
Find the 1's complement and add 1 to it.
Calculations
1) 10010000
1's complement: 01101111
2's complement: 01110000

2) 11011010
1's complement: 00100101
2's complement: 00100110

1's Complement: To find the 1's complement, simply invert


each bit (0 becomes 1, and 1 becomes 0).
3) 11111111 (Original number)
(1's complement)
2's Complement: To find the 2's complement, add 1 to the 1's
complement.
(1's complement)
+ 1
----------
(2's complement)
So, for the binary number 11111111:
1's complement is 00000000
2's complement is 00000001

Q2: F= XZ + X’Z’ + X’Y’


a)with NAND & wit h inverter gates
b)with NOR & with inverter gates
(a) with NAND and Inverter gates

1. Simplify the function (optional but can lead to a more efficient


implementation): We can't simplify this function much further
directly.
2. Implement using only NAND gates (using De Morgan's Laws):
o Recall that A⋅B= (A′+B′)′ and A+B=(A′⋅B′)′. Also, A′=
(A⋅A)′=(A+A)′.
o Start with the original function: F= xz+ x′z′ +x′ y
o Replace each OR operation with NAND gates: $F = (xz)' ' +
(x'z')' ' + (x'y)' '$ F=((xz)′⋅(x′z′)′⋅(x′y)′)′
o Now, implement each term using NAND gates:
 (xz)′ requires one NAND gate with inputs x and z.
 (x′z′)′ requires one NAND gate with inputs x′ and z′. To get
x′ and z′, we need inverters (which can be made from
NAND gates by connecting both inputs).
 (x′y)′ requires one NAND gate with inputs x′ and y. Again,
x′ needs an inverter.
o Finally, the overall function is a NAND of the results of these
three NAND gates.
Logic Diagram (Conceptual):

o Inverter for x: x connected to both inputs of a NAND gate.


Output is x′.
o Inverter for z: z connected to both inputs of a NAND gate.
Output is z′.
o NAND gate 1: Inputs x and z. Output is (xz)′.
o NAND gate 2: Inputs x′ and z′. Output is (x′z′)′.
o NAND gate 3: Inputs x′ and y. Output is (x′y)′.
o Final NAND gate: Inputs are the outputs of NAND gate 1,
NAND gate 2, and NAND gate 3. The output of this final NAND
gate is F.

(b) with NOR and Inverter gates

1. Simplify the function (optional): Still no significant direct


simplification.
2. Implement using only NOR gates (using De Morgan's Laws):
o Recall that A⋅B=(A′+B′)′ and A+B=(A′⋅B′)′. Also,
A′=(A+A)′=(A⋅A)′.
o Start with the original function: F=xz+x′z′+x′y
o Apply De Morgan's Law to change the OR operations to NOR:
F′=(xz+x′z′+x′y)′=(xz)′⋅(x′z′)′⋅(x′y)′ F′=(x′+z′)⋅(x+z)⋅(x+y′)
o Now, apply De Morgan's Law again to the product terms to get
sums: F′=((x′+z′)′+(x+z)′+(x+y′)′)′
o Therefore, F=((x′+z′)′+(x+z)′+(x+y′)′)′
o Implement each term using NOR gates:
 (x′+z′)′ requires one NOR gate with inputs x′ and z′. To get
x′ and z′, we need inverters (which can be made from
NOR gates by connecting both inputs).
 (x+z)′ requires one NOR gate with inputs x and z.
 (x+y′)′ requires one NOR gate with inputs x and y′. To get
y′, we need an inverter.
o Finally, the overall function is a NOR of the results of these
three NOR gates.

Logic Diagram (Conceptual):

o Inverter for x: x connected to both inputs of a NOR gate. Output


is x′.
o Inverter for z: z connected to both inputs of a NOR gate. Output
is z′.
o Inverter for y: y connected to both inputs of a NOR gate. Output
is y′.
o NOR gate 1: Inputs x′ and z′. Output is (x′+z′)′.
o NOR gate 2: Inputs x and z. Output is (x+z)′.
o NOR gate 3: Inputs x and y′. Output is (x+y′)′.
o Final NOR gate: Inputs are the outputs of NOR gate 1, NOR
gate 2, and NOR gate 3. The output of this final NOR gate is F.

Question 3: Simplify the Boolean function


F=A′BC′+B′CD′+A′BCD′+AB′C′

We can use Boolean algebra laws to simplify this:

F = A'BC' + B'CD' + A'BCD' + AB'C'

Group terms with common factors:


F = A'BC' + B'C(D' + AD') + A'BCD'
F = A'BC' + B'CD'(1 + A) + A'BCD'
F = A'BC' + B'CD' + A'BCD'

Group terms with common factors again:


F = A'BC' + CD'(B' + A'B)
F = A'BC' + CD'(B'(1 + A') + A'B)
F = A'BC' + CD'(B' + A'B) // This doesn't seem to simplify nicely

Let's try another grouping:


F = A'C'(B + B'D) + B'CD'
F = A'C'(B + D) + B'CD'
F = A'BC' + A'C'D + B'CD'

Consider the second and third terms:


A'C'D + B'CD' = CD'(A' + B')
So, F = A'BC' + CD'(A' + B')
F = A'BC' + A'CD' + B'CD'

This seems to be one of the simplest forms. We can also try using
a Karnaugh map (K-map) for a more systematic simplification, but
with four variables, it might be a bit tedious here. The algebraic
simplification above gives us:

F=A′BC′+A′CD′+B′CD′

Question 4: Express the following numbers into decimal:

(i) (10110.0101)2
(1 * 2^4) + (0 * 2^3) + (1 * 2^2) + (1 * 2^1) + (0 * 2^0) + (0 * 2^-1) + (1 * 2^-2) + (0 * 2^-3) + (1 *
2^-4)
= 16 + 0 + 4 + 2 + 0 + 0 + 0.25 + 0 + 0.0625
= 22 + 0.3125
= 22.3125_{10}

(ii) (16.5)16
(1 * 16^1) + (6 * 16^0) + (5 * 16^-1)
= 16 + 6 + (5 / 16)
= 22 + 0.3125
= 22.3125_{10}

(iii) (26.24)8
(2 * 8^1) + (6 * 8^0) + (2 * 8^-1) + (4 * 8^-2)
= 16 + 6 + (2 / 8) + (4 / 64)
= 22 + 0.25 + 0.0625
= 22.3125_{10}

(iv) (4310)5
(4 * 5^3) + (3 * 5^2) + (1 * 5^1) + (0 * 5^0)
= (4 * 125) + (3 * 25) + (1 * 5) + 0
= 500 + 75 + 5
= 580_{10}

(v) (198)12
(1 * 12^2) + (9 * 12^1) + (8 * 12^0)
= (1 * 144) + (9 * 12) + (8 * 1)
= 144 + 108 + 8
= 260_{10}

(vi) (445)8
(4 * 8^2) + (4 * 8^1) + (5 * 8^0)
= (4 * 64) + (4 * 8) + 5
= 256 + 32 + 5
= 293_{10}

(vii) (345)6
(3 * 6^2) + (4 * 6^1) + (5 * 6^0)
= (3 * 36) + (4 * 6) + 5
= 108 + 24 + 5
= 137_{10}

Question 5: F=D+BC+(D+C′)(A′+C). Draw the logic diagram of


the given Boolean function.

Let's break down the function to draw the logic diagram:

1. Term 1: D - This is a single input.


2. Term 2: BC - This requires an AND gate with inputs B and
C.
3. Term 3: (D+C′) -
o First, we need C′, which is a NOT gate with input C.
o Then, we need an OR gate with inputs D and C′.
4. Term 4: (A′+C) -
o First, we need A′, which is a NOT gate with input A.
o Then, we need an OR gate with inputs A′ and C.
5. Finally, the overall function F is the OR of Term 1, Term
2, and the AND of Term 3 and Term 4.
Logic Diagram Description:

 Draw four input lines labeled A, B, C, and D.


 Draw a NOT gate with input A. The output is A′.
 Draw a NOT gate with input C. The output is C′.
 Draw an AND gate with inputs B and C. The output is BC.
 Draw an OR gate with inputs D and C′. The output is (D+C′).
 Draw an OR gate with inputs A′ and C. The output is (A′+C).
 Draw an AND gate with inputs (D+C′) and (A′+C). The output
is (D+C′)(A′+C).
 Finally, draw a three-input OR gate with inputs D, BC, and
(D+C′)(A′+C). The output of this OR gate is F.
LOGIC DIAGRAM : A --- NOT --- A' ---+
|
B -------------------+--- AND --- BC ----+
| |
C --- NOT --- C' ---+ |
| |
D -------------------+ |
| |
C -------------------+--- OR ---- (A'+C) -+--- AND --- (D+C')(A'+C) ---+
| |
D -------------------+--- OR ---- (D+C') -------------------------------+
|
|
D ---------------------------------------------------------------------+
|
+--- OR --- F
|
BC --------------------------------------------------------------------+
|
(D+C')(A'+C) -----------------------------------------------------------+

Key to Symbols:

 ---: Wire connection


 NOT: Triangle with a bubble at the output
 AND: D-shaped gate
 OR: Crescent-shaped gate

Question 6: F(w,x,y,z)=Σm(0,1,2,4,5,6,8,9,12,13). Simplify the


Boolean function.

We will use a Karnaugh map (K-map) for this simplification.


| wx\yz | 00 | 01 | 11 | 10 |

| :----: | :--: | :--: | :--: | :--: |

| 00 | 1 | 1 | 0 | 1 | (m0, m1, m3, m2)

| 01 | 1 | 1 | 0 | 1 | (m4, m5, m7, m6)

| 11 | 1 | 0 | 0 | 1 | (m12, m13, m15, m14)

| 10 | 1 | 1 | 0 | 0 | (m8, m9, m11, m10)

Now, let's group the 1s to find the minimal terms:

 Group 1: The four 1s in the first column (m0, m4, m12, m8)
cover where y′z′ is constant. This group corresponds to the
term y′z′.
 Group 2: The two 1s in the first row, first two columns (m0,
m1) cover where w′x′z′ is constant. This group corresponds
to the term w′x′z′.
 Group 3: The two 1s in the second row, first two columns
(m4, m5) cover where w′xz′ is constant. This group
corresponds to the term w′xz′.
 Group 4: The two 1s in the fourth row, first two columns
(m8, m9) cover where wx′z′ is constant. This group
corresponds to the term wx′z′.
 Group 5: The two 1s in the third row, first and last columns
(m12, m13) cover where wxy′ is constant. This group
corresponds to the term wxy′.

Let's try to find a better grouping:

 Group 1: The four corner 1s (m0, m2, m8, m10 - note m3


and m11 are 0) can be grouped if we consider the K-map as
wrapping around. This group covers where x′z′ is constant.
So, the term is x′z′.
 Group 2: The four 1s in the first two columns of the first two
rows (m0, m1, m4, m5) cover where w′z′ is constant. So, the
term is w′z′.
 Group 3: The two 1s in the first column of the last two rows
(m8, m12) cover where wy′z′ is constant. So, the term is
wy′z′.
 Group 4: The two 1s in the second column of the last two
rows (m9, m13) cover where wy′z is constant. So, the term is
wy′z.

Let's try another grouping to minimize terms:

 Group 1: The four 1s in the first column (m0, m4, m12, m8):
This corresponds to y′z′.
 Group 2: The two adjacent 1s in the first row (m0, m1): This
corresponds to

You might also like