Skip to main content
Engineering LibreTexts

5.2: Understanding the MSCPU

  • Page ID
    76115
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    To understand the MSCPU, explanations and illustrations of a how a number of assembly instructions are implemented will be provided.

    3-address ADD operation

    The first instruction is a 3-address ADD operation using two register values as input. An example is shown below and an explanation will explain how this instruction works in the MSCPU.

        ADD Rd, Rn, Rm

    The value of the Rm is passed on the B bus directly to the ALU, and the value of Rn is passed on the A bus directly to the ALU. The ALU calculates the result and passes the value back to the Register Bank where it is stored in Rd. Note because only one operation unit, the ALU, is used, this operation can be run in one cycle.

    Screen Shot 2022-03-24 at 3.17.38 PM.png

    Figure 24: MSCPU ADD operation

    LSL operation
    The LSL operation is illustrated in the diagram below.

        LSL r1, r2, #4

    In this case the lsl operation uses the ShAmt (4) as input to the barrel shifter. The value on the B bus is the Rm register (r2). For a shift operation, the value from the shifter does not have to be sent to the ALU and so is passed directly to the mux to be selected and returned to the Register Bank to be stored in Rd (r1). Note, because only one operation unit, the barrel shifter, is used, this operation can be run in one cycle.

    Screen Shot 2022-03-24 at 3.18.40 PM.png

    Figure 25: MSCPU LSL operation

    MUL operation
    The mul operation is illustrated in the diagram below.

        mul r3, r1, r2

    For this instruction, the registers Rm and Rs are used as input. As with the shift operation, the value from the multiplier does not have to be sent to the ALU, and so it is passed directly to the mux to be selected and returned to the Register Bank to be stored in Rd. Note, because only one operation unit, the multiplier, is used, this operation can be run in one cycle.

    Screen Shot 2022-03-24 at 3.19.39 PM.png

    Figure 26: MSCPU MUL operation


    This page titled 5.2: Understanding the MSCPU is shared under a CC BY 4.0 license and was authored, remixed, and/or curated by Charles W. Kann III via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.

    • Was this article helpful?