Page 116 - Anatomy of a Robot
P. 116

03_200256_CH03/Bergren  4/17/03  12:27 PM  Page 101
                                                                               COMPUTER HARDWARE 101
                            CISC
                            Complex Instruction Set Computers (CISC) have been the norm since the commercial
                            introduction of computers. The instructions are much more complex than those in RISC
                            machines (hence the name). Although a CISC machine may still have ADD and SUB
                            (subtract) instructions, it may also have MPY (multiply), DVD (divide), ECC (error
                            checking and correction), and MAC (multiply and accumulate) instructions that per-
                            form complex calculations. A MPY instruction typically requires a series of ADDs and
                            SHIFTs. A DVD instruction requires a series of SUBs and SHIFTS. A MAC requires
                            at least an MPY and an ADD.
                              It can be very expensive to build the control circuitry within a computer that can man-
                            age the cycles in such a complex instruction. What most processor designers did was
                            build a uCode (microcode) engine into the computer processor. Effectively, a small,
                            very high-speed uCoded RISC processor would be inside the CISC processor. The
                            uCode program would reside in high-speed Read-Only Memory (ROM) and would exe-
                            cute a very short series of uCoded machine cycles to carry out the intended CISC
                            instruction. The uCode for an MPY x,y instruction would look very much like the
                            following:


                                   uLOAD           z, wordlength     ; MPY instruction execution.
                            Loopr: uSHIFTRight     x                 ; Shift x
                                   uTSTskp Carry   x                 ; Was a 1 there?
                                   uADD            x,y               ; Yes, add Y to answer
                                   uDECJmp         z, Loopr          ; No, loop til done
                                   uRTN ...                          ; Finished


                              The uCode program would execute a series of shifts and adds to accomplish the MPY.
                            The advantage of uCoding the instruction set is that the CISC hardware could be sim-
                            plified. Many CISC instructions could be coded with just a few entries in the uCode
                            ROM. A CISC instruction set might take longer to execute a program, but the compiled
                            C programs (supplied by the users) would have a smaller number of bytes.
                              Some uCoded processors enable end users to supply uCode, which can be executed
                            out of fast RAM inside the uCode engine. This feature is an attempt by the CISC design-
                            ers to capture some of the advantages of the RISC architecture. End users can effec-
                            tively make their own instructions up. This is of use if the robot has one or two simple
                            algorithms that must run faster. It can be very difficult, however, to write uCode. The
                            documentation is often not very good, and support is often worse.
   111   112   113   114   115   116   117   118   119   120   121