Physics — Logic: 1-bit comparator
Tests two bits for equality and which is greater.
Make it your own.
title "1-bit comparator"
type gates
input A at (0,0)
input B at (0,3)
gate NOT G1 at (3,3)
gate XNOR G2 at (3,1.5)
gate AND G3 at (6,0)
output Equal at (6,1.5)
output AgtB at (9,0)
wire A G2
wire B G2
wire G2 Equal
wire B G1
wire A G3
wire G1 G3
wire G3 AgtB