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 |