Solution:
The design is implemented and simulated in Verilog
//---------- Code Starts here -----------//
module detect(clk,rst,IN,OUT);
input clk,rst,IN;
output reg OUT;
reg [4:0] count16,count5;
always @(posedge clk or posedge rst)begin
if(rst==1'b1) begin
count16<=0;
count5<=0;
OUT<=0;
end
else begin
count16<=count16+1'b1;
if(IN==1'b1) count5<=count5+1;
else count5<=count5;
if(count5==5) OUT<=1;
end
end
endmodule
//-------------------- END -----------------//
Test bench:
//----------------- Test Bench ------------------//
module tb();
reg clk,rst,IN;
wire OUT;
detect uut(.*);
initial begin
clk=0;rst=0;IN=0;#10;
rst=1;#2
rst=0;IN=1;#3;
IN=1;#3;
IN=1;#3;
IN=0;#3;
IN=1;#3;
IN=0;#3;
IN=1;#3;
IN=1;#3;
IN=1;#3;
IN=0;#3;
IN=0;#3;
IN=1;#200 $finish;
end
always #1 clk=~clk;
endmodule
//--------------------- END ----------------------//
Experiment #4 Design and create a simulation waveform for a 5 out of 16 event detector using Verilog. This system w...
Experiment #3 Design and create simulation waveform for an 8-bit up/down synchronous (rising edge of clock) binary counter using Verilog Remember that your testbench can include statements such as always begin #10 clock="clock; end which specifies that the clock (reg) should toggle every 10 nSec
Experiment #3 Design and create simulation waveform for an 8-bit up/down synchronous (rising edge of clock) binary counter using Verilog Remember that your testbench can include statements such as always begin #10 clock="clock; end which...
Please include waveform
Experiment #1 Design and create simulation waveform for an 8-bit even parity checker using Verilog. The system will accept 8-bit data and outputs a one if there are even numbers of ones, otherwise outputs zero. (hint: xor is helpful) Exnerimont #2
Experiment #1 Design and create simulation waveform for an 8-bit even parity checker using Verilog. The system will accept 8-bit data and outputs a one if there are even numbers of ones, otherwise outputs zero. (hint:...
Task (10 points): (1) Approach 1: Implement a 4-to-16-line decoder using the schematic capture feature of Xilinx ISE. On the schematic, add a text that clearly shows your name and eRaider ID. (2) Approach 2: Write and compile a 4-to-16-line decoder Verilog gate-level description. (3) Approach 3: Write and compile a 4-to-16-line decoder Verilog behavioral description. (4) Create an appropriate test file to do an exhaustive test. Exhaust all the possible input codes in 3 the following order: 0000 →...
In this lab, you will design a finite state machine to control the tail lights of an unsual car. There are three lights on each side that operate in sequence to indicate thedirection of a turn. Figure ! shows the tail lights and Figure 2 shows the flashing sequence for (a) left turns and (b) right rums. ZOTTAS Figure 28:8: BCECECece BCECECECes BCECECECB BCECECBCB 8888 Figure 2 Part 1 - FSM Design Start with designing the state transition diagram for...