X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fmaster-project%2Freport.git;a=blobdiff_plain;f=Chapters%2FHardwareDescription.tex;h=479dd400640b5dfa38de5a2c929d41ef79f75a54;hp=db469c5f0c12b97aaa3a9ddf4aa820f4f9a6d75f;hb=d196e984e8b30373485e136ac763b669d21c4751;hpb=9924083fbe4985f1691057fd289e783f29b46ff5 diff --git a/Chapters/HardwareDescription.tex b/Chapters/HardwareDescription.tex index db469c5..479dd40 100644 --- a/Chapters/HardwareDescription.tex +++ b/Chapters/HardwareDescription.tex @@ -71,8 +71,8 @@ application and the corresponding architecture. \startbuffer[And3] --- | A simple function that returns --- conjunction of three bits +-- A simple function that returns +-- conjunction of three bits and3 :: Bit -> Bit -> Bit -> Bit and3 a b c = and (and a b) c \stopbuffer @@ -108,12 +108,35 @@ and3 a b c = and (and a b) c ncline(andb)(out); \stopuseMPgraphic + \startbuffer[And3VHDL] + entity and3Component_0 is + port (\azMyG2\ : in std_logic; + \bzMyI2\ : in std_logic; + \czMyK2\ : in std_logic; + \foozMySzMyS2\ : out std_logic; + clock : in std_logic; + resetn : in std_logic); + end entity and3Component_0; + + + architecture structural of and3Component_0 is + signal \argzMyMzMyM2\ : std_logic; + begin + \argzMyMzMyM2\ <= \azMyG2\ and \bzMyI2\; + + \foozMySzMyS2\ <= \argzMyMzMyM2\ and \czMyK2\; + end architecture structural; + \stopbuffer + \placeexample[][ex:And3]{Simple three input and gate.} \startcombination[2*1] {\typebufferhs{And3}}{Haskell description using function applications.} {\boxedgraphic{And3}}{The architecture described by the Haskell description.} \stopcombination + \placeexample[][ex:And3VHDL]{\VHDL\ generated for \hs{and3} from \in{example}[ex:And3]} + {\typebuffervhdl{And3VHDL}} + \placeintermezzo{}{ \defref{top level binder} \defref{top level function} @@ -263,6 +286,22 @@ and3 a b c = and (and a b) c ncline(trueout)(mux) "posB(inpb)"; ncline(mux)(out) "posA(out)"; \stopuseMPgraphic + + \startbuffer[CaseInvVHDL] + entity invComponent_0 is + port (\xzAMo2\ : in boolean; + \reszAMuzAMu2\ : out boolean; + clock : in std_logic; + resetn : in std_logic); + end entity invComponent_0; + + + architecture structural of invComponent_0 is + begin + \reszAMuzAMu2\ <= false when \xzAMo2\ = true else + true; + end architecture structural; + \stopbuffer \placeexample[][ex:CaseInv]{Simple inverter.} \startcombination[2*1] @@ -270,6 +309,10 @@ and3 a b c = and (and a b) c {\boxedgraphic{CaseInv}}{The architecture described by the Haskell description.} \stopcombination + \placeexample[][ex:CaseInvVHDL]{\VHDL\ generated for \hs{inv} from + \in{example}[ex:CaseInv] and \in{example}[ex:PatternInv]} + {\typebuffervhdl{CaseInvVHDL}} + \startbuffer[PatternInv] inv :: Bool -> Bool inv True = False @@ -539,7 +582,7 @@ and3 a b c = and (and a b) c and the corresponding architecture. \startbuffer[Quadruple] --- | Multiply the input word by four. +-- Multiply the input word by four. quadruple :: Word -> Word quadruple n = mul (mul n) where