Physics — Logic: 1-bit ALU
AND, OR and XOR functions selected onto one output.
Make it your own.
title "1-bit ALU (AND/OR/XOR)"
type gates
input A at (0,0)
input B at (0,2)
input Sel at (0,4)
gate AND G1 at (3,0)
gate OR G2 at (3,2)
gate XOR G3 at (3,4)
gate OR G4 at (7,2)
output Result at (10,2)
wire A G1
wire B G1
wire A G2
wire B G2
wire A G3
wire B G3
wire G1 G4
wire G2 G4
wire G3 G4
wire Sel G4
wire G4 Result