From 7411ad59ad681f75e1e6dc6c7089c3f0524dbb39 Mon Sep 17 00:00:00 2001 From: NotAFile Date: Thu, 7 Apr 2022 12:53:34 +0200 Subject: [PATCH] add more examples --- doc/examples/counter.fut | 5 +++++ doc/examples/match.fut | 6 ++++++ 2 files changed, 11 insertions(+) create mode 100644 doc/examples/counter.fut create mode 100644 doc/examples/match.fut diff --git a/doc/examples/counter.fut b/doc/examples/counter.fut new file mode 100644 index 0000000..daf32c9 --- /dev/null +++ b/doc/examples/counter.fut @@ -0,0 +1,5 @@ +proc counter() -> Logic<8> { + reg count = 8'0; + count = count + 1; + count +} diff --git a/doc/examples/match.fut b/doc/examples/match.fut new file mode 100644 index 0000000..87919a8 --- /dev/null +++ b/doc/examples/match.fut @@ -0,0 +1,6 @@ +comb match_not(a: Logic<1>) -> Logic<8> { + match (a) { + 1'1 => 8'10, + 1'0 => 8'5 + } +}