How The 8085 ALU Is Structured

8085-alu-reverse-engineering

This is a microscopic photograph of an 8085 processor die. [Ken Shirriff] uses the image in his explanation of how the ALU works. It is only capable of five basic operations: ADD, OR, XOR, AND, and SHIFT-RIGHT. [Ken] mentions that the lack of SHIFT-LEFT is made up for by adding the number to itself which has the effect of multiplying a number by two; the same mathematical function performed by a shift operation.

His post details the gate arrangement for each ALU operation. This is clear and easy to follow, and was based on reverse engineering work already done by a team who meticulously decapped and photographed the dies.

Not long ago this explanation would have been voodoo to us. But we worked our way through The Elements of Computing Systems text-book by following the online Nand to Tetris course. It really demystifies the inner working of a chip like the 8085.

Now if you really want to understand this ALU you’ll build it for yourself inside of Minecraft.

[Thanks Ed]

10 thoughts on “How The 8085 ALU Is Structured

      1. People learning how to program in Java = IT-Majors
        People learning how to build ALUs and how to program in C = Electronics Majors

        (Disclaimer: I’m writing this as an Electrical Engineering Student)

        PS: Admittedly IT-Majors are equally important, because while smart low level programming can improve execution speed by maybe 2-10. Choosing the right algorithm or developing a better algorithm can make a program Millions of times faster.
        (Lets compare a Bubble Sort Algorithm written in Assembler to a Quick Sort implemented in Java for a high number of inputs….)

  1. “[Ken] mentions that the lack of SHIFT-LEFT is made up for by adding the number to itself which has the effect of multiplying a number by two; the same mathematical function performed by a shift operation.”

    It took me a minute or two to understand this.

    I didn’t make sense until I realized it was binary, not decimal.

    Then it made sense.

  2. Although the ALU may seem quite limited, I once disassembled a ROM from an 8085 PCB and found that it was able to run a full-blown RTOS. There is a lot of power in those simple instructions.

Leave a Reply to Kris LeeCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.