Design your own microprocessor
Last month, in the first of our two-part series aimed at explaining the electronic circuitry in a microprocessor, we saw how transistors can be used to make simple logic gates, and how these gates, in turn, can be wired together to produce more complicated logic elements. In particular, using a logic simulator called Logisim, we looked at how several gates can be used to make a decoder, and this in turn, can be used, together with a few more gates, to produce a multiplexer. This month, continuing with the bottom-up approach to designing complicated logic circuitry, we’ll introduce more building blocks and get a lot closer to seeing the full story of how a microprocessor works.
Arithmetic operations
With our next building block, although it’s built using logic gates, we’re moving from circuits that are best described as logic, to arithmetic circuits, which we’re going to need in any computer. The circuit we’re going to simulate in Logisim is called a 1-bit full adder, and we’ve provided its circuit. Its purpose is to add two bits, but we also need a carry-in bit. This would come, in a multi-bit adder, from the carry-out bit of the next less-significant bit. As will now be expected, the outputs of this 1-bit adder are a 1-bit sum, plus that carry-out bit that goes to the carry-in bit of the next more-significant bit. It should be a simple task to confirm that it works as expected in Logisim and, perhaps, write its truth table.
Next up, we need to extend the 1-bit adder to produce an adder for a larger binary number, and we suggest creating a 4-bit adder to keep the circuit to easily manageable proportions. Rather than use the 1-bit adder circuit built up from five logic gates, though, we suggest using the adder circuit in Logisim’s library, which you’ll find under Arithmetic, using the option of 1 for Data Bits in the attribute table. You’ll need four 1-bit adders, and it should be a simple exercise to work out the circuit – just remember that the carry-in for the least significant bit should be connected to a logic 0 (which you can achieve using Ground, under Wiring), and the carry-in for all the other bits should be connected to the carry-out bit of the next less-significant bit. We’ll see later what happens to the carry-out bit from the most significant bit in a microprocessor.
Before moving on from adder circuits, we’ll say a bit about subtraction. Essentially, a
You’re reading a preview, subscribe to read more.
Start your free 30 days