The ALU

The ALU February 3, 2019 by thepigeonfighter The Arithmetic-Logic Unit All of mathematics solved with six bits. The ALU is the work-horse in the CPU. It is responsible for almost all computations. In previous posts I have described building various kinds of chips that have somewhat simple functionality. Each chip was required to have a specific behavior that can be repeated giving the same result every time. The last chip I described which was the Full-Adder was the first chip that had some immediate mathematical utility. Well this is the post where we bring everything together to create the most complicated chip we have made thus far, which will be able to do the following : ...

February 3, 2019 · thepigeonfighter

In Addition to That…

In Addition to That… January 26, 2019 by thepigeonfighter This is where we learn how to do addition in the lowest levels of computer architecture. After completing project one you are left with five, 16-bit chips and no real idea where to go next, or why you made them. Luckily, you don’t have to be as smart as the guys who invented the computer in the first place, and you can always just continue on with the course. In project two you are commissioned to build five more chips. Four of them have to do with addition and the fifth one is the main ALU chip of CPU, which I will talk more about in a later post. One question you might have is what exactly do I mean by 16-bit chips. Well, in previous posts I have talked about the NOT and the MUX chip. Both of those would be considered single-bit chips, because you are feeding them one bit (a zero or one) at a time. So a 16-bit version of those can handle inputs of 16-bits at the same time. Why would you want to do that? Other than the obvious speed benefit when using 16 bits, all of the sudden you have the ability to start representing numbers greater than one. In fact, for an unsigned (only positive) 16-bit number can be as large as 65535, which is awesome because I don’t know about you but I am ready to get back to the real world where 1+1 = 2 despite what Boolean Algebra tries to tell you. But before we ascend to the world of comfort and normalcy that normal arithmetic offers, we must descend back into the weird world of binary. Let me give you a couple examples of how some of these 16-bit chips work. ...

January 26, 2019 · thepigeonfighter

Muxtopia

Muxtopia January 26, 2019 by thepigeonfighter My last post introduced the trivial but necessary “Not” chip. Before I move away from the first project I would like to mention one last chip that I found intriguing and especially difficult to solve. That chip is called a “Multiplexer” chip, or a “Mux” chip for short. This chip has a much more complicated specification than the “Not” chip. How it works The mux chip has three inputs which I will refer to as ‘a’, ‘b’, and ‘sel’ short for selector. The mux chip also has just a singular output. The functionality that we want from this chip is when the ‘sel’ input is 0 the out should equal ‘a’. If ‘sel’ is 1 the output should equal ‘b’. Therefore from that information we can derive the following truth table. ...

January 26, 2019 · thepigeonfighter

The Beginning

The Beginning January 17, 2019 by thepigeonfighter The Not Gate Recently I have started working on a project called Nand2Tetris. The idea of the project is to build a computer from first principles all the way to an OS that runs a Tetris clone. The course is totally open source and free to audit. Thanks to Noam Nisan and Shimon Schocken for all their hard work in putting this course together. ...

January 17, 2019 · thepigeonfighter