Implement a 1-bit half adder structurally using only the nand primitive. The outputs are sum = a β b and cout = a & b.
Requirements
ha_nand_onlya, bsum, coutnand primitives; purely structural; no procedural blocks
| n_input gates | n_output_gates | Three-state gates | Pull gates | MOS switches | Bidirectional switches |
|---|---|---|---|---|---|
| and | buf | bufif0 | pulldown | cmos | rtran |
| nand | not | bufif1 | pullup | nmos | rtranif0 |
| nor | notif0 | pmos | rtranif1 | ||
| or | notif1 | rcmos | tran | ||
| xnor | rnmos | tranif0 | |||
| xor | rpmos | tranif1 |
Basic combinational logic gates with n inputs (2 or more).
Single-input, multiple-output primitives.
Output can be 0, 1, or high-impedance (Z).
Provide weak constant logic values.
Model ideal MOS transistors (digital switch-level).
Transmission gates passing signals both ways.
π Rule of thumb for RTL design: