Professional Documents
Culture Documents
FACULTY OF ENGINEERING
BE V Semester (CBCS) (ECE) MAIN EXAMINATION, Nov/Dec 2018
Subject: Digital System Design with Verilog HDL
QUESTION PAPER KEY:
Prepared by M MOHAMMED SABIR HUSSAIN, ECED,MJCET.
PART – A (2x10=20 Marks)
end
module fa(a,b,sum,cin,co);
input a,b,cin;
output sum,co;
assign co=a*b+b*c+c*a;
endmodule
Test bench:
fa fadder(a,b,cin,sum,co);
initial begin
{a,b,cin}=3’b000; #5 {a,b,cin}=3’b101; #5
{a,b,cin}=3’b100; #5 {a,b,cin}=3’b101;
#5 $finish; end
always block:
Example:
always@(posedge clk)
if(rst)
q<=0;
else if(ud)
q<=q+1;
else
q<=q-1;
(b) Write a verilog code for BCD-to-7-segment decoder in behavioral modelling (5)
Ans: Verilog code for BCD-to-7-segment decoder
(b) Design synchronous sequential circuit using one hot encoding method for the
State table shown in Table 1. (8)
Table 1
Get logic equations for D2, D1,D0 and Z in terms of y3y1y0 and X using K map
simplification method and design the circuit...
(b) Design vending machine controller. Draw its ASM chart and implement verilog
program. (7)
Ans: Illustration example :
Block Diagram:
State digram:
Input (x)
Present sate (y)
0 1
A B/1 B/0
Get logic equations for D1,D0 and Z in terms of y1y0 and X using K map
simplification method and design the circuit...
17. (a) Design arithmetic and logic unit (ALU) with minimum 8 instruction in verilog
and verify functionality using stimulus. Draw its waveforms. (5)
Test bench:
Waveforms:
(b) Explain simplified architectures of CPLD and FPGA (5)
CPLD: