Full-Adder

Problem #143

Tags: logic

Who solved this?

Previous:Half-Adder Next:RCA_4B


Previously we designed a Half-Adder chip which read 2 input bits, and then output the result over two pins.
However, doesn't this feel incomplete? With two output pins, we should be able to represent up to 3 bits being summed.
Let's build the Full-Adder, the complete counterpart to the Half-Adder.

          CIN         
          ●           
     ┌────┴─────┐     
 A ●─┤          │     
     │    FA    ├─● S 
 B ●─┤          │     
     └────┬─────┘     
          ●           
          COUT        

The HA chip reads in two bits from its input pins named A and B, and also one additional carry-in bit from its CIN pin. As before, the single-bit sum of the three inputs is transmitted through the S pin, and the presence of a carry-out bit is indicated on the COUT pin.

 FA.A │ FA.B │ FA.CIN ║ FA.S │ FA.COUT 
──────│──────│────────║──────│─────────
   0  │   0  │    0   ║   0  │    0    
   0  │   1  │    0   ║   1  │    0    
   1  │   0  │    0   ║   1  │    0    
   1  │   1  │    0   ║   0  │    1    
   0  │   0  │    1   ║   1  │    0    
   0  │   1  │    1   ║   0  │    1    
   1  │   0  │    1   ║   0  │    1    
   1  │   1  │    1   ║   1  │    1    

The circuit board will come pre-installed with INPUT and OUTPUT chips as shown below:

───────┐                                                   ┌────────
       ├─● CIN                                         S ●─┤        
 INPUT ├─● A                                               │ OUTPUT 
       ├─● B                                        COUT ●─┤        
───────┘                                                   └────────

To explain the nomenclature, the typical solution to create a Full-Addder chip involves using two Half-Adder chips (and an additional 3rd chip we won't reveal here).

Problem Statement

Digital Logic Circuit Interface
For these Digital Logic Circuits tasks, you will not be providing an answer string you would for other tasks.
Instead, your Solution Code will be interpreted directly to place chips onto the circuitboard and connect them with wires.
Click here to learn the Digital Logic Circuit Syntax used on this site.

After the chips have been placed and connected, the server will run a series of tests, randomly assigning values to the input pin(s) and checking to see if the output pins read the corresponding expected values. If all tests produce the expected outputs, then the circuitboard is considered a success.

Even though we won't be using the "Your answer" box, you'll still need to put something in that box to submit your solution. Just put anything - it will not be passed to the interpreter.

Truth Table
Design a circuit board which satisfies the following Truth Table:

 INPUT.A │ INPUT.B │ INPUT.CIN ║ OUTPUT.S │ OUTPUT.COUT 
─────────│─────────│───────────║──────────│─────────────
    0    │    0    │     0     ║     0    │      0      
    0    │    1    │     0     ║     1    │      0      
    1    │    0    │     0     ║     1    │      0      
    1    │    1    │     0     ║     0    │      1      
    0    │    0    │     1     ║     1    │      0      
    0    │    1    │     1     ║     0    │      1      
    1    │    0    │     1     ║     0    │      1      
    1    │    1    │     1     ║     1    │      1      
You need to login to get test data and submit solution.