Skip to content

Commit

Permalink
Fix inconsistent HDL templates
Browse files Browse the repository at this point in the history
  • Loading branch information
netalondon committed Oct 9, 2023
1 parent 133163d commit 320bd44
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 19 deletions.
9 changes: 4 additions & 5 deletions projects/src/project_02/01_half_adder.ts
Original file line number Diff line number Diff line change
@@ -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 |
Expand Down
9 changes: 4 additions & 5 deletions projects/src/project_02/02_full_adder.ts
Original file line number Diff line number Diff line change
@@ -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 |
Expand Down
6 changes: 3 additions & 3 deletions projects/src/project_02/03_add16.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
7 changes: 3 additions & 4 deletions projects/src/project_02/04_inc16.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
1 change: 0 additions & 1 deletion projects/src/project_02/05_alu_no_stat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
1 change: 0 additions & 1 deletion projects/src/project_02/06_alu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down

0 comments on commit 320bd44

Please sign in to comment.