halfadder
This commit is contained in:
parent
e734151311
commit
0d676282ec
11
beautiful-racket/br/demo/hdl/HalfAdder.hdl.rkt
Normal file
11
beautiful-racket/br/demo/hdl/HalfAdder.hdl.rkt
Normal file
|
@ -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
Block a user