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 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,...
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
Design a synchronous counter having the count sequence given by the following table. Use negative edge-triggered...
Design a synchronous counter having the count sequence given by the following table. Use negative edge-triggered T flip-flops provided with a clock. (i) Draw the state diagram of the counter. (ii) Build the counter's state table showing the synchronous inputs of the T flip-flops as well. (iii) Using Karnaugh maps, find the minimal sum-of-products form of the equations for the inputs to the flip-flops; assume the next states of the unused combinations to be "don't care states" (iv) Draw the...
Implement the synchronous 2-bit Up/Down counter with saturation at the end states. The flip-flop outputs Q1,...
Implement the synchronous 2-bit Up/Down counter with saturation at the end states. The flip-flop outputs Q1, Q0 serve as the outputs of the counter. The counting direction is set with mode control input M. With M =1 the flip-flop outputs follow the incrementing binary sequence starting from a current state with saturation at state 11 as shown in the following example: 00-> 01-> 10-> 11-> 11-> 11... With M =0 the outputs follow the decrementing binary sequence from a current...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT