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]

Comments

  1. t&p says:

    after this semester I too will know and make an ALU for my computer architecture class!
    Supposedly the control unit is going to be the hard part in designing my CPU.

    • It warms my heart that people are still learning such things! Good luck in your class!

      • qwerty says:

        Yup. In a purely consumer world filled by cellphones and black boxes programmed in Java, reading the above post made me feel there’s still hope somewhere for students.

      • max says:

        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….)

  2. BS says:

    “[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.

  3. Ian says:

    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

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s