binary addition using logic gates

Adding Two bits using Logic Gates

In this post, we’ll see how learning binary addition serves as the building block for computers. We will build a two bit adder circuit using logic gates.

Let’s say we want to add two numbers 6 + 4, we know the answer and it is 10. But, let’s say we want to add two binary numbers then we follow the below table.

  • 0+0 = 0 (0 is Sum)
  • 0+1 = 1 (1 is Sum)
  • 1+0 =  1 (1 is Sum)
  • 1+1 =10 (0 is Sum and 1 is Carry) – so, we need two bits to store this.

To make this simple adder, we need two input bits and we also need two output bits. The first bit is for the Sum and the second bit is for the Carry-out.

Think about how will you add the two binary bits above, if you were to add them using some physical means rather than on paper. You would have two wires representing the two bits of data. These two wires will be sent to the XOR gate for the Result bit and the AND gate for the Carry bit as shown below.

logic gates for kids

Hope this is useful to get a basic understanding. In our courses, we’ll move from building adders like above to registers (using flip-flops) and multiplexers that together serve as basic computational units. This serves to provide a strong foundation of how computers work to kids and this foundational knowledge along with programming (coding) skills will put them in good stead.