The arithmetic logic unit (ALU) is the central core of a central processing unit (CPU). The ALU is simply a digital circuit that performs arithmetic and logical operations on binary numbers. They are combinational logic circuits which means that their outputs change asynchronously in response to changes to their inputs. ALU circuits perform operations on integer binary numbers. All microcontrollers contain an arithmetic logic unit (ALU). It is a fundamental building block of the CPU.
An ALU has two integer inputs called operands and another input called an opcode. The opcode instructs the ALU which instruction to perform (like addition, subtraction, decrement, increment, AND, OR, NOT, XOR, etc.). The opcode code is a binary code that comes from the instruction set (or program) that is being executed. The instructions or program will contain both the operands or numbers to be used and the opcode that tells the ALU what to do with the numbers, eg. add the numbers. These instructions are usually written in a higher level programming language and are stored in the computer's main memory. A compiler will compile the higher level language program and convert it to machine code. The computer executes one instruction at a time.
This course focuses on the ALU. This course explains how arithmetic and logical operations are performed within a CPU. This course explains how the instruction from the machine code from a compiled computer program gets translated into useful code for the ALU to determine which operation to perform and where the data is coming from.
Learning Objectives
At the conclusion of this course the student will learn:
• how an ALU selects its different functions
• how ALUs were designed in early computers
• how an ALU uses its operands
• how an ALU uses its opcode
• how an ALU performs subtraction
• how a full adder works with carry in and carry out
• the difference between a half adder and a full adder
• the logic diagram of a full adder
• how to describe an ALUs operations with a truth table
• how an instruction set is converted into machine code
• how machine code is decomposed into an opcode that configures the ALU for a particular operation
• how an ALU is integrated into a CPU
• how the fetch-decode-execute cycle works in a CPU
• the significance of the 74181 ALU in early computers
• how many arithmetic and logic operations that a 74181 ALU can perform
• the schematic and truth table of the 74181 ALU