# Instantiation
###### tags: `Digital IC Design`
[回到主頁面](https://hackmd.io/@derek8955/BkK2Nb5Jo/https%3A%2F%2Fhackmd.io%2FdpcBlBL8TlShpQ-wSi9Quw)
- 在 [03 - Module](https://hackmd.io/MgrVO039RwuffZK8AAGJLQ) 有提到,電路設計是呈現階層式,經過各式子電路拼拼湊湊才變成主電路
- 在一個 module 內若使用別的 module 的動作則稱為 Instantiation 例化
```verilog=
module adder( a, b, c );
input a, b;
output [1:0] c;
assign c = a + b;
endmodule
module DESIGN( a1, b1, a2, b2, c1, c2 );
input a1, b1, a2, b2;
output [1:0] c1, c2;
adder ADDER1 ( .a(a1), .b(b1), .c(c1) );
adder ADDER2 ( .a(a2), .b(b2), .c(c2) );
/*
Syntax : 要例化的module name cell name ( port connection);
.a 代表 sub module adder 的 signal a
.a(a1) 代表 a 這個訊號線跟 a1 連在一起
*/
endmodule
```
> 所以其實 adder 就是一個 template,需要用到時再呼叫他
:::success
port 對應的 data type

想想上方的例子 a1, a2, b1, b2, c1, c2 可以用什麼 data type ?
- a1, a2, b1, b2 本來就是 input port ,所以只能 wire
- c1, c2 是 adder 的 output,所以也只能 wire

:::