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.
Objective: Design, construct, and test a three-bit counter that counts up or down. An enable input...
Objective: Design, construct, and test a three-bit counter that counts up or down. An enable input E determines whether the counter is on or off.  If E=0, the counter is disabled and remains at its present count even though clock pulses are applied to the flip-flops.  If E=1, the counter is enabled and a second input, x, determines the direction of the count.  If x=1, the circuit counts upward with the sequence 000, 001, 010, 011, 100,...
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 5 bit binary counter on logicly?
Design a 5 bit binary counter on logicly?
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.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT