Question

In: Electrical Engineering

Create a 3-bit counter in verilog that cycles through this sequence, 6,2,4,5,0,7,3,1, with a synchronous rest...

Create a 3-bit counter in verilog that cycles through this sequence, 6,2,4,5,0,7,3,1, with a synchronous rest 4.

Solutions

Expert Solution

State Table

PRESENT STATE

NEXT STATE

Q2

Q1

Q0

Q2+

Q1+

Q0+

0

0

0

1

1

1

0

0

1

1

1

0

0

1

0

1

0

0

0

1

1

0

0

1

1

0

0

1

0

1

1

0

1

0

0

0

1

1

0

0

1

0

1

1

1

0

1

1

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

module counter (clock, reset, Q);

input clock, reset;

output [2:0] Q;

reg [2:0] r;

always @(posedge clock)
begin
   if (reset)
       r <= 3'b100;
   else begin
       r[2] <= (~r[1] && ~r[0]) || (~r[2] && ~r[1]) || (~r[2] && ~r[0]);
       r[1] <= ~(r[2] ^ r[1]);
       r[0] <= ~(r[1] ^ r[0]);
   end
end

assign Q = r;

endmodule

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


Related Solutions

Design a synchronous 3-bit binary counter that generates the repeated sequence of 0, 3, 4, 7,...
Design a synchronous 3-bit binary counter that generates the repeated sequence of 0, 3, 4, 7, 0, 3, 4, 7, 0… The outputs of the flip-flops are to be the binary output signals of your counter. Your solution needs to include the input equations for the flip-flops, and a circuit diagram for each version. a) Design the counter using D flip-flops b) Design the counter using T flip-flops c) Design the counter using JK flip-flops
Design a synchronous counter of four-bit using D flip‐flops and gates (AND, OR etc.) *use verilog...
Design a synchronous counter of four-bit using D flip‐flops and gates (AND, OR etc.) *use verilog language modules and test and explain briefly
Please write in multisim: Design 3 bit a synchronous counter to produce the following sequence: 0, 1, 2, 5, 3 then 0.by using...
Please write in multisim: Design 3 bit a synchronous counter to produce the following sequence: 0, 1, 2, 5, 3 then 0.by using J-K Filp Flop.. Please i need in multisim and Step of solution. Thanks!!
SOLVE FOLLOWING a.   Desgin and VERILOG code of a 3 bit up down counter USING T...
SOLVE FOLLOWING a.   Desgin and VERILOG code of a 3 bit up down counter USING T FLIP FLOP..... b. using behavioural module.Write a verilog discription of an N-BIT up down binary counter. Record the simulation output waveform in observation.....
2) Counters a) Design a two-bit counter of value AB which cycles through the following repeating...
2) Counters a) Design a two-bit counter of value AB which cycles through the following repeating pattern, using each of the following ?ip-?ops. Clearly show your design with all the necessary connections. AB : 00 ?? 10 ?? 01 ?? 00 ?? 10··· i) two D-FFs ii) two T-FFs iii) two JK-FFs b) Design a three-bit counter of value ABC which cycles through the following repeating pattern, using each of the following ?ip-?ops. Clearly show your design with all the...
Verilog counter problem: Using the attached 4-bit up-counter module and testbench as a template, write a...
Verilog counter problem: Using the attached 4-bit up-counter module and testbench as a template, write a Verilog module that implements a certain 4-bit counter. The module should include two more input variables: “updown” and “count2”. If “updown” is 1, the circuit should count up (by 1s); if it is 0 it should count down (by 1s). If “count2” has a value of 1, the circuit should instead count up by 2s; otherwise it will have no effect (the circuit counts...
Verilog counter problem: Using the attached 4-bit up-counter module and testbench as a template, write a...
Verilog counter problem: Using the attached 4-bit up-counter module and testbench as a template, write a Verilog module that implements a certain 4-bit counter. The module should include two more input variables: “updown” and “count2”. If “updown” is 1, the circuit should count up (by 1s); if it is 0 it should count down (by 1s). If “count2” has a value of 1, the circuit should instead count up by 2s; otherwise it will have no effect (the circuit counts...
This question concerns a synchronous sequential counter, which counts an arbitrary sequence. The properties of the...
This question concerns a synchronous sequential counter, which counts an arbitrary sequence. The properties of the counter include the following: 1. The counter has two inputs, input X and CLK (Clock), and three outputs, A, B and C. A is the most significant digit in the counting value, and C is the least significant digit. 2. The counter counts under a POSITIVE clock edge. 3. When X is 0, the counting sequence is: 1, 6, 3, 2, 5, 1, 6,...
This question concerns a synchronous sequential counter, which counts an arbitrary sequence. The properties of the...
This question concerns a synchronous sequential counter, which counts an arbitrary sequence. The properties of the counter include the following: 1. The counter has two inputs, input X and CLK (Clock), and three outputs, A, B and C. A is the most significant digit in the counting value, and C is the least significant digit. 2. The counter counts under a POSITIVE clock edge. 3. When X is 0, the counting sequence is: 1, 6, 3, 2, 5, 1, 6,...
Using JK flipflopDesign a multisim schematic for a 4 bit synchronous counter that counts numbers in...
Using JK flipflopDesign a multisim schematic for a 4 bit synchronous counter that counts numbers in Gray code. 4 bit Gray code is as follows: 0000 0001 0011 0010 0110 0111 0101 0100 1100 1101 1111 1110 1010 1001 1000
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT