First, you've come the right place for hardware related questions.
Second, you need to swap your software hat for a hardware hat.
Going with your requirements
1. Lets focus on the module/entity
The 4 bit output is probably cout and sum concatenated together.
Code Verilog - [expand] |
1
2
3
4
5
6
7
8
9
| module full_adder(
input cin,
input [reg_size-1:0] in_a,
input [reg_size-1:0] in_b,
output [reg_size[B]-0[/B]:0] sum
);
parameter reg_size = 3;
wire cout; // carry out
sum[4] = cout; |
2. Lets focus on what a full adder is.
https://www.circuitstoday.com/half-adder-and-full-adder
Scroll down to logical representation of it. Furthermore see how it's chained together.
>>cout from one becomes cin to the other.
3. start with 1 bit full adder then scale it.