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
Ultimate Desktop Upgrade!
LXF316 will be on sale Tuesday 28th May 2024 Word processors that can help craft that novel you’ve always been talking about and organise large projects. Revive the old roleplaying system for a digital age as we recreate our own play-by-mail gaming
Linux Format3 min read
Original Prusa XL
The wait for a bigger 3D printer from Prusa Research has ended, and it certainly overdelivered. Instead of simply upsizing its classic i3 design, Prusa chose to create a completely new Core XY tool changer with a 360x360 mm build plate. The machine c
Linux Format5 min read
Some Ansible Advice For Around The Home!
Of late, this writer has been busy creating new virtual hosts for different things and decided that it would be an ideal time to get stuck into Ansible. Things have evolved in system management since Bash. Ansible is a great way to deploy software c

Related