diff options
| author | Jack Koenig | 2021-09-17 21:01:26 -0700 |
|---|---|---|
| committer | Jack Koenig | 2021-09-17 21:01:26 -0700 |
| commit | 5c8c19345e6711279594cf1f9ddab33623c8eba7 (patch) | |
| tree | d9d6ced3934aa4a8be3dec19ddcefe50a7a93d5a /docs/src/wiki-deprecated/functional-abstraction.md | |
| parent | e63b9667d89768e0ec6dc8a9153335cb48a213a7 (diff) | |
| parent | 958904cb2f2f65d02b2ab3ec6d9ec2e06d04e482 (diff) | |
Merge branch 'master' into 3.5-release
Diffstat (limited to 'docs/src/wiki-deprecated/functional-abstraction.md')
| -rw-r--r-- | docs/src/wiki-deprecated/functional-abstraction.md | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/docs/src/wiki-deprecated/functional-abstraction.md b/docs/src/wiki-deprecated/functional-abstraction.md deleted file mode 100644 index 04dde7d1..00000000 --- a/docs/src/wiki-deprecated/functional-abstraction.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -layout: docs -title: "Functional Abstraction" -section: "chisel3" ---- -We can define functions to factor out a repeated piece of logic that -we later reuse multiple times in a design. For example, we can wrap -up our earlier example of a simple combinational logic block as -follows: -```scala -def clb(a: UInt, b: UInt, c: UInt, d: UInt): UInt = - (a & b) | (~c & d) -``` - -where ```clb``` is the function which takes ```a```, ```b```, -```c```, ```d``` as arguments and returns a wire to the output of a -boolean circuit. The ```def``` keyword is part of Scala and -introduces a function definition, with each argument followed by a colon then its type, -and the function return type given after the colon following the -argument list. The equals (```=})```sign separates the function argument list from the function -definition. - -We can then use the block in another circuit as follows: -```scala -val out = clb(a,b,c,d) -``` - -We will later describe many powerful ways to use functions to -construct hardware using Scala's functional programming support. |
