Professional Documents
Culture Documents
Bals3033 Logic System Design
Bals3033 Logic System Design
Bals3033 Logic System Design
SEMESTER C
FINAL EXAM
YEAR THREE
Instruction to Candidates :
Q1. (a) Justify why the Hardware Description Language Design is more reliable
compare to Schematic Design. (6 marks)
(b)
Figure 1
(i) Write the structural Verilog code for the combinational circuit shown
in Figure 1. (12 marks)
(ii) Write the behavioral Verilog code for the combinational circuit
shown in Figure 1. (7 marks)
[Total : 25 marks]
Q2. (a) Determine if there are differences if the following two modules are
synthesized. (4 marks)
Q2. (Continued)
(b) A 4-to-1 multiplexer (as shown in Figure 2) has an inherent delay that causes
the change in output to occur 10ns after a change in input.
Figure 2
X1
X2
Inpu U1 U2
T Q T Q T Q T Q
Q[0] Q[1] Q[2] Q[3]
t T0 T1 T2 T3
Clock Qbar Qbar Qbar Qbar
reset
Figure 3
[Total : 25 marks]
Q3. (a) (i) Determine the state table and state diagram using a Moore system
whose output changes whenever it detects a sequence 110, as shown in
the table. Assume that initially, the output is 0.
x 0 0 1 0 1 1 1 0 1 1 0 0 1 1 0 1 0 1 - -
z 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 1 1 1 1 1
(6 marks)
(b) Figure 4 shows the Finite State Machine (FSM), where C is an input, and a
and b are output.
Figure 4
Figure 5
(a) Assuming only one key can be pressed at a time, interpret the equations for a
number decoder given , , , and , , , , whose output
corresponds to the binary value of the key. For example, the F key will return
1111 in binary, or 15. (5 marks)
(b) Design a debouncing circuit that detects whether a key has been pressed or
depressed. Assume switch bounce will die in one or two clock cycles/ when a
key has been pressed, K=1 and Kd is the debounced signal. (2 marks)
(c) Draw a state diagram that performs the keyscan and issues a valid pulse when
a valid key has been pressed using inputs from (b). (4 marks)
(d) Write a Verilog code for your keypad scanner and include the decoder, the
debouncing circuit, and the scanner. (14 marks)
[Total : 25 marks]
________________________________________