CS 353 Lab 4 Sample Input Alex Lockwood, Lab Assistant -- Fall 2018 1. Comparison XOR A1 S1 S3 XOR A2 S2 S4 NOT A3 A1 NOT A4 A2 AND L1 A3 A4 //A = s1 and s2, B = s3 and s4. When A = B then L1 is on, otherwise it is off. 2. Incrementation NOT A1 S1 NOT A2 S2 NOT A3 S2 NOT A4 S1 AND L1 A1 A2 AND L2 S1 A3 AND L3 S2 A4 AND L4 S1 S2 //S1 is a first-order bit and S2 is a second order bit. L1 represents 1, L2 2, and so forth. //Returns the binary value of S1 and S2 plus one. 3. Weird Combination of All Gates AND A1 S1 S2 NAND A2 S2 S3 OR A3 S3 S4 NOR A4 A1 S2 NOT A5 A2 XOR A6 A5 A3 XOR A7 A6 A4 NOT L1 A7 //Test the following combinations for output on L1: // S1 -> OFF. S2 + S4 -> ON. S2 + S3 -> ON. S1 + S2 + S4 -> OFF. S3 + S4 -> ON. S1 + S3 -> ON. S4 -> ON. 4. Advanced Incrementation (requires 5 switches and 5 Lights) (optional) XOR L1 S1 S5 AND A1 S1 S5 XOR L2 A1 S2 AND A2 A1 S2 XOR L3 A2 S3 AND A3 A2 S3 XOR L4 A3 S4 AND A4 S1 S2 AND A5 S3 S4 AND A6 A5 A4 AND L5 A6 S5 //Does counting so long as S5 is off, does incrementation when S5 is on. //Expected output: Input = output while S5 is off. Input = output + 1 while S5 is on.