Question

In: Electrical Engineering

You are to design an 4 bit counter that takes as input a clock and a...

  1. You are to design an 4 bit counter that takes as input a clock and a reset signal and outputs a 4-bit count When the clock is asserted and the reset is high, the clock increments. When it increments at 1111,it resets to 0000
  2. Create a schematic diagram of your design using either Xilinx ISE or a drawing tool of your choice or a neatly hand-drawn diagram
  3. Create a Verilog module within Xilinx.
  4. Verify your design is syntactically correct.
  5. Create a Test Bench your circuit by creating a Verilog Test Fixture.
  6. Run your circuit in simulation using at least three sets of inputs.

Solutions

Expert Solution

the diagram for ripple counter is shown below:

the behavioral Verilog module is shown below:

// Code your design here
module counter(out_count,clk,reset);
input clk,reset;
output reg [3:0] out_count=0;
always@(posedge clk)
begin
if(!reset)
begin
out_count<=0;
end
else
begin
out_count<=out_count+1;
end
end
endmodule

testbench:

// Code your testbench here
// or browse Examples
// Code your testbench here
// or browse Examples
module test();
reg clk,reset;
wire [3:0] out_count;
counter c1(out_count,clk,reset);
initial
begin
clk=0;reset=0;
#2 reset=0;
#4 reset=1;
#40
#4 reset=0;
#4 reset=1;
$finish;
end
initial
forever
#2 clk=~clk;
initial
$monitor("out_count=%b",out_count);
endmodule

output:


Related Solutions

Design a logic circuit that takes 2-bit input A and 2-bit input B and subtracts the...
Design a logic circuit that takes 2-bit input A and 2-bit input B and subtracts the two numbers using full adders and inverters with full adders diagram, which input is subtracted dos not matter.
(a) Design a 4-bit ring counter. Use an external asynchronous INIT input to initialize the flip-flops...
(a) Design a 4-bit ring counter. Use an external asynchronous INIT input to initialize the flip-flops to a valid initial state. Also remember to hook up the CLOCK to all flip-flops. (b) Design a 4-bit Johnson counter. Use an external asynchronous INIT input to initialize the flip-flops to a valid initial state. Also remember to hook up the CLOCK to all flip-flops. (c) How many states does the ring counter in part (a) have? How many states does the Johnson...
Using Behavorial VHDL, design a 4-bit up/down counter.
Using Behavorial VHDL, design a 4-bit up/down counter.
Write a VHDL code for a 4-bit comparator which takes two 4-bit input values and (0.5)...
Write a VHDL code for a 4-bit comparator which takes two 4-bit input values and (0.5) determines whether the numbers are equal. 2. 2. Write a structural VHDL code to implement the circuit of Fig. 2, using the components (0.5) developed in 1.3 and 2.1. 2. 3. Write a VHDL test bench for the above and verify by simulation. (0.5) 2. 4. Implement the design in an FPGA (Note: You may need a `clock manager' to reduce (1.0) the clock...
Design a 4 bit Counter that displays even numbers when a switch on, and odd when...
Design a 4 bit Counter that displays even numbers when a switch on, and odd when the switch off . 1.by using multisim (explain in details and information of how you do it in multisim) show steps of multisim and which gates numbers you used.
Design a 4 bit Counter that displays even numbers when a switch on, and odd when...
Design a 4 bit Counter that displays even numbers when a switch on, and odd when the switch off by D flip-flop by training borad
Design a 4 bit Counter that displays even numbers when a switch on, and odd when...
Design a 4 bit Counter that displays even numbers when a switch on, and odd when the switch off and write a report about it.
Design a 4 bit Counter that displays even numbers when a switch on, and odd when...
Design a 4 bit Counter that displays even numbers when a switch on, and odd when the switch off and write a report about it.
1) You are asked to design 4-bit Odd Number Count-Down BCD Counter making use of ONLY...
1) You are asked to design 4-bit Odd Number Count-Down BCD Counter making use of ONLY Falling Edge JK-flipflop(s) and logic gates. 2) Based on the requirements,write down: (i) state diagram (ii) excitation table (iii) input equations
Design a 4-bit up/down counter which displays its output on the the 7-led segment using the...
Design a 4-bit up/down counter which displays its output on the the 7-led segment using the decoder used in Lab 2. In this lab, you will design a 4-bit up/down counter which displays its output on the 7-segment LED using the decoder that you designed in Lab 2. The 4-bit up/down counter module has 4 inputs, Clk_1Hz, Reset, Pause, and Up; and a 4-bit output Count. If Reset is 1, the counter should reset its count value to zero (0000)....
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT