A computer stores information in its registers and RAM, and manipulates information through a variety of means. The component that is responsible for our bulk of these operations is called the arithmetic logic unit or ALU. As this name implies, the ALU performs both arithmetic and logic operations. In this lecture, we focus on describing the general functionality of a simple ALU. ALU is very between architectures, so this microlector is intended only to introduce the basic concepts of an ALU. A computer's registers, each store the same number of bits. When we want to manipulate what is stored in these registers, the register file will be instructed to send the contents of two registers to the ALU. In this example, the registers are 8 bits in length. The ALU will perform a calculation on these two values and send the result back to the register file to be stored. We tell the ALU what instruction to perform by sending it a set of control bits that encode a message of what operation to perform. Because the ALU is a combinational circuit, it will perform these calculations immediately. Simplify the diagram. We will use a bus notation where we group sets of wires together and indicate how many wires are in that group. Rather than draw three sets of eight wires, we will simply draw three buses. An ALU can perform whatever arithmetic operations that we know how to implement, such as addition, subtraction, multiplication, as well as decrement and increment operations. It was logical operators such as not and or, and others comprise a list of non-air arithmetic operations such as value comparisons and setting a register's contents to zero. The details of these operations are covered in another lecture. Suppose that we have an ALU that receives two control bits, because there are two control bits, we can encode four operations for the ALU to perform. I have chosen two arithmetic operations and two logic operations for this example. The ALU receives inputs from two 8-bit registers, it sends out 8 bits of information back to the register file. Based on the data from the control bits, the ALU knows which operation to perform. In this situation, the ALU calculates the sum and sends it to the register file. If we change the control bits, we will change which operations performed. Because this operation does not need an input from B, the B inputs will be ignored. The ALU will send an increment of value of A back to the register file. To briefly introduce the logic operations, we will examine one of the simpler operations such as the not operation. The not operation receives only one set of inputs. So again, the ALU will ignore the inputs from B. The not operation changes all zeros to ones and all ones to zeros. The not operation is applied to each bit in the register individually, otherwise called a bitwise operation. Finally, if we change the control bits again, the ALU will perform a clear operation, which means that we will set the contents of a register to zero. For this operation, the ALU ignores both inputs and simply sends out the value zero. Notice that the ALU is sending out eight zeros because all numbers, even zero, are encoded with the same number of bits in a computer. In this lecture, you saw that an ALU receives information from the register file and then performs operations on this information. The control bits encode information about what operation the ALU is to perform. These operations will either be arithmetic operations or bitwise logic operations.