From 320bd4441d7ceab156c0df16526e05f403d13352 Mon Sep 17 00:00:00 2001 From: Neta London Date: Mon, 9 Oct 2023 14:07:53 +0300 Subject: [PATCH] Fix inconsistent HDL templates --- projects/src/project_02/01_half_adder.ts | 9 ++++----- projects/src/project_02/02_full_adder.ts | 9 ++++----- projects/src/project_02/03_add16.ts | 6 +++--- projects/src/project_02/04_inc16.ts | 7 +++---- projects/src/project_02/05_alu_no_stat.ts | 1 - projects/src/project_02/06_alu.ts | 1 - 6 files changed, 14 insertions(+), 19 deletions(-) diff --git a/projects/src/project_02/01_half_adder.ts b/projects/src/project_02/01_half_adder.ts index 023fb69d9..1b9262f47 100644 --- a/projects/src/project_02/01_half_adder.ts +++ b/projects/src/project_02/01_half_adder.ts @@ -1,12 +1,11 @@ export const hdl = `// Computes the sum of two bits. CHIP HalfAdder { - IN a, b; // 1-bit inputs - OUT sum, // Right bit of a + b - carry; // Left bit of a + b + IN a, b; // 1-bit inputs + OUT sum, // Right bit of a + b + carry; // Left bit of a + b - PARTS: - // Put you code here: + PARTS: }`; export const cmp = `| a | b | sum | carry | | 0 | 0 | 0 | 0 | diff --git a/projects/src/project_02/02_full_adder.ts b/projects/src/project_02/02_full_adder.ts index 66c9a6b98..87f317598 100644 --- a/projects/src/project_02/02_full_adder.ts +++ b/projects/src/project_02/02_full_adder.ts @@ -1,12 +1,11 @@ export const hdl = `// Computes the sum of three bits. CHIP FullAdder { - IN a, b, c; // 1-bit inputs - OUT sum, // Right bit of a + b + c - carry; // Left bit of a + b + c + IN a, b, c; // 1-bit inputs + OUT sum, // Right bit of a + b + c + carry; // Left bit of a + b + c - PARTS: - // Put you code here: + PARTS: }`; export const cmp = `| a | b | c | sum | carry | | 0 | 0 | 0 | 0 | 0 | diff --git a/projects/src/project_02/03_add16.ts b/projects/src/project_02/03_add16.ts index 254d49d29..e99c5031c 100644 --- a/projects/src/project_02/03_add16.ts +++ b/projects/src/project_02/03_add16.ts @@ -4,10 +4,10 @@ export const hdl = `/** */ CHIP Add16 { - IN a[16], b[16]; - OUT out[16]; + IN a[16], b[16]; + OUT out[16]; - PARTS: + PARTS: }`; export const cmp = `| a | b | out | | 0000000000000000 | 0000000000000000 | 0000000000000000 | diff --git a/projects/src/project_02/04_inc16.ts b/projects/src/project_02/04_inc16.ts index bfd008f5a..07bfa64a8 100644 --- a/projects/src/project_02/04_inc16.ts +++ b/projects/src/project_02/04_inc16.ts @@ -4,11 +4,10 @@ export const hdl = `/** */ CHIP Inc16 { - IN in[16]; - OUT out[16]; + IN in[16]; + OUT out[16]; - PARTS: - // Put you code here: + PARTS: }`; export const cmp = `| in | out | | 0000000000000000 | 0000000000000001 | diff --git a/projects/src/project_02/05_alu_no_stat.ts b/projects/src/project_02/05_alu_no_stat.ts index a94acb61d..0329febf7 100644 --- a/projects/src/project_02/05_alu_no_stat.ts +++ b/projects/src/project_02/05_alu_no_stat.ts @@ -35,7 +35,6 @@ CHIP ALU { out[16]; // 16-bit output PARTS: - // Put you code here: }`; export const cmp = `| x | y |zx |nx |zy |ny | f |no | out | | 0000000000000000 | 1111111111111111 | 1 | 0 | 1 | 0 | 1 | 0 | 0000000000000000 | diff --git a/projects/src/project_02/06_alu.ts b/projects/src/project_02/06_alu.ts index 136634a8d..b2cdc3060 100644 --- a/projects/src/project_02/06_alu.ts +++ b/projects/src/project_02/06_alu.ts @@ -37,7 +37,6 @@ CHIP ALU { ng; // 1 if (out < 0), 0 otherwise PARTS: - // Put you code here: }`; export const cmp = `| x | y |zx |nx |zy |ny | f |no | out |zr |ng | | 0000000000000000 | 1111111111111111 | 1 | 0 | 1 | 0 | 1 | 0 | 0000000000000000 | 1 | 0 |