You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
#lang hdl-demo
|
|
|
|
|
|
|
|
/* Xor (exclusive or) gate:
|
|
|
|
If a<>b out=1 else out=0. */
|
|
|
|
|
|
|
|
CHIP Xor {
|
|
|
|
IN a, b;
|
|
|
|
OUT out;
|
|
|
|
PARTS:
|
|
|
|
Not(in=a, out=nota);
|
|
|
|
Not(in=b, out=notb);
|
|
|
|
And(a=a, b=notb, out=w1);
|
|
|
|
And(a=nota, b=b, out=w2);
|
|
|
|
Or(a=w1, b=w2, out=out);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|