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 Format10 min read
Answers
I was originally using the Cinnamon version of Linux Mint 21.3. I heard good things about MATE, so I did a new installation to try out MATE. After several months, I decided that I would like to go back to Cinnamon. I am not sure how to switch back wi
Linux Format2 min read
Suitability For Beginners
These distros are focused on a technical area of computer use, penetration testing, but that doesn’t mean they’re T not suitable for beginners in this discipline. It’s not much of a surprise that a Gentoo-based distro like Pentoo is more complicated
Linux Format11 min read
Enhance Email With A Better Thunderbird
Think email client and the obvious example is Mozilla’s Thunderbird. But whether you’re a T long-time Thunderbird user or looking for a new email client, you may find that Betterbird is – if you’ll excuse the pun – a better fit. That’s particularly t

Related