Chip Design

Craft counters suitable for various applications, such as a mod-15 counter excluding 0, 3, 4, 8, and 5.

Design Verification Engineer

Philips Healthcare

Intel

Emerson Electric

Analog Devices

OMRON

Cirrus Logic

Did you come across this question in an interview?

Answers

Expert Answer

Anonymous

5Exceptional
module mod_15_counter (
  input wire clk,      // Clock signal
  input wire reset_n,  // Active low reset
  output reg [3:0] count // 4-bit counter output
);
  
  // Combinational logic to determine the next valid state
  always @(posedge clk or negedge reset_n) begin
    if (!reset_n)
      count <= 1;  // Start from 1 when reset is active
    else begin
      case (count)
        1: count <= 2;
        2: count <= 6;
        6: count <= 7;
        7: count <= 9;
        9: count <= 10;
        10: count <= 11;
        11: count <= 12;
        12: count <= 13;
        13: count <= 14;
        14: count <= 15;
        15: count <= 1; // Wrap around to 1 after 15
        default: count <= 1;  // Default case to start from 1
      endcase
    end
  end

endmodule

module tb_mod_15_counter;

  reg clk;
  reg reset_n;
  wire [3:0] count;
  
  // Instantiate the mod-15 counter
  mod_15_counter uut (
    .clk(clk),
    .reset_n(reset_n),
    .count(count)
  );
  
  // Clock generation
  always #5 clk = ~clk;  // Clock period of 10 time units

  initial begin
    // Initialize signals
    clk = 0;
    reset_n = 0;
    
    // Apply reset
    #10 reset_n = 1;
    
    // Let the simulation run for 200 time units
    #200 $stop;
  end
  
  // Monitor the output
  initial begin
    $monitor("Time: %0d, count: %0d", $time, count);
  end

endmodule



 
  • Craft counters suitable for various applications, such as a mod-15 counter excluding 0, 3, 4, 8, and 5.
  • Could you develop a range of counters, including a mod-15 counter that omits 0, 3, 4, 8, and 5?
  • How would you engineer counters for diverse situations, like a mod-15 counter that bypasses 0, 3, 4, 8, and 5?
  • Devise different types of counters, for instance, a mod-15 counter that avoids 0, 3, 4, 8, and 5.
  • Can you construct various counters, including a mod-15 counter that doesn't count 0, 3, 4, 8, and 5?
  • Create several counters, such as a mod-15 counter that skips 0, 3, 4, 8, and 5.
  • Plan out counters for assorted scenarios, like a mod-15 counter excluding 0, 3, 4, 8, and 5 from its count.
  • Design a range of counters, including a specialized mod-15 counter that leaves out 0, 3, 4, 8, and 5.
  • Conceptualize various counters, for example, a mod-15 counter that disregards 0, 3, 4, 8, and 5.
  • Design counters for different scenarios, like designing a mod-15 counter that skips counting 0, 3, 4, 8, and 5.
Try Our AI Interviewer

Prepare for success with realistic, role-specific interview simulations.

Try AI Interview Now

Interview question asked to Design Verification Engineers interviewing at Emerson Electric, Yamaha Motor Corporation, General Motors and others: Craft counters suitable for various applications, such as a mod-15 counter excluding 0, 3, 4, 8, and 5..