Chargement…
Chargement…
The entity add_sub_4bit has i_a, i_b (slv 3 downto 0), i_sub (std_logic), o_result (slv 3 downto 0), o_carry (std_logic).
4-bit adder/subtractor. If i_sub='0': addition A+B. If i_sub='1': subtraction A-B. o_carry indicates overflow.
| Signal | Direction | Width | Description |
|---|---|---|---|
i_a | Input | 4 bits | Input A |
i_b | Input | 4 bits | Input B |
i_sub | Input | 1 bit | Input Sub |
o_result | Output | 4 bits | Result |
o_carry | Output | 1 bit | Carry out |