fir(() => {
const $ = {
A0: input('A0'),
A1: input('A1'),
B0: input('B0'),
B1: input('B1'),
};
$.a0b1 = wire('a0b1', and($.A0, $.B1));
$.a1b0 = wire('a1b0', and($.A1, $.B0));
$.X0 = output('X0', and($.B0, $.A0));
$.X1 = output('X1', xor($.a0b1, $.a1b0));
$.X3 = output('X3', and($.a0b1, $.a1b0));
$.X2 = output('X2', xor($.X3, and($.A1, $.B1)));
return [{
type: 'module', name: 'top',
inputs: [$.A0, $.A1],
body: [$.X1, $.X3, $.X2, $.X0]
}];
})