Full Adder

Problem Description

Parameterized Synchronous Full Adder with Reset

You are designing arithmetic logic for a synchronous embedded processor. The system operates using a clock and requires reliable reset behavior to prevent undefined outputs during power-up.

Implement a parameterized synchronous full adder that adds two input operands along with a carry-in. The outputs must be registered and updated only on the rising edge of the clock.

The design must also support an asynchronous active-high reset, which clears the outputs safely whenever asserted.


Functional Requirements

  • The module must:

    • Accept two data inputs and a carry-in

    • Produce a sum output and a carry output

    • Update outputs on the positive edge of clk

    • Support an asynchronous active-high reset

    • Be parameterized using a configurable data width

  • When reset is asserted:

    • All outputs must be cleared to zero


Design Constraints

  • Use a parameter for data width (default width = 1)

  • Use sequential logic triggered by clock

  • Outputs must be registered

  • The design must be synthesizable

  • Follow default_nettype none


Example (WIDTH = 1)

a

b

cin

sum

cout

0

0

0

0

0

1

0

1

0

1

1

1

1

1

1

Verilog

Code Editor Access

Log in to write, run and submit your solution to this interview question. It's free.

Output

Output goes here...