Quiz - Docx - Verilog
Quiz - Docx - Verilog
Question 1: Write one line answers for the following questions (10 marks)
a)What is the difference between casex, casez and case statements?
Answer : casez treats all z values in the case expression as don't cares. casex treats all x and z
values in the case expression as don't cares.
d)Does the order of input and output ports in the argument of module matters?
(b) If Fido is forever given a sequence of ones (i.e. 11111…), where will it eventually
end up?
(c) If Fido is forever given a sequence of 01s (i.e. 010101…), which location(s) will
it never visit?
What will be the value of "a" at time 0,5,10,... units till 40 units of time?
Answer :
0 - 101
5 - 000
10 - 000
15 - 111
20 - 111
25 - 010
30 - 110
35 - 011
40 - 011
(This helps in understanding the concepts of blocking and non-blocking statements).
There are three major courses X, Y and Z, and two minor courses A and B in a
department. A student can graduate if he or she passes:
1- All the major courses from X to Z
or
2- Two major courses and both minor courses
Write a Boolean equation to represent the graduation condition.
Hint: Use the name of the courses as the variables of your equation. i.e., X,Y, Z, A, B.
Variable X is 1 if a student passes course X, otherwise 0.
Answer:
Question 6
Consider the following sequential design. The D F/Fs are negative edge triggered.
1. Write out the excitation equations for F/F 1 and F/F 2, i.e., what is the logic equation
input of the inputs D1 and D2 ? (3 marks)
D1 = y1 xor y2 = Q1 xor Q2
D2 = y2’ = Q2’
2. Using the equations from 1, if the current state of the system is that y1 = 0 and y2 = 0,
what is the next state of the system on the falling clock edge? (4 marks)
Current state: Q1 = y1 = 0 Q2 = y2=0
Then the inputs D1 = 0 and D2 = 1
So on the next clock this is the value the will appear on the output and the next state is
Q1 = 0 Q2 = 1
Question 7:
Implement a 4 bit shift register in verilog. Explain its functionality in terms of frequency.
(10 marks)