diff --git a/src/pages/blog/nand2tetris/+Page.jsx b/src/pages/blog/nand2tetris/+Page.jsx index 1f19923..337634a 100644 --- a/src/pages/blog/nand2tetris/+Page.jsx +++ b/src/pages/blog/nand2tetris/+Page.jsx @@ -1,21 +1,15 @@ import { useData } from "vike-react/useData" -export default function Page() { - const { blog } = useData() +function BooleanLogic() { return ( -
{blog.name}
-{blog.time} · {blog.description}
-So Not X = X Nand X.
+Not X = X Nand X.
Since And is equal to Not Nand,and Not can be expressed using Nand:
-A And B = Not (A Nand B) = (A Nand B) Nand (A Nand B)
+A And B = Not (A Nand B) = (A Nand B) Nand (A Nand B)
Accroding to De Morgan's laws, it can be proven that Or can also be expressed using Nand:
-A Or B = Not (Not A and Not B)
+A Or B = Not (Not A and Not B)
+ > + ) +} +function BooleanArithmetic() { + return ( + <> +In the ALU design project, there is a description:
if (f == 1) sets out = x + y, else sets out = x & y
Equal to:
+Calculate sets out = x + y
++ Add16(a=a, b=b, out=aAddb); +
+Calculate sets out = x & y
++ And16(a=a, b=b, out=aAndb); +
+Use Mux for branch operation
++ Mux16(a=aAddb, b=aAndb, sel=f, out=out); +
+{blog.name}
+{blog.time} · {blog.description}
+