Page 344 - Embedded Microprocessor Systems Real World Design
P. 344

Appendix D

                Basic Microprocessor Concepts













                A microprocessor is a compact computer. Early microprocessors were much simpler than
                the typical minicomputers and mainframes of  the day, but many modern  microprocessors
                are more  complex and powerful than  computers of that era. Dozens of  different micro-
                processors are available from many manufacturers, and they vary in speed, power, size, and
                capability. Regardless of  the complexity, though, the basic  architecture at the heart of  all
                microprocessors is the same.


                                        A Simple Mlcroprwessor

                The core of a microprocessor is the arithmetic logic unit (ALU). The ALU takes in two values
                and produces a result. The result can be the sum of the two input values, the difference, a
                logical result  (ANDing or ORing all  the  bits together),  or some other operation. Which
                function is performed is determined by control inputs to the ALU. Figure D.l shows a simple
                ALU that operates on two inputs, X and Y,  producing a result. The inputs and the output
                can be any number of bits, 1,4, 8, or 16.
                  This ALU can perform four functions: addition, negation, logical AND, and logical OR.
                Addition is a simple, binary, mathematical addition. Negation inverts all the bits in the input
                variable, making zeros into ones and ones into zeros. The AND function ANDs  the bits of
                the two variables, making any given output bit one only if both corresponding input bits are
                ones and zero otherwise. The OR function performs a bitwise OR, making the output bits
                one if either of the corresponding input bits is one, and zero only if both inputs are 0. These
                operations are illustrated next with 4bit values:
                  Variable A  1001
                  Variable B:  1100
                  A ORed with B:  1101
                  A ANDed with B:  1000
                  A negated: 01 10
                  B negated: 0011
                  Where do the numbers come from? Figure D.2 shows an expansion of the ALU concept,
                adding two banks of four registers each. Each of the eight registers has the same number of


                                                                                     325
   339   340   341   342   343   344   345   346   347   348   349