Template Assignment 3
Template Assignment 3
Addis Ababa Institute of Technology Before 5:00 PM, or (before 11 o’clock Local Time)
School of Electrical and Computer Engineering
1) Design a logic circuit that computes the 2’s complement of a number B=b3 b2 b1 b0 using only
Exclusive-OR gates and half-adders.
2) Design a circuit that takes a four-bit input A=a3 a2 a1 a0 and checks if A is a prime number. Use
8-to-1 Multiplexer in your design. Recall that a number A is prime if the only numbers that
divide it with no remainder are 1 and A itself. (0 and 1 are defined as not prime).
3) A certain logic circuit has four inputs A, B, C, and D. The output X of the circuit is logic 1 if two
or more inputs are logic 1.
a) Write the truth table for the circuit
b) Implement the function using one decoder with active low output (Use Maxterm).
4) In digital systems it is often necessary to have circuits that can shift the bits of a vector by one
or more-bit positions to the left or right.
Design a circuit that can shift a four-bit vector (W = w3w 2 w1 w0) one bit position to the right
when a control signal Shift is equal to 1. Let the outputs of the circuit be a four-bit vector
(Y = y3y2y1y0) and a signal K, such that if Shift = 1 then y3 = 0, y2 = w3, y1 = w2, y0 = w1, and
K = w0. If Shift = 0 then Y = W (means, y3y2y1y0 = y3y2y1y0 respectively) and K = 0.
(Hint: Use 2x1 Mux circuits to design the above shifter Circuit)
5) Design a counter with the following binary sequence: 1, 2, 5, 7 and repeat. (Treat the unused
states as don’t care conditions)
a) Use JK flip-flops.
b) Use D flip-flops.
1
6) For the given Sequential circuit below
a) Derive excitation equations
b) Derive next state equations
c) Derive a state/output table and
d) Derive State diagram for the circuit
7) Design an UP and DOWN Counter with four States (0,1,2,3) using clocked JK Flip-flops. A
control Signal X is used as follows:
When X=0, the circuit counts forward (UP)
When X=1, the circuit counts backward (DOWN)
8) Design a counter that counts in the BCD Code and the counter has one control signal, X. When
X=1, the counter counts; otherwise, it holds the current state. The Output showing the Value of
the Count is to be in the form of Four Lights. (Use JK Flip flop to construct)
For example, if the count is 3, then the lights would read OFF OFF ON ON
9) The circuit below contains a J-K flip-flop and a D flip-flop. Complete the timing diagram by
drawing the waveforms of signals Q1 and Q2. The initial value of Q1 and Q2 is 0.
2
3