TASK-5: Name: Nithin Raja Ss REG NO:19BML0009
TASK-5: Name: Nithin Raja Ss REG NO:19BML0009
TASK-5: Name: Nithin Raja Ss REG NO:19BML0009
REG NO:19BML0009
1) Using MODELSIM, carry out the simulation of the Zero detector discussed in laboratory class, with
the help of a Verilog HDL code.
CODE:
module Mealy_zero_detector_XYZ(y_out,x_in,clk,rst);
output y_out;
reg y_out;
if(rst==0)state<=S0;
always@(state,x_in)
case(state)
endcase
always @(state,x_in)
case(state)
endcase
endmodule
OUTPUT:
2)
A) Using MODELSIM, carry out the simulation of a MOD 8 counter using T flipflops.
B) Accomplish 2A) using case statements
CODE:
Input rstn,
If (!rstn)begin
Out<=0;
If (out==N-1)
Out <= 0;
Else
Out <=out+1;
End
End
endmodule
3) Design a MOD 6 counter using JK flipflops. Write a Verilog HDL code for accomplishing the
same.
input clock, j, k;
output q, qbar;
reg d = 1'b0;
assign q = d;
assign qbar = ~d;
endmodule
input clock;
output q2, q1, q0;
assign q2 = d[2];
assign q1 = d[1];
assign q0 = d[0];
endmodule
input clock, j, k;
output q, qbar;
reg d = 1'b0;
assign q = d;
assign qbar = ~d;
endmodule
input clock;
output q2, q1, q0;
assign q2 = d[2];
assign q1 = d[1];
assign q0 = d[0];
endmodule