futilehdl/doc/examples/halfadd.fut

13 lines
123 B
Plaintext

struct Add {
sum: Logic,
carry: Logic
}
comb halfadd (
a: Logic,
b: Logic
) -> Add
{
Add{sum: a ^ b, carry: a & b}
}