From 4de85f0ef53bd890bd87f3057763dc7f77b66155 Mon Sep 17 00:00:00 2001 From: Cassie Jones Date: Sat, 27 Apr 2019 14:23:22 -0400 Subject: [PATCH] Add the beginning of a redstone liberty file --- minecraft.lib | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 minecraft.lib diff --git a/minecraft.lib b/minecraft.lib new file mode 100644 index 0000000..5875b29 --- /dev/null +++ b/minecraft.lib @@ -0,0 +1,80 @@ +// A cell library for redstone circuits +library(redstone) { + cell(REPEATER) { + area: 3; + pin(A) { direction: input; } + pin(Y) { direction: output; function: "A"; } + } + // @TODO: Nail down how we count area. + cell(NOT) { + area: 4; + pin(A) { direction: input; } + pin(Y) { direction: output; function: "!A"; } + } + cell(AND) { + area: 10; + pin(A) { direction: input; } + pin(B) { direction: input; } + pin(Y) { direction: output; function: "A & B"; } + } + cell(NAND) { + area: 9; + pin(A,B) { direction: input; } + pin(Y) { direction: output; function: "!(A & B)"; } + } + cell(OR) { + area: 3; + pin(A) { direction: input; } + pin(B) { direction: input; } + pin(Y) { direction: output; function: "A | B"; } + } + cell(NOR) { + area: 4; + pin(A) { direction: input; } + pin(B) { direction: input; } + pin(Y) { direction: output; function: "!(A | B)"; } + } + cell(AND3) { + area: 16; + pin(A) { direction: input; } + pin(B) { direction: input; } + pin(C) { direction: input; } + pin(Y) { direction: output; function: "A & B & C"; } + } + cell(NAND3) { + area: 15; + pin(A) { direction: input; } + pin(B) { direction: input; } + pin(C) { direction: input; } + pin(Y) { direction: output; function: "!(A & B & C)"; } + } + cell(OR3) { + area: 4; + pin(A) { direction: input; } + pin(B) { direction: input; } + pin(C) { direction: input; } + pin(Y) { direction: output; function: "A | B | C"; } + } + cell(NOR3) { + area: 5; + pin(A) { direction: input; } + pin(B) { direction: input; } + pin(C) { direction: input; } + pin(Y) { direction: output; function: "!(A | B | C)"; } + } + cell(DFF_P) { + area: 8; + ff(IQ, IQN) { clocked_on: C; next_state: D; } + pin(C) { direction: input; clock: true; } + pin(D) { direction: input; } + pin(Q) { direction: output; function: "IQ"; } + } + cell(DFF_N) { + area: 8; + ff(IQ, IQN) { clocked_on: "!C"; next_state: D; } + pin(C) { direction: input; clock: true; } + pin(D) { direction: input; } + pin(Q) { direction: output; function: "IQ"; } + } + // @TODO: Is there a good DFFE design? +} -- 2.47.0