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

Please log in before posting.

or

Log in with Google account

Registration is free and takes only a minute.

Register now