CPSC 220, Fall 2018
About the Second Test


The second test in CS 220 will be given in class on Wednesday, October 31. It will cover combinational and sequential logic circuits, the design of Larc-in-Logisim, binary integer arithmetic, floating point numbers, and ARMv8 assembly language programming. The material in the book is in Appendix A, Sections 1, 2, 3, and 5, and in Chapter 3, Sections 2, 3, 4, and 5, although we did not cover all of the details in these sections. Of course, Larc-in-Logisim is not covered in the book at all.

There will be no questions specific to Logisim. That is, I will not ask you about specific Logisim components or how to use them in the program; however, you will still need to know about things like registers and multiplexors and how to construct logic circuits using them. You might, for example, have to draw a circuit diagram for a circuit that includes a multiplexor.

There will be no questions about coding in Larc assembly or machine language. You do need to know the machine language well enough to answers questions about implementing it with logic circuits. I will give you a table of Larc machine language opcodes.

There will be some ARMv8 assembly language programming on the test. You are only responsible for the instructions listed at the end of this study guide, and I will give you the same list of instructions, so that you don't even have to memorize the mnemonics. (You do have to know what they mean and how they are used.)

The format of the test will be as usual. There will be four pages. The types of questions might include: definitions, short-answer and longer essay-type questions, questions about floating point numbers, coding questions using ARMv8 assembly language, implementing C functions in ARMv8 assembly, reading and interpreting ARMv8 code, working with circuits and logical expressions, working with basic sequential circuits like latches and flip-flops, explaining what a given circuit does, and designing basic circuits that might be a part of Larc-in-Logisim.

You will be provided with tables of Larc registers and assembly language instructions.


Here are some terms and ideas that you should be familiar with:


combinational logic circuit
logic gates for AND, OR, NOT, XOR
the relationship between logical expressions and combinational logic circuits
constructing a circuit to compute a logical expression
constructing a circuit to implement a table of boolean inputs and outputs
finding the logical expression that describes an output of a circuit
constructing a circuit to add binary numbers
how to build a subtraction circuit from an addition circuit
multiplexor circuits
decoder circuits

feedback loops in logic circuits
sequential logic circuits
memory circuits
S-R (Set/Reset) latch
D Latch
the clock and its role in a computer
memory circuits that "trigger" on the rising or falling clock edge
D flip-flop
building a multibit register from flip-flops
using a multiplexor to select among different inputs to a circuit
general idea of how a computer works as a combination 
            of sequential and combinational circuits, driven by a clock

the Larc register file (inputs and outputs and how it can be constructed)
the Larc ALU and how it can be 
                 constructed from components that do arithmetic operations
the Larc Program Counter and how its input is computed
control wires and control circuits
how control circuits are designed, based on machine language opcodes
how the clock is used in the Larc simulation
how multiplexors are used in the Larc simulation

signed and unsigned integers
multiplying binary integers
dividing binary integers

IEEE 754 standard for 32-bit floating point numbers:
    1 sign bit, 8 exponent bits with bias = 127, 23 fraction bits
problems with floating point arithmetic:  
    rounding errors, multiplication and addition are not associative

ARMv8 floating point registers D0 through D31 and S0 through S31    
how parameters for C functions are passed to assembly language
how values are returned from functions written in assembly language

ARMv8 assembly instructions that you should know for this test:

       MOV Xi, Xj         MOV Xi, #I
       
       ADD Xi, Xj, Xk     ADD Xi, Xj, #I
       SUB Xi, Xj, Xk     SUB Xi, Xj, #I
       MUL Xi, Xj, Xk     SMULH Xi, Xj, Xk     UMULH Xi, Xj, Xk
       SDIV Xi, Xj, Xk    UDIV Xi, Xj, Xk

       LDUR Xi, [Xj, #I]    STUR Xi, [Xj, #I]
       LDUR Di, [Xj, #I]    STUR Di, [Xj, #I]
       
       FMOV Di, Dj        FMOV Di, XZR
       SCVTF Di, Xj
       
       FADD Di, Dj, Dk    FSUB Di, Dj, Dk
       FMUL Di, Dj, Dk    FDIV Di, Dj, Dk
       
       CMP Xi, Xj         CMP Xi, #I
       FCMP Di, Dj        FCMP Di, #0.0
       B Label
       B.EQ Label  B.NE Label  B.LT Label  B.GT Label  B.LE Label  B.GE Label