VL2019205005389 Da PDF
VL2019205005389 Da PDF
VL2019205005389 Da PDF
1. A sequential circuit has three flip-flops A, B, C; one input x; and one output, y. The state
diagram is shown in Fig.P5-19. The circuit is to be designed by treating the unused states
as don’t-care conditions. Analyze the circuit obtained from the design to determine the
effect of the unused states.
a) Use D flip-flops in the design
b) Use J-K flip-flops in the design
3. A flow rate sensing device used on a liquid transport pipeline functions as follows. The
device provides a 5-bit output where all five bits are zero if the flow rate is less than 10
gallons per minute. The first bit is 1 if the flow rate is at least 10 gallons per minute; the first
and second bits are 1 if the flow rate is at least 20 gallons per minute; the first, second, and
third bits are 1 if the flow rate is at least 30 gallons per minute; and so on.The five bits,
represented by the logical variables A, B, C, D, and E, are used as inputs to a device that
provides two outputs Y and Z.
(a) Write an equation for the output Y if we want Y to be 1 iff the flow rate is less than 30
gallons per minute.
(b) Write an equation for the output Z if we want Z to be 1 iff the flow rate is at least 20
gallons per minute but less than 50 gallons per minute.
4. Draw a state diagram for a mealy type state machine specified as follows:
- Denote "a" the initial state of the machine
- set the initial output to the initial input (the input is presented to the machine bit by bit)
- The output changes value only when three successive inputs have the same value and that
value is opposite to the current output. For example, if the current output is 1 and the
machine detects three consecutive 0 it changes the output to 0.
design the circuit using D – FF and write the verilog HDL.
5. Design the 4 bit 7311 code to 53-1-1 code and write the Verilog HDL using if else statement.
SET – 4
1. A combinational circuit is divided into two subcircuits N1 and N2 as shown. The truth
table for N1 is given. Assume that the input combinations ABC = 110 and ABC = 010
never occur. Change as many of the values of D, E, and F to don’t-cares as you can
without changing the value of the output Z.
4. Identify each of the following expression as SOP, POS and its canonical form
respectively
a. AB ABD AC D
5. Design a finite state machine (FSM) for a counter that counts through the 3-bit prime
numbers downwards. Assume the counter starts with initial prime value set to 010 as its
first 3 bit prime number. You need to provide the state transition table and the state
transition diagram. Assume that the state is stored in three D-FFs. Write the HDL code
and simulate
Hint: The set of all 3-bit prime numbers includes 2, 3, 5 and7.
6. Gray codes have the useful property that consecutive numbers differ in only a single bit
osition. Design a 3-bit Gray code counter FSM with no inputs and three outputs. When
reset, the output should be 000. On each clock edge, the output should advance to the
next Gray code. After reaching 100, it should repeat with 000. Draw a schematic for this
counter using T flip-flops.
SET – 8
F = π(0,1,3,5,6,9,10,13,14)
2. Design an excess-3 code converter to drive a seven-segment indicator. The four
inputs (A, B, C, D) to the converter circuit represent an excess-3 digit. Input
combinations representing the numbers 0 through 9 should be displayed as decimal
digits. The input combinations 0000, 0001, and 0010 should be interpreted as an
error, and an “E” should be displayed. Assume that the input combinations 1101,
1110, and 1111 will never occur. Design your circuit using only two-, three-, and four
input NOR gates and inverters. Any solution with 18 or fewer gates and inverters (not
counting the four inverters for the inputs) is acceptable.
5. An up-down mod-4 binary counter has a single input x, such that the it counts up if x=0
and counts down if x=1:
Draw the Mealy state diagram of the circuit.
* Draw the state Moore diagram of the circuit.
* Implement both circuits using negative-edge triggered D-FFs.
iii. F = M(3,7,8,10,12,13)
3. Simplify the following using K – map to SOP and POS
i. f = M(0,3,5,6,8,10)+d(11,13,14)
ii. F ( A, B, C , D ) A B D
iii. F = ∑(21,7,30,2,8,15,19,3) + d(0,18,15,6)
4. Design a Code Converter to convert 24-2-1 code to 2421 code
5. Given the enclosed hardware circuit, write/simulate the equivalent Verilog code.
1. The east-west (E-W) traffic light will be green whenever both lanes C
and D are occupied.
2. The E-W light will be green whenever either C or D is occupied but
lanes A and B are not both occupied.
3. The north-south (N-S) light will be green whenever both lanes A and B
are occupied but C and D are not both occupied.
4. The N-S light will also be green when either A or B is occupied while C
and D are both vacant. 5. The
E-W light will be green when no vehicles are present. Using the sensor outputs A,
B, C, and D as inputs, design a logic circuit to control the traffic light.There
should be two outputs, N-S and E-W, that go HIGH when the corresponding light
is to be green. Simplify the circuit as much as possible and show all steps.
4. CONVERT THE FOLLOWING
i. 1010110110.10011 = ___________9, ___16,H
ii. 781.78 = _______4, 2, H
iii. 6A5D.E0 = ___________2,8,7
5. find the SOP for the following using K –Map
i. f(a,b,c,d) = ∑(0,2,3,4,7,8,10,13,14,15)
ii. f = ∏(0,2,4,6,7,8,13)∙D(1,12,10,15)
iii x ' z w' xy ' w( x ' y xy ' )
6. Simplify the following using Boolean expression
i. (𝐴 + 𝐶 )(𝐴𝐷 + 𝐴𝐷) + 𝐴𝐶 + 𝐶
iii. ab bc ca ab b c c a
SET – 17
1. A manufacturing plant needs to have a horn sound to signal quitting time. The horn should
be activated when either of the following conditions is met:
a. It’s after 5 o’clock and all machines are shut down.
b. It’s Friday, the production run for the day is complete, and all machines are
shut down.
c. Design a logic circuit that will control the horn. (Hint: Use four logic input
variables to represent the various conditions; for example, input A will be
HIGH only when the time of day is 5 o’clock or later.)
2. Simplify using K – Map and give the SOP and POS
i. F = m(7,13,5,30,17,5,27,8,14,19)+d(0,11,12,15,21)
ii. Y = C ( A B D D ) A BC D
iii. Determine the minimum expression for each K map given below
1. Write the Verilog code using if else condition and truth table for the circuit given below.
AB ABD AC D
SET – 19
in each case determine the values of the four SUM outputs, the carry C, and
overflow V.
4. Design a code converter to convert gray code to 2421.
5. Design and write the Verilog HDL for 4 bit parallel multiplier.
6. Draw the Mealy state diagram and state table for a serial even parity checker. The
circuit receives a word of 4-bits serially on its single input X and produces the even
parity bit after the fourth bit is received. The single output Z remains 0 except when
the final (fourth) bit is received and the total number of 1’s in the word is odd. The
machine returns to the reset initial state after the 4th input bit. Design the circuit
using T– FF and write the code using gate level and dataflow.
SET – 20
1. Write Verilog code that represents the circuit in Figure below. Use the dec2to4
module as a subcircuit in your code using case statement.
2. For the given code give the hardware equivalent circuit and convert the code
using case statement.
module setj(input logic resetn, clock,
input logic start, stop,
input logic load, serial_in,
input logic [7:0] parallel_in,
output logic parity);
logic shift_left;
logic[7:0] shift_register;
always_ff @(posedge clock or negedge resetn)
begin
if (!resetn) begin
shift_left <= 1'b0;
shift_register <= 8'd0;
end else begin
if (start) shift_left <= 1'b1;
if (stop) shift_left <= 1'b0;
if (shift_left) shift_register <= {shift_register[6:0],serial_in};
else if (load) shift_register <= parallel_in;
end
end
always_comb begin
parity = ^shift_register;
end
endmodule
3. Fig. below shows a diagram for an automobile alarm circuit used to detect certain
undesirable conditions. The three switches are used to indicate the status of the
door by the driver’s seat, the ignition, and the headlights, respectively. Design the
logic circuit with these three switches as inputs so that the alarm will be activated
whenever either of the following conditions exists:
A B C A BC AB C ABC A B C A B C
2. Implement the following Boolean functions with only one 4:1 multiplexer:
a. F(w, x, y, z) = m(2, 3, 5, 6, 11, 14, 15)
b. F(w, x, y, z) = M(3, 10, 11)
3. Perform the following
(i) 1001100-110011 using 1’s complement subtraction
(ii) 93 – 14 using 1’s complement
(iii) 87 – 6 using 2’s complement
4. Convert the following
i. 1111111012 = _______4,10, H
ii. 8AF2.E9 = _________2, 8, 10
5. Design a 1-bit decrementer (a circuit which subtracts 1). Give
(a) the arithmetic relationship between input and out put signals
(b) the truth table,
(c) logic diagram.
Design a logic diagram of a 1-bit increment/decrement circuit controled by an id signal
(increment when id = 1, decrement otherwise). Write the HDL.
And Design a block diagram of a 4-bit increment/decrement circuit. Use the above HDL
and concatenate.
6. Design a sequential circuit that works as a traffic light controller. The circuit does
not have any data inputs (the clock and asynchronous reset are obviously available) and it
has three data outputs: Red, Green and Yellow. After reset the circuit will activate Red for
200 clock cycles, then it will activate Green for 200 clock cycles and then it will activate
Yellow for 20 clock cycles (this sequence will repeat itself). While one output signal is
turned on the other two output signals are deactivated. Derive the data-path elements and
the FSM in the control-path. Write/simulate the Verilog code to verify the entire design.
SET – 24
1. A computer interface to a line printer has seven data lines that control the movement of the
paper and the print head and determine which character to print. The data lines are labeled A,
B, C, D, E, F, and G, and each represents a binary 0 or 1. When the data lines are interpreted
as a 7-bit binary number with line A being the most significant bit, the data lines can represent
the numbers 0 to 12710. The number 1310 is the command to return the print head to the
beginning of a line, the number 1010 means to advance the paper by one line, and the
numbers 3210 to 12710 represent printing characters.
(a) Write an equation for the variable X which is 1 iff the data lines indicate a command
to return the print head to the beginning of the line.
(b) Write an equation for the variable Y which is 1 iff there is an advance paper command on
the data lines.
(c) Write an equation for the variable Z which is 1 iff the data lines indicate a printable
character. (Hint: Consider the binary representations of the numbers 0–31 and 32–127 and
write the equation for Z with only two terms.)
iii. F = M(3,7,8,10,12,13)
4. Analyze the shift register and draw state diagram and state table for the que 1. (Please take the help of
the initiated state diagram with eight states shown below, but draw your own figure to answer).
6. Fig. below shows a diagram for an automobile alarm circuit used to detect certain
undesirable conditions. The three switches are used to indicate the status of the door by
the driver’s seat, the ignition, and the headlights, respectively. Design the logic circuit
with these three switches as inputs so that the alarm will be activated whenever either of
the following conditions exists:
in each case determine the values of the four SUM outputs, the carry C, and overflow V.
3. Design the 4 bit 2421 code to 53-1-1 code and write the Verilog HDL using if else
statement.
4. A PN flip-flop has four operations: clear to 0, no change, complement, and set to 1,
when inputs P and N are 00, 01, 10, and 11, respectively.
a) Tabulate the characteristic table.
b) Derive the characteristic equation.
c) Tabulate the excitation table.
d) Show how the PN flip-flop can be converted to a D flip-flop.
5. A combinational circuit has four inputs (A, B, C, D) and three outputs (X, Y, Z). XYZ represents a
binary number whose value equals the number of 1’s at the input. For example if ABCD = 1011,
XYZ = 011.
(a) Find the minterm expansions for X, Y, and Z.
(b) Find the maxterm expansions for Y and Z.
6. Write the HDL for 4 bit Ladner Fishcer adder.
SET – 31
1. Write the HDL for 4 bit Han Calrson adder.
2. Each of three coins has two sides, heads and tails. Represent the heads or tails status of each coin
by a logical variable (A for the first coin, B for the second coin, and C for the third) where the
logical variable is 1 for heads and 0 for tails. Write a logic function F(A, B, C) which is 1 iff
exactly one of the coins is heads after a toss of the coins. Express F
a. as a minterm expansion.
b. as a maxterm expansion.
3. Draw the circuit using only NAND gate.
4. Find the complements of the following expressions:
(a) (x + y’)(x’ + y)
(b) (A’B + CD)E + E’
(c) (x’ + y’ + z)(x + y)(x + z’)
5. Given the enclosed hardware circuit, write/simulate the equivalent Verilog code.
6. A sequential circuit has an input (X) and outputs (Y and Z). YZ represents a 2-bit binary number
equal to the number of 1’s that have been received as inputs. The circuit resets when the total
number of 1’s received is 3, or when the total number of 0’s received is 3. Find a Moore state
graph and table for the circuit.
SET – 32
1. Convert the following NOR-to-OR gate network to a NAND-to-NAND gate network.
Use as minimum gates as possible.
4. Convert the decimal numbers +75 and +32 to 8-bit hexadecimal numbers, using the
signed 2’s complement representation. Then perform the following operations: (a)
(+95) + (−32), (b) (−75) + (+42), (c) (−75) + (−32). Convert the answers back to
decimal and verify that they are correct.
5. Write the HDL for 4 bit carry Skip adder
6. A combinational circuit (using only NAND) has four inputs (A, B, C, D) and four
outputs (W, X, Y, Z). WXYZ represents an excess-3 coded number whose value equals
the number of 1’s at the input. For example, if ABCD = 1101, WXYZ = 0110.
(a) Find the minterm expansions for X, Y, and Z.
(b) Find the maxterm expansions for Y and Z.
SET – 33
1. Design a sequential circuit with two D Flip-Flops, A and B, and one input x. When x = 0,
then the state of the circuit remains the same. When x =1, the circuit goes through the state
transitions from 00 to 01 to 11 to 10 back to 00, and repeats.
2. Simplify the following Boolean functions, using 4-variable maps:
a. w’z + xz + x’y + wx’z
b. wxy + yz + xy’z + x’y
5. Given the enclosed source code, draw the equivalent hardware circuit. Draw also
the periodic waveforms on the output signals f and g. If the reference clock is 200 MHz,
then what are the frequencies of signals f and g ?
module setm(input logic resetn, clock,
output logic f, g);
logic[9:0] counter;
always_ff @(posedge clock or negedge resetn)
if (!resetn) begin
counter <= 10'h000;
f <= 1'b0;
g <= 1'b0;
end else begin
f <= 1'b1;
if (counter > 10'd50 && counter < 10'd250) f <= 1'b0;
g <= 1'b0;
if (counter > 10'd150 && counter < 10'd400) g <= 1'b1;
if (counter < 10'd900) counter <= counter + 10'd1;
else counter <= 10'd0;
end
endmodule
6. Design a sequential circuit using JK - FF to convert excess-3 code to BCD. This
circuit adds three to a binary-coded-decimal digit in the range 0 to 9.The input and
output will be serial with the least significant bit first.
SET – 34
1. Design and write the Verilog HDL for code converter 2421 to 84-2-1 using case statement.
2. Draw the Moore state diagram and state table for a serial even parity checker. The circuit
receives a word of 4-bits serially on its single input X and produces the even parity bit
after the fourth bit is received. The single output Z remains 0 except when the final
(fourth) bit is received and the total number of 1’s in the word is odd. The machine returns
to the reset initial state after the 4th input bit. Design the circuit using RS – FF and write
the code using gate level and dataflow.
3. Construct a 4-to-16-line decoder with five 2-to-4 line decoders with enable.
4. Implement the following Boolean function with only one 4:1 multiplexer:
F(A, B, C, D) = (0, 1, 3, 4, 8, 9, 15)
Consider A and D as Selection lines.
5. Given the enclosed source code, draw the equivalent hardware circuit.
module setp(input logic c1, c2, c3, a, b,
output logic f, g);
always_latch
begin
if (c1) begin
f = a;
g = b;
end else if (c2) begin
f = b;
end else if (c3) begin
g = a;
end
end
endmodule
6. Design a 1-bit decrementer (a circuit which subtracts 1). Give
(a) the arithmetic relationship between input and out put signals
(b) the truth table,
(c) logic diagram.
Design a logic diagram of a 1-bit increment/decrement circuit controled by an id signal
(increment when id = 1, decrement otherwise). Write the HDL.
And Design a block diagram of a 4-bit increment/decrement circuit. Use the above HDL
and concatenate.
SET – 35
1. An 8 x 1 multiplexer has inputs A, B, and C connected to the selection inputs S2, S1,
and S0, respectively. The data inputs I0 through I7, are as follows: I1 = I2 = I7 = 0; I3
= I5 = 1; I0 = I4 = D; and I6 = D’. Determine the Boolean function and minterms for
that the multiplexer implements.
2. From the following state diagram, create the state table, and corresponding circuit
using D flip-flops. Write the HDL using Data flow modelling.
3. Design a one input, one output serial 2’s complimenter. The circuit accepts a string of
bits from the input and generates the 2’s compliment at the output. The circuit can be
reset asynchronously to start and end the operation. Use JK FF.
4. Simplify the following Boolean functions, using Karnaugh maps:
(a) F(A,B,C,D) = m(1, 3, 6, 7, 10, 11, 13, 15)
(b) F(w, x, y, z) = m(0, 2, 4, 6, 8, 9, 10, 12, 13)
(c) F(w, x, y, z) = M(0,1, 2, 3, 8, 10, 12, 13)
5. Consider the combinational circuit in the figure below.
a. Derive the Boolean expressions for T1 through T4. Derive outputs F1 and F2 as
function of the four inputs.
b. List the truth table (4 variables). Then list T1 through T4, F1 and F2.
c. Use K-maps to simplify these expressions and show that they are equivalent to the
ones o btained in (a).