Loading simulator…
The PLA uses a 4:1 MUX for every literal.
Its inputs are D0 = CONST_1, D1 = input, D2 = input', and D3 = reserved.
Thus 00 omits a variable, 01 selects its true form, and 10 selects its complemented form.
Program PT0 = A'.B and PT1 = A.B' for the shared XOR result. Program PT2 = A.B for carry.
The half-subtractor configuration keeps the rest of the PLA unchanged and changes only B_CODE_PT2 from 01 to 10, producing PT2 = A.B' for the requested B - A borrow convention.
Y0 = PT0 + PT1
Y1 = PT2
The output MUX codes include PT0 and PT1 in Y0, omit PT2 from Y0, and include only PT2 in Y1.
Half-Adder Programming
| Product term | A_CODE | B_CODE | Y0_CODE | Y1_CODE |
|---|---|---|---|---|
PT0 | 01 | 10 | 01 | 00 |
PT1 | 10 | 01 | 01 | 00 |
PT2 | 01 | 01 | 00 | 01 |
Half-Subtractor Programming
| Product term | A_CODE | B_CODE | Y0_CODE | Y1_CODE |
|---|---|---|---|---|
PT0 | 01 | 10 | 01 | 00 |
PT1 | 10 | 01 | 01 | 00 |
PT2 | 01 | 10 | 00 | 01 |