Ripple Carry Adder


Problem Statement: Design and simulate a four-bit Ripple Carry Adder (RCA).


What is Ripple Carry Adder?

A four-bit ripple carry adder is a basic digital circuit that performs binary addition for two four-bit numbers. It's constructed by cascading four full-adders in a way that the carry-out from the first full-adder serves as the carry-in for the second full-adder and so on.

How can we use our full adder to build RCA?

Multiple full adder circuits can be cascaded in parallel to add an N-bit number. For an N-bit parallel adder, there must be N number of full adder circuits.


Implementing a 4-bit ripple carry adder

  1. Create a new Verilog file named adder_4bit.v, and copy-paste the below structural design of 4-bit ripple carry adder.

  2. Create a new Verilog file and type the below testbench code provided below. Save the file with the same name as the module name.

  3. Compile the code and check for any syntax errors using the below command.

    iverilog adder_4bit.v tb_adder_4bit.v -o adder_4bit
    
  4. If there are no errors, use the below command for running the simulation.

    vvp adder_4bit
    

    You will see the values of signals being monitored across each clocktick.

  5. If all looks well, use the below command for viewing the waveform. Add the signals from tb_adder_4bit design to the window to view the simulation output as shown in below image.

    gtkwave adder_4bit.vcd