3/04/2026


Hello everybody! Been a while but have been busy away from the computer, but now I'm back. Firstly, happy Easter! Secondly, I thought I would do something different for this entry, showing the stuff I've been learning beyond just programming. As I've mentioned in prior entries, I want to understand the low level of a computer because I think it's essential to be a good programmer. So I will be showing a snippet of what I've been learning. I'm well past this topic but I don't want to turn off readers with technical jargon so I'll stick with something fascinating and intuitive.

Some of you may be curious and ask, how does a computer perform addition and subtraction? Well there is a part of the ALU (arithmetic logic unit) that performs billions of these calculations within moments! I decided to show how a circuit called the 'half adder' works, which is basically half the circuit of a full adder. The half adder circuit contains 2 inputs and 2 outputs. Let's call the two inputs A and B. The two outputs are the SUM and Carry outputs. In electronics, circuits are made up of what are called 'logic gates'. These logic gates are arranged in many different ways to make many different types of circuits.

We can understand the behavior of deterministic circuits by what are called 'truth tables' which show nicely how the circuits inputs affect the outputs. There are quite a few logic gates out there, but I'll only mention the two responsible for this circuit.

AND gate: An AND gate is easy to understand because the name of this logic gate hints how it works. The AND gate only outputs a signal if both inputs are on. All the other possible states of these inputs will not output a signal. We can see this clearly with the truth table for the AND gate below, let x be the output:





The second circuit is the XOR gate (exclusive or). This circuit is false if both A and B inputs are both on, or both inputs are off. Here is the truth table for the XOR gate (The output is called Q):





The reason why these circuits are chosen is because the XOR gate handles when there is a sum, the AND gate handles the carry out, which is basically an overflow of the sum. If we look at the logic gates of the logic gate truth tables I listed above, you can see how the truth table for the half adder works.





So essentially, two half adders form a full adder, which handles A, B, Cin, as inputs and Sum, Cout as outputs. For a computer to handle greater numbers, the full adders are wired together from one full adders Cout to the next Full adders Cin. An 8 bit computer typically has 7 Full adders and 1 half adder. These adders store the results into what are called 'registers', which size (width) depends on the computer architecture. If you don't understand everything that's expected and normal! I just wanted to show a glimpse into the stuff I'm learning and appreciating.

If anyone is interested in more of this stuff, I highly suggest Ben Eater's Youtube series where he builds an 8 bit CPU from scratch! I only understand so much of what he says because I'm dumb, but I've learned quite a lot from this guy. Well, I'll update when I can, enjoy your easter everybody and God bless.

Back to homepage <<<©2026 Cforcat2k26>>>