78. Programmable Half Adder and Half Subtractor Using a PLA

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 termA_CODEB_CODEY0_CODEY1_CODE
PT001100100
PT110010100
PT201010001

Half-Subtractor Programming

Product termA_CODEB_CODEY0_CODEY1_CODE
PT001100100
PT110010100
PT201100001