futilehdl/doc/examples/halfadd.fut

13 lines
123 B
Plaintext
Raw Normal View History

2022-02-04 23:58:47 +00:00
struct Add {
sum: Logic,
carry: Logic
}
comb halfadd (
2022-02-02 00:13:33 +00:00
a: Logic,
b: Logic
2022-02-04 23:58:47 +00:00
) -> Add
2022-01-04 00:41:09 +00:00
{
2022-02-04 23:58:47 +00:00
Add{sum: a ^ b, carry: a & b}
2022-01-04 00:41:09 +00:00
}