halfadder
parent
e734151311
commit
0d676282ec
@ -0,0 +1,11 @@
|
||||
#lang br/demo/hdl
|
||||
|
||||
CHIP HalfAdder {
|
||||
IN a, b; // 1-bit inputs
|
||||
OUT sum, // Right bit of a + b
|
||||
carry; // Left bit of a + b
|
||||
|
||||
PARTS:
|
||||
Xor(a=a, b=b, out=sum);
|
||||
And(a=a, b=b, out=carry);
|
||||
}
|
Loading…
Reference in New Issue