Assignment 03 Solution Final
Assignment 03 Solution Final
Assignment 03
Exercise 01
A 4-bit binary number is represented as A3A2A1A0, where A0 is the LSB. Design a logic circuit that will
produce a HIGH output whenever the binary number is greater than 0010 and less than 1000.
Solution :
A3 A2 A1 A0 F
0 0 0 0 0
0 0 0 1 0
0 0 1 0 0
0 0 1 1 1
0 1 0 0 1
0 1 0 1 1
0 1 1 0 1
0 1 1 1 1
1 0 0 0 0
1 0 0 1 0
1 0 1 0 0
1 0 1 1 0
1 1 0 0 0
1 1 0 1 0
1 1 1 0 0
1 1 1 1 0
Exercise 02
a. A = 0, B = C = 1
b. X = (A + B) (B + C)’ C
= (A’B + AB’) (BC + B’C’) C
= (A’B + AB’) BC
= A’BC
Exercise 03
a. Design a combinatorial circuit that detects the parity of a 4-bits sequence coded on the inputs A,
B, C and D. The output P = F(A,B,C,D) is equal to 0 if the number of 1’s is even (Ex : 011) and 1
otherwise (Ex:010).
b. Implement this circuit by using (16 x 1) Mux
Solution:
A B C D P
0 0 0 0 0 00 01 11 10
0 0 0 1 1 00 1 1
0 0 1 0 1 01 1 1
0 0 1 1 0
11 1 1
0 1 0 0 1
0 1 0 1 0 10 1 1
0 1 1 0 0
0 1 1 1 1 P = Ʃm(1,2,4,7,8,11,13,14)
1 0 0 0 1
1 0 0 1 0 P=A+ B + C + D
1 0 1 0 0
1 0 1 1 1
1 1 0 0 0
1 1 0 1 1
1 1 1 0 1
1 1 1 1 0
The National Higher School of Artificial Intelligence 2023/2024
Digital systems First Year
Solution
Exercise 04
a. Design the logic circuit that compute the two's complement of a 3 bit binary number.
b. Express the logic diagram of this circuit by using half adders circuits.
c. Express the logic diagram of this circuit by using 8x1 Muxes.
d. Express the logic diagram of this circuit by using 1x8 Demuxes.
Solution :
A B C X Y Z
0 0 0 0 0 0
0 0 1 1 1 1
0 1 0 1 1 0
0 1 1 1 0 1
1 0 0 1 0 0
1 0 1 0 1 1
1 1 0 0 1 0
1 1 1 0 0 1
Exercise 05
Consider the Boolean function : x = ab’ + b’c + a’bc’ . Implement this function by using :
Solution :
x = ab’ + b’c + a’bc’ = ab’ (c + c’) + (a + a’) b’c + a’bc’ = ab’c + ab’c’ + ab’c + a’b’c + a’bc’
x = Ʃm(1,2,4,5)
Methode 02 : (Hint)
Note : the order of a (msb), b and c (lsb) variables is very important in the table above.
For example, if c is the select input of mux, then I0 = c’ and I1 = c. In this case, we need to express I0 and
I1 by combining the a and b variables.
abc = 101
d. A multiplexers (4:1) and logic gates. (Hint : use input b and c as the mux control inputs)
0 (a’) 1 (a) I0 = a
00 (b’c’) I0 0 4
I1 = a’ + a = 1
01 (b’c) I1 1 5
10 (bc’) I2 2 6 I2 = a’
11 (bc) I3 3 7 I1 = 0
The National Higher School of Artificial Intelligence 2023/2024
Digital systems First Year
Solution
Exercise 06
A’ B’ A xnor B A xor B
0 0
1 y
1
2
AB A xnor B
1
3
C
A B
Exercise 07
a. Design the combinational circuit that converts a 3-bit binary number to its gray code.
b. Implement this circuit by using Decoder 3x8 and Or gates.
c. Implement this circuit by using two Decoders 2x4 and Or and Not gates.
Solution :
B2 B1 B0 G2 G1 G0
0 0 0 0 0 0
0 0 1 0 0 1
0 1 0 0 1 1
0 1 1 0 1 0
1 0 0 1 1 0
1 0 1 1 1 1
1 1 0 1 0 1
1 1 1 1 0 0
00 01 11 10
G0 = B2‘ B1‘ B0 + B2‘ B1 B0‘ + B2 B1’ B0 + B2 B1 B0’
0 1 1
G0 = B1‘ B0 + B1 B0’ 1 1 1
G0 = B1 xor B0
Logic diagram :
You can implement this circuit by using only one decoder (3x8) (the best circuit):
The National Higher School of Artificial Intelligence 2023/2024
Digital systems First Year
Solution
In the above implementation, only one decoder 2x4 is activated at a time via an activation signal
(Enabled) called E.
If E = 1, the decoder is enabled
Else (E=0), the decoder is disabled (all its outputs are at 0)
In this implementation, we only use decoders (one decoder (1x2) and two decoders (2x4)) and OR
gates.