Home / Expert Answers / Computer Science / 2-4-pts-modify-the-code-of-the-x-bit-counter-shown-in-code-example-5-to-accommodate-the-followin-pa366

(Solved): 2. [4 Pts] Modify the code of the x-bit counter shown in Code Example 5 to accommodate the followin ...



student submitted image, transcription available belowstudent submitted image, transcription available below
2. [4 Pts] Modify the code of the -bit counter shown in Code Example 5 to accommodate the following characteristics: the counter should have 2 extra inputs: i. input UpDown to count up (increment) or count down (decrement) (0: increment, 1 : decrement) ii. input Step to enable the counter to count (increment/decrement) with a step of , or 3 . 3. [4 Pts] Develop a testbench to test question 2 module above and simulate it. Choose appropriate test cases that fully test your design. Provide a table of the test cases with their expected outputs, and a screenshot of the module output waveform showing all of these test cases. Code Example 5: -bit mod-n binary counter: module counter_x_bit \# (parameter ) (input clk, reset, output [x-1:0] count); reg count; always @ (posedge clk, posedge reset) begin if (reset ) count <= 0; // non-blocking assignment // initialize flip flop here else if (count ) count <= 0; // non-blocking assignment // reach count end and get back to zero else count <= count non-blocking assignment // normal operation end


We have an Answer from Expert

View Expert Answer

Expert Answer



We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe