2 4-bit-adder modules to make an 8-bit adder

OP #3714708
Rate this post
• ▲ useful
▼ not useful
How can I obtain 8Bit full adder from 2 4-bit full adder ?
I found this code for 4-bit full adder and I tried to combined them but 
i didn't do this.
module fullAdder(
         input a,
         input b,
         input cin,
         output s,
         output cout );

        assign {cout,s} = a + b + cin;

endmodule

Could you help me how can I obtain this ?
Guest #3715081
Rate this post
• ▲ useful
▼ not useful
how to connect instantiated modules by name:
http://www.asic-world.com/verilog/syntax2.html

e.g a two bit adder:
1
module adder_2bit(
2
         input [1:0] abus,
3
         input [1:0] bbus,
4
         input cin,
5
         output [1:0] sumbus,
6
         output cout );
7

8
  wire ctemp1;
9

10
   fullAdder u0 (
11
           .a(abus[0])      ,
12
           .b(bbus[0])      ,
13
           .cin(ci)      ,
14
           .sum(sumbus[0])    ,
15
           .cout(ctemp1)
16
           );
17
   fullAdder u1 (
18
           .a(abus[1])      ,
19
           .b(bbus[1])      ,
20
           .cin(ctemp1)      ,
21
           .sum(sumbus[1])    ,
22
           .cout(cout)
23
           );
24
endmodule

Reply

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.

Formatting
  • [c]C-Code[/c]
  • [vhdl]VHDL-Code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.