CSCI 2150
Fall 2001 Final Exam -- Answers

The following is the answer key to the Fall 2001 CSCI 2150 Final Exam. In some cases, where the HTML does not prohibit it, I've elaborated on the process to get to the answers. This answer sheet was put together rather hastily, so there may be errors.

  1. If I wanted to clear bit positions 0, 1, 2, and 5 of an 8-bit value, what bitwise operation and corresponding bit mask would I use?

    Answer:

    Operation: AND
    Mask:110110002

  2. Mathematically, a left-shift by three bit positions is equivalent to what?

    Answer: Multiplication by 23.

  3. Assuming BX contains the value 1001h and the table to below represents the contents of a short portion of memory, indicate what value AL contains after each of the following MOV instructions.

    AddressValue
    DS:100023h
    DS:10015Fh
    DS:100210h
    DS:1003ACh
    DS:10045Bh
    DS:1005BCh


    Answer:

    MOV AL, [BX]     AL = 5Fh
    MOV AL, [1002h]  AL = 10h
    MOV AL, [BX+2]   AL = ACh


  4. Of the following jump instructions, indicate which ones will jump to the address LOOP, which ones will simply execute the next address (i.e., not jump), and which ones you don't have enough information to tell.

    Answer:

    Instruction Current Flags Jump to LOOP Not jump to LOOP Cannot be determined
    JNE LOOP SF=0, ZF=1, CF=0   XXXX  
    JMP LOOP SF=1, ZF=0 XXXX    
    JG LOOP SF=0, ZF=0, CF=0     XXXX
    JLE LOOP SF=0, ZF=1, OF=1 XXXX    


  5. Assume AX=1234h, BX=FEDCh, and CX=0000h. After the following code is executed, what would AX, BX, and CX contain?

    PUSH AX
    PUSH BX
    PUSH CX
    POP CX
    POP AX
    POP BX


    Answer:

    AX = FEDCh
    BX = 1234h
    CX = 0000h


  6. Assume that before each of the following instructions, AX=90FFh. What will ZF, SF, and CF equal after executing the instruction? IMPORTANT: Note that these instructions are not executed in a sequence as the problems we did in class were. Leave the flag blank if it is not affected by the instruction.

    Answer:

    Instruction Zero Flag Sign Flag Carry Flag
    INC AX 0 1  
    INC AL 1 0  
    SAL AX,3 0 1 0
    SAR AX,1 0 1 1


  7. What is the purpose of the ALU in a microprocessor?

    Answer:

    To perform arithmetic and logic.

  8. What is the purpose of the segment/pointer pair CS:IP?

    Answer:

    CS points to the segment containing the code being executed and IP points to the next instruction in that code to be executed.

  9. What is the purpose of the segment/pointer pair SS:SP?

    Answer:

    SS points to the stack segment and SP points to the top of the stack, i.e., the next location to store data if a PUSH instruction is executed.

  10. Name the two benefits of the segment/pointer addressing system of the 8088.

    Answer:

    Allows for relocatable code and allows 16 bit registers to address 20 bit addresses.

  11. If a processor takes 3 cycles to execute any instruction (fetch, decode, execute), how many cycles would a pipelined processor save over a non-pipelined processor to execute 15 instructions?

    Answer:

    A non-pipelined processor would take 3*15=45 cycles to execute 15 instructions.

    A pipelined processor would take (3 - 1) + 15 = 17 cycles to execute the same 15 instructions.

    Therefore, a pipelined processor would save 45 - 17 = 28 cycles over a non-pipelined processor.

  12. Circle all of the following 8088 registers that are 8-bit registers.

    Answer:

    The following registers are 8-bit registers:

    c. BL
    e. CH
    h. DL

  13. What physical address does the segment/pointer combination 2000:01A3 represent?

    Answer:

    First, multiply the segment address by 1610. This simply adds a zero to the right side of the value. Then add the pointer value. This gives us 2000016 + 01A316 = 201A316.

  14. On an 80x86 processor with 20 address lines, how big is the processor's memory space?

    Answer:

    220 = 1 Meg

  15. On an 80x86 processor with 20 address lines, what is the maximum number of I/O ports?

    Answer:

    216 = 64K



  16. Which of the following 80x86 assembly commands is used to write data to an I/O port?

    Answer:

    b.) OUT

  17. What assembly language command on an 80x86 processor is used to read data from memory?

    Answer:

    MOV

  18. On an 80x86 processor, which of the following lines is pulsed low during a read from memory?

    Answer:

    a) ^MRDC

  19. How are comments identified in an assembly language program?

    Answer:

    Anything after a semicolon (;) is ignored by the assembler.

  20. List an advantage we discussed in class of interrupts.

    Answer:

    It frees the processor from having to constantly check a computer resource such as the keyboard to see if data is ready.

  21. Define the term hot-swappable.

    Answer:

    The computer peripheral can be connected or disconnected from its bus without powering down the computer.



    Questions 22 and 23 are based on the following RS232 signal sent with 8 data bits and odd parity.
  22. What is the binary value being transmitted in this signal?

    Answer:

    001010112

  23. True or false: The parity bit is correct.

    Answer:

    True -- There are 4 ones in the data and the parity bit equals 1. Therefore, the sum of the ones in the data and parity is equal to 5 which is an odd number. Since parity is odd, then the parity bit is correct.

  24. Classify each of the following characteristics as RS232 serial (R), USB (U), Firewire(F), GPIB (G), or SCSI (S).

    Answer:

    R - Serial point-to-point communications
    F - Developed by Apple for the transmission of video and audio
    G - Primarily used for scientific instrumentation
    F - Can have at most 63 peripheral devices connected on a single network
    U - Uses two possible data connection speeds on a single network