title: How to simulate a 4-bit binary adder in C
body: <p>My professor assigned the class to write a C program to simulate a 32-bit adder using basic adders. I know a 32-bit adder is made up of 8 X 4-bit adders. However, I am unsure even how to simulate a 4-bit adder in C. I need to implement a 4-bit binary ripple carry adder, a 4-bit binary look-ahead carry generator, and a 4-bit look-ahead carry adder. From the truth table of a full adder and a Karnaugh map, I obtained the functions of the Sum and Carry Out outputs. For Sum I received A xor B xor Carry In. For the Carry out function, I received (A*B) + (Carry in(A xor B)). Now I am unsure where to go. I'm pretty sure I need to manipulate the integers at the bit level using bitwise operators (I have basic knowledge of bitwise operators although I have never implemented them outside of paper and pencil). </p>
  
  <p>How do I break the integers up to obtain the A, B and Carry In inputs for the functions? How do I obtain the Sum and Carry Out outputs? How do I string the full adders together to obtain a 4-bit adder? </p>
  
  <p>Thank you for the help!</p>