Linux Format

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.

More from Linux Format

Linux Format1 min read
Vector Vexations
Why does MySQL not support vectors in its community edition? Generative AI is the hot topic in tech. GenAI relies on vector data. Yet Oracle has no plans to support vectors in the community edition of MySQL. If you want to try out vector data with ot
Linux Format5 min read
Tips For Managing Docker Containers
Everyone knows how containers revolutionised application building and deployment. Using a E disposable stack of containers that make up an app that aren’t using the docker-compose command to manage the stack are missing a trick. It allows the shippin
Linux Format1 min read
Wine For Wayland
2023 was a great year for the Wayland driver for Wine. The goal was to move forward from the experimental phase and make the driver a proper upstream component. A year later, after several merge requests, many people are now already able to use the l

Related