From a4cd0114c3760afdfdc1dfa452b376e239ed3658 Mon Sep 17 00:00:00 2001 From: Nemo Date: Wed, 20 May 2020 16:57:20 +0530 Subject: [PATCH] :heavy_check_mark: Add16 --- README.md | 2 +- projects/02/Inc16.hdl | 21 +++++++++++++++++++-- projects/02/Inc16.out | 5 +++++ 3 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 projects/02/Inc16.out diff --git a/README.md b/README.md index 85ce95d..dd0a43a 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,6 @@ Build order as per the website. Cost for each gate in NAND in brackets. - [x] HalfAdder (Xor+And) - [x] FullAdder (2 x HalfAdder, 1 Or) - [x] Add16 (1 x HalfAdder, 15 x FullAdder) -- [ ] Inc16 +- [x] Inc16 (1 x Add16) - [ ] ALU (nostat) - [ ] ALU (complete) diff --git a/projects/02/Inc16.hdl b/projects/02/Inc16.hdl index d820b48..6f5eaba 100644 --- a/projects/02/Inc16.hdl +++ b/projects/02/Inc16.hdl @@ -13,5 +13,22 @@ CHIP Inc16 { OUT out[16]; PARTS: - // Put you code here: -} \ No newline at end of file + Add16(a=in, + b[0]=true, + b[1]=false, + b[2]=false, + b[3]=false, + b[4]=false, + b[5]=false, + b[6]=false, + b[7]=false, + b[8]=false, + b[9]=false, + b[10]=false, + b[11]=false, + b[12]=false, + b[13]=false, + b[14]=false, + b[15]=false, + out=out); +} diff --git a/projects/02/Inc16.out b/projects/02/Inc16.out new file mode 100644 index 0000000..78de1fe --- /dev/null +++ b/projects/02/Inc16.out @@ -0,0 +1,5 @@ +| in | out | +| 0000000000000000 | 0000000000000001 | +| 1111111111111111 | 0000000000000000 | +| 0000000000000101 | 0000000000000110 | +| 1111111111111011 | 1111111111111100 |